This project helps in prallelizing audio processing. It plays around with .wav audio files and plots an audio spectrum with the help of cuda FFT library. The goal of this project is:
- To capture 2-channel stereo, 16 Bits, Little Endian, .wav audio files at a sampling rate of 16000 Hz
- Convert that file into single channel mono raw file.
- Convert into the PCM data set.
- Analyzing the PCM data and plotting the time domain graph for that.
- Applying the cuda fft library to get the graph in frequency domain.
- Create an audio spectrum.
This project contains two different cuda kernels:
- Kernel to convert stereo to mono audio file.
- Kernel to convert stereo audio to PCM (Pulse Code Modulated) data.
To start using the project, you need to have the following system requirement:
- Nvidia Jetson Tx1 board running Tegra Ubuntu.
- A USB microphone and a USB speaker.
- Pre-installed ALSA library.
- Gnuplot for plotting the graphs.
Steps for downloading and using the application are:
-
Download the project:
$git clone https://github.com/shauryajai/Cuda_Audio_FFT.git
-
Open the project home directory and compile the application.
$cd ~/Cuda_Audio_FFT $make
These commands will create two executables (i.e. audio and cuda_audio).
-
Now, get the name of the audio recording and playback device:
$aplay -l $arecord -l
-
Open the run.sh bash script and update the audio device name in that file.
$sudo nano run.sh
I.e. change the "-Dsysdefault:CARD=CinemaTM" to your own device name.
-
Now, you are all set up too record and get the audio spectrum. Just run the script updated above:
$./run.sh
Incase you don't have a USB microphone and a speaker, you can run this project by directly using the "test.wav" sample audio file. Follow these steps if you don't have a microphone or a speaker:
-
Follow the 1 and 2 steps given in the section above.
-
Run the executables:
$./audio $./cuda_audio