20 events
when toggle format what by license comment
Jul 26, 2021 at 12:21 comment added Paul R @KillzoneKid: no, that’s a different (internal) scaling factor. Usually there is a factor of 1/N for the size of the FFT (this is implementation-dependent however), and then there’s a factor of 2 if you’re only using the bottom half of the resulting FFT as mentioned above. You may also need other factors, for hardware calibration, window function loss, etc - these can often be combined into a single overall scale factor, for the sake of efficiency.
Jul 26, 2021 at 11:50 comment added Killzone Kid @PaulR Thank you for clarification. The documentation for FFT function says "Internally input is downscaled by 2 for every stage to avoid saturations inside CFFT/CIFFT process" which I assume you are reffering to. But this would mean that upscaling factor will depend on FFT size, or am I missing something?
Jul 26, 2021 at 11:13 comment added Paul R @KillzoneKid: for the case of a purely real input you can just ignore the upper half of the spectrum. If you care about absolute magnitude then you'll need to apply a factor of 2 to the magnitudes in the lower half of the spectrum to get the correct value (apart from the DC component at bin 0, which has no complement).
Jul 26, 2021 at 8:42 comment added Killzone Kid Does this mean when we calculate magnitude later, we can do it for half the array? Does the other half of the array have any use at all?
Apr 13, 2020 at 6:56 comment added Paul R @Mike'Pomax'Kamermans: think of the bin 0 component of the signal as the average value aka arithmetic mean (which is exactly what it is, mathematically). From an electronics or audio perspective this is the DC component. You’re right though that this bin will also contain some energy from signals with very low frequencies.
Apr 12, 2020 at 21:44 comment added Mike 'Pomax' Kamermans I'm confused by the notion that 0 Hz has an amplitude, though: 0 Hz is literally no signal, so is that actually not 0 Hz but instead "the bin for any frequencies between 0Hz and 43.1Hz"?
Jan 30, 2015 at 22:17 comment added Paul R @rayryeng: thank you so much - I think that's the nicest acknowledgement I've ever had in ~5 years of answering questions here on SO!
Jan 30, 2015 at 21:21 comment added rayryeng @PaulR - I wanted to thank you for this wonderful answer that has served me over the years. I would visit this answer before I had a StackOverflow account, and I actually forgot about thanking you once I signed up. I was recently taking a look at FFT stuff and I remembered your answer and just visited it now. Once I got here, I remembered to thank you... so thank you! Whenever I have a debate with someone on interpreting what the each point on the horizontal axis of the FFT is, I just point them to this link.
Aug 20, 2012 at 5:28 history edited Paul R CC BY-SA 3.0
added 274 characters in body; added 9 characters in body; added 2 characters in body
Aug 15, 2012 at 0:44 review Suggested edits
Aug 15, 2012 at 1:12
Dec 8, 2010 at 7:56 comment added Paul R @user532017: you should try plotting your power spectrum to see if it look reasonable - you may have bugs or other problems still to iron out. Also you need to use a window function prior to the FFT, otherwise you will get artefacts in the power spectrum. Read this: en.wikipedia.org/wiki/Window_function - I suggest you use a von Hann (Hanning) window.
Dec 8, 2010 at 3:14 comment added Rango Thank Paul very much. I had done it. But the results aren't slightly bad. I'm a wave file, I want to get peaks frequency at each Frame. I choose Frame's window length and shift length are 512 and 256, my N-Point=window length=512. Then I perform FFT in each Frame. My wave file is only a segment of whistles. My final result is the peaks frequency array of each frame. This is: [3750, 3750,3750,3750,4156.25, 531.25,875,406.25, 4125,4250,4250]. I don't understand a reason do my result have [..., 531.25, 875, 406.25,...] because frequency of whistle is between 3500-4500Hz. Do you know a reason?
Dec 7, 2010 at 10:14 comment added Paul R @user523017: yes, I think you have this correct now - the term spectrogram is not quite correct (it's really just a single power spectrum, not a spectrogram, which is a time-varying sequence of power spectra), but you have the right general idea.
Dec 7, 2010 at 10:12 comment added Paul R @user532017: yes, this is a very important point - the larger N (the longer the FFT) the higher the resolution - bigger N means each bin is narrower. The frequency range remains the same though: 0 to Fs/2.
Dec 7, 2010 at 9:30 comment added Rango Follow some document so that find the peak frequency, before I have to calculate spectrogram(rere + imim) array, then I have to find max value in spectrogram array above. Final I get index of element is max value in array, peakFrequency = index * SampleRate / NumSample. Is this right? Thank for your enthusiasm
Dec 7, 2010 at 9:03 comment added Rango I used FFT in a wave file. If I use NPoint = 512 , I will have Peak frequency is a Hz. If I use NPoint= 1024, I will have peak frequency is b Hz. Why the same wave file is the peak frequency difference? I don't understand that much. Please explain this for me, thank so very much.
Dec 7, 2010 at 8:04 comment added Paul R @user532017: no - sqrt(re*re+im*im) will be the magnitude of the signal at the frequency of the given bin. The frequency of the bin is determined by its index as per my answer above. If you find the bin with the largest magnitude then you can determine the frequency of this peak from the index as above.
Dec 7, 2010 at 3:30 comment added Rango Ah, if I get sqrt(realreal + imaginaryimaginary) on each of those complex numbers(real and imaginary parts of result), should it return the frequency (Hz)?
Dec 6, 2010 at 22:40 history edited Paul R CC BY-SA 2.5
added 63 characters in body
Dec 6, 2010 at 22:35 history answered Paul R CC BY-SA 2.5