Fast Cross-Correlation
Create a directory for binary files and call cmake:
mkdir bin
cd bin
cmake ../
Compile the library:
make
Suppose you have a wave file called audio.wav
with multiple channels, a sample rate of 16000 samples/sec, and a sample format of signed 16-bit, you can run the demo as follows:
To run GCC, and store results to a csv file called tdoas_gcc.csv
:
./tdoa -i audio.wav -m gcc -o tdoas_gcc.csv
To run FCC, and store results to a csv file called tdoas_fcc.csv
:
./tdoa -i audio.wav -m fcc -o tdoas_fcc.csv
The TDoAs are computed with a sequence of 4 operations:
- stft: Compute the Short-Time Fourier Transform (STFT) for each microphone
- scmphat: Compute the Spatial Correlation Matrix and perform Phase Transform
- gcc: Perform Generalized Cross-Correlation -or-
- fcc: Perform Fast Cross-Correlation
- qi: Compute quadratic interpolation
To measure the execution time of all operations with two microphones for 1,000,000 iterations, we can run the following command:
./speed -c 2 -r 1000000