08-14-2009 09:27 PM
Attached are my screenshots of employing 2 different FFT VI's (1 from the signal processing toolkit & the other from waveform measurement). I fed into the input a step function & the resulting output you see in the screenshot. By the way, the 1st element of the array is ZERO & all the subsequent elements are = 1.0. As I change the dT to construct the waveform for the WAVEFORM FFT the 1st element magnitude changes accordingly which you would expect since the pulse width of the dirac delta is affected by this. Despite any change in dT the imaginary parts essentially remain unchanged & essentially = 0. I also included the analytical expression of the transform which clearly indicates the imaginary component is proportional to 1/freq.
The results on the screenshot do not reflect this behavior, why??? In fact the VI from the signal processing toolkit says the imaginary component is ALWAYS ZERO.
Do I need to scale the outputs by df to obtain this dependence & if so why is it not done within the VI's themselves?
This behavior is causing me problems in correctly analyzing the dynamic data of some servo-motors to which I apply a step voltage input. Is FFT not the way to perform this analysis? Should I actually be utilizing the formal definition of the the Fourier transform itself & if so is there such a VI that does this because everything I saw in the EXAMPLES finder employed FFT's exclusively?
08-14-2009 10:12 PM
08-15-2009 05:28 AM
Are you applying any window function. I guess your problem is related to that. Try to use the rectangle window. You could also see what is happening inside the FFT Spectrum (Real-Im) VI . Use a probes and track the result. A quite annoying factor is that you can not use the "save as" option with this VI, or its sub VIs. So you have to do a select all in the diagram then copy everything to a new blank VI. Then you rebuild the connector block. Post again if you have problems
08-15-2009 02:03 PM
08-15-2009 03:14 PM
OK, I created my own VI based on the formal definition of the Fourier Integral transform & compared the output against the output of the FFT VI's for the input of a step function. The output of my VI concurs with the analytical expression for the transform of the unit step function; whereas, the FFT's do not.
I attached my VI as version 8.5 for those who might not have 8.6 & I included the analytical expression of the transform. Anyone have any clues as to the problem with the FFT's or am I misusing them?
08-15-2009 05:16 PM
08-15-2009 08:49 PM
08-15-2009 09:34 PM
I am a fan of the NI examples, but I can't say I have tried out any of the FFT ones. In this case I think you are already performing the necessary steps. You are generating an input waveform and passing it into the FFT. It is up to you, but in my opinion, if you are looking to use these VIs as black boxes then the examples might help. If you really want to understand what is going on I think you need to read up on the math behind the FFT, not the algorithm (unless you are really interested), but of discrete Fourier transforms. If you are "wading" through a textbook, then I think you have picked the wrong one. One problem you are up against is different normalization conventions, LV picks one, Mathematica has another, your textbook may have yet another one. You should be able to read the context help in LV and know which one they have chosen. Deciding where to put N in the DFT is like deciding where to put Pi in the continuous FT.
Another thing you will learn in the textbook is the phenomenon of bin leakage. When the sampling frequency is commensurate with the signal frequency, all of the power ends up in a single bin and you wind up with what you call the "correct" freq. plot. When you change the sampling frequency, power spills into adjacent (and sometimes many adjacent) bins. This can all be described (look for a section on windowing), and as you said, you should know the exact location of the peaks. It is just that these locations are not always as simple as you imagine.
If I find them on Monday I'll post some VIs where I did some experimenting along these lines, otherwise, I'll try to answer a question or two for you. Keep plugging away.
08-15-2009 11:53 PM
Darin,
To summarize my observations of the "FFT & Power Spectrum Units" example VI to further aid in my comprehension of the DFT vs continuous transform is that I presume windowing refers to the time period which the sampling of the continuous waveform spans. This time period is = to the ratio of the array size & the sampling frequency. So if I have 100 samples @ 100 Hz I am observing the continuous waveform over a 1 second timeframe which would be acceptable for waveforms say 10 Hz or higher. If my waveform is @ 1 Hz or lower I need to observe over a longer time period?
Now having said that I am bringing every bit of knowledge I have of transforming singnals into the freq domain that I have, the continuous waveform vs the window type each have their own transform? The result of convolving the 2 is the product of the 2 in the freq domain? So if my window is rectangular & as you stated that is the sinc function in the freq domain I will observe absolute 0's in the resulting output of the FFT's on a periodic basis based on the width of my window? This seems to be what I am observing because I get 0+0j in the array output but what is a bit confusing is that if my continuous waveform is a sinusoid that should be 0 as well everywhere but @ the harmonic freq. When I inspect the array output I see very small values 10^-15 for both the REAL & COMPLEX components everywhere except @ the ZEROS I mentioned earlier & the hamonic freq. Is this due to the fact that the stimulus sinusoid is not actually analog & is being represented discretely as well? The end result is that these incremental steps of the stimulus are actually stair steps induce noise @ all freq's; hence, the ZEROS only occur @ the sinc function ZEROS?
Moreover, the magnitude of the peaks are effected by the length of the array since more multiplication & summation operations are being performed for larger arrays? The sampling freq effects the location of the peaks due to its effect on freq resolution?
Alot of ??'s but my verbalizing my ??'s help me digest the concept.
08-15-2009 11:54 PM
Sorry my suggestion didn't help solve your problem. But just to clarify... I know the -1 to 1 thing SHOULDN'T work, but for some reason that was the only way I could get the correct amplitude spectrum out of the function. The following images show the behavior I was talking about. I just took NI's realtime amplitude spectrum example and added a constant to the input sinewave to create an offset. You can see the behavior in the front panel is quite different...The peak at ~0.3 is present in both cases, but when I add the offset I get a bogus peak at the low end.
Jason