I computed this forward FFT using MS VC++ 6.0 and FFTW:
I don't think the "tail" should flick up like that at the low-frequency end. Is this caused by a lack of floating-point precision?
TIA
I computed this forward FFT using MS VC++ 6.0 and FFTW:
I don't think the "tail" should flick up like that at the low-frequency end. Is this caused by a lack of floating-point precision?
TIA
It would be a lot easier to have an opinion if one knew the input data and what is displayed...?
Rune
What are the two lowest frequencies calculated in that display?
This may be a result of having a non integer number of cycles at the lowest frequency computed.
It's a prediction of frequency synthesizer phase noise, generated by simulation. FFT input is 1e6 samples of VCO control voltage. Graph is generated by calculating modulation index at each point in FFT output (NBFM approximation). Phase noise dominated by VCO rolls off at -20dB/decade outside loop bandwidth. Spur is 100 KHz reference frequency. Due to use of
3rd order loop filter, noise slope should be 40-20=20dB per decade inside loop bandwidth, and it is, except where that "tail" flicks up.Does anyone recognise the effect?
TIA
I'm not sure what you mean by the two lowest frequencies.
FFT input is 1e6 samples, sampled at 1 MHz. There are 1e6 output buckets, each 1 Hz wide. Bucket 0 is DC (not plotted) Bucket 1 is 1 Hz Bucket 2 is 2 Hz e.t.c The data is not repetitive, essentially a steady DC level with noise and 100 KHz ripple.
So the line at the left side of the graph is really not information. the only information is in the points at 1 Hz,
2 Hz, etc. So 1Hz and 2Hz are the two lowest frequencies displayed by this graph.What would you expect to find in this data if the original samples contained some 1.5 Hz energy?
Does your data have a ramp in it?
1,2,3,4,5,6.... makes that sort of shape.
Ah! I think you put your finger on it. I've just removed the DC, and the problem has gone. When you have an exactly integral number of cycles, the FFT shows a sharp reponse, and when you don't, it spills into adjacent buckets doesn't it? I think my DC bucket is spilling.
Thanks John.
Phase noise? Is this the phase, not magnitude, as returned by the FFT?
This is a WAY to complicated an example to verify the FFT! To test the FFT, use one sinusoidal at a fraction of the sampling frequency, f = n/N*Fs, and see what happens.
You use FFTW. That library returns results in ways that some times are not at all obvious. Are you sure you unwrapped the results properly?
Rune
Damn. The problem is back. It's not just DC. I think I need to make the
1e6 samples end on the same value they started at. Something like a Hanning window. I think the discontinuity is creating a response at 1 Hz. Does FFTW do windowing?
I'm not exactly sure what your application of the FFT is for how ever, in one of my apps, I calculate a group, use only the middle results, shifted the original samples over and added to the samples and recalculated. You may want to look for "Continuous FFT" coding.
-- "I'm never wrong, once i thought i was, but was mistaken" Real Programmers Do things like this.
What do you mean by "flick up"? The graph provided has no "flick up". What the heck are you blathering on about?
-- JosephKK Gegen dummheit kampfen die Gotter Selbst, vergebens.
I'm not sure what is causing that, but it reminds me of the FFT graphs I get from LTspice.
BTW, what are you using to make that graph?
-- Ben Jackson AD7GD http://www.ben.com/
My C program outputs the data to a CSV file which I then paste into Microsoft Excel to plot the graph.
My C++ program generates 1e6 samples of aperiodic data, sampled at Ts = 1 MHz i.e. duration = 1 second; and I want to analyse the frequency content. I'm using an FFT; but I'm getting a strong response in the FFT output at 1 Hz. This would be correct if the same 1e6 samples repeated, but they don't. Is there any way to reduce this effect, or is it a fundamental limitation of the FFT?
This is probably just spectral leakage from the DC bin - my guess is that you are not applying an appropriate windowing function to the data prior to the FFT ?
Paul
Eliminating the DC component did not help. I am not using a windowing function at the moment. Can you suggest one? I don't mind sacrificing frequency resolution.
As a rule of thumb you almost always need to use a windowing function prior to an FFT. There are plenty to choose from but the Hann or "Hanning" window is a good choice unless you have any very specific requirements which might dictate an alternate function.
Paul
Thanks, Paul. The Hann window works well. I still get a large response at
1 Hz, which I would expect; but there's no spillage into 2 Hz and above.
Before you do any windowing, take out the DC and the trend. If the data has either, the windowing tends to make new problems. Chances are when you take out the DC and the trend, the problem will be much less without windows.
I've had good luck with 1.5 - cos(T) - 0.5*cos(2*T)
It depends a lot on what your data looks like and what you want to get out of it.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.