Distribute the values from fft() logarithmically - not plotting
Show older comments
Hi all,
When I use fft(signal) on a music signal, I get linearly spaced power spectrum of length(signal) representing frequencies up to 44100hz. I want to distribute them on a log scale. If I semilogx(fft(abs(signal))) I can see what I want, but I want to be able to work with the values!
I think the best way to explain exactly what I want to do is explain what I want to achieve on a slightly higher level:
I want to sum the differences on the power spectrum of a music signal from one window to another. However for later purposes I want the (say) 20 frequency bins to be spaced logarithmically up to only 20000Hz.
I hope that explains my problem, please let me know if I should provide more detail. I have looked on google and had a search of this forum. Closest was this question with no answer http://www.mathworks.com.au/matlabcentral/answers/27211-audio-processing
I have:
binEdges = logspace(log10(20), log10(20000), numBins+1);
which defines the bins, but then I don't know how to test for the frequencies in the returned fft array.
Thanks very much for any help!
Answers (3)
Conrad
on 13 Oct 2012
Honglei Chen
on 13 Oct 2012
0 votes
If your frequency bins falls on frequency bins of an FFT, you can try Goertzel algorithm
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!