3 ms·
This is the most concise explanation of Gaussian peak interpolation from the article that I can find. Unfortunately it's a pdf, but it does have a full example:
by zackmorris 8y ago
This is the most concise explanation of Gaussian peak interpolation from the article that I can find. Unfortunately it's a pdf, but it does have a full example:
http://www.add.ece.ufl.edu/4511/references/ImprovingFFTResoltuion.pdf http://www.add.ece.ufl.edu/4511/references/ImprovingFFTResol...
RFFT_SIZE = 256
magAddr: points to array of FFT magnitude results
sample_freq = 8000Hz
TI_FFT(): TI optimized function to calculate FFT
maxidx_SP_RV_2(): TI optimized function to find maximum value in array
TI_FFT(); //perform TI FFT analysis.
int max_bin = maxidx_SP_RV_2(magAddr, RFFT_SIZE>>1); //find max bin
float freq_rez = (float)sample_freq/RFFT_SIZE; //calculate frequency resolution
float inter_bin = max_bin + log(magAddr[max_bin+1]/magAddr[max_bin-1])*0.5
/log(magAddr[max_bin]*magAddr[max_bin]/(magAddr[max_bin+1]*magAddr[max_bin-1]));
//calculate the intermittent bin on continuous spectrum using GI
freq = (unsigned)(freq_rez*inter_bin); //calculate max input frequency
I believe that the above is C code, so the array indices are 0-based.
I can't find anything on TI_FFT except a bunch of PowerPoints, so you'll probably want to use a better documented FFT function:
https://www.google.com/search?q=TI_FFT&tbs=li:1 https://www.google.com/search?q=TI_FFT&tbs=li:1
Here is the maxidx_SP_RV_2() function:
http://read.pudn.com/downloads543/sourcecode/embedded/2242363/C28x_FPU_LIB/maxidx_SP_RV_2.asm__.htm http://read.pudn.com/downloads543/sourcecode/embedded/224236...