Custom FFT Bins for FFT1024?

Status
Not open for further replies.

bsumlin

Member
I have a project where I need to analyze only frequencies in the 1.2 - 1.5 kHz range, but I need some fine detail in the Fourier transform. Specifically, in my project, there is a resonant frequency that changes based on the ambient temperature and relative humidity, and is related to the speed of sound in air, given those two measurements. I need to know the amplitude of the Fourier component of this resonant frequency. Everything else is considered system noise. This frequency changes slowly, and tends to hover around 1395 Hz, plus or minus a few Hz. Therefore, I need more resolution than the ~43 hz provided by FFT1024. I need, ideally, 1 Hz resolution or better.

Is this possible? I don't see any functions that can set a certain frequency range. I'm looking into the guts of the Audio library but so far haven't found anything that looks like I can change the range. Any help would be greatly appreciated!
 
There is some history here on the FFT - or look around on WIKI for general info. The Aidio libssample rate of 43KHz ends up spread across the 1024 sample parts - the lower half usable. To get more focus in that lower band - smaller bin width takes a slower sample rate or a larger FFT … 4096. The Audio library samples at a fixed rate and does well to do what it does. You could collect the data and perform the FFT with custom code. It has been done for UNO - and TD's included ARM math libs have usable methods for doing FFT's.
 
I have a project where I need to analyze only frequencies in the 1.2 - 1.5 kHz range, but I need some fine detail in the Fourier transform. Specifically, in my project, there is a resonant frequency that changes based on the ambient temperature and relative humidity, and is related to the speed of sound in air, given those two measurements. I need to know the amplitude of the Fourier component of this resonant frequency. Everything else is considered system noise. This frequency changes slowly, and tends to hover around 1395 Hz, plus or minus a few Hz. Therefore, I need more resolution than the ~43 hz provided by FFT1024. I need, ideally, 1 Hz resolution or better.

Is this possible? I don't see any functions that can set a certain frequency range. I'm looking into the guts of the Audio library but so far haven't found anything that looks like I can change the range. Any help would be greatly appreciated!

- Sample at the standard frequency, say 44.1 kHz
- down sample to 4.41 kHz
- band-pass filter the band of interest (1.2 - 1.5 kHz)
- decimate by a factor of 4 (effectively resample data to 1.1025 kHz)
- carry out the 1024 point FFT
and you have a frequency resolution of about 1 Hz (frequencies flipped)
 
If you need to find a peak frequency at the sub-bin resolution there is a computationally efficient option, google "Jacobsen MQE". In the most recent paper he has options for different windows.
If you need fine resolution for other means - follow the post above.
 
Jacobsen & Kootsookis 2007: Fast, accurate frequency estimators. – IEEE Signal Processing Magazine June 2007: 123-125
citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.555.2873&rep=rep1&type=pdf

In the Teensy Convolution SDR it can be used to estimate the carrier frequency with an accuracy of 1-3 Hz with a sample rate of 96kHz!
BTW, thanks again Vlad, you were the one who pointed me to the Jacobsen estimator a long time ago!
 
There is one difficulty - Jacobsen MQE requires complex FFT which I run anyway, I can post the cfft code with the estimator, compatible with the audio lib (if you tell me where and how, I am bad at IT stuff).
There is a less accurate but simpler gaussian estimator that works on magnitudes.
But we need to know if your question relates to the peak estimation or something else...
 
Status
Not open for further replies.
Back
Top