Discussion:
remove DC component of dynamic data from FFT
(too old to reply)
softhead
19 years ago
Permalink
How does one 0 out the first element (or 2) of an FFT output without disturbing the rest of the data ?  I have converted to array replaced 0 element with 0 and plotted that with the spectra at the wrong frequency.  I converted back to dynamic data with similar results.  I was going to try the extract portion and then append signals with a 0 at the beginning, but this delays the loop somehow where the time plot is not keeping up any longer. 
 
Thanks,
bob
softhead
19 years ago
Permalink
Thanks Lynn and Jarrod.  I appreciate your suggestion lynn, but prefer to "window" the data in the frequency domain, and to disturb the spectrum as little as possible.  I can imagine that mutlipling by a matrix (mostly the identity matrix) might work as well, but I have no idea how the data is represented, from FFT output, to dynamic data, from dynamic data, etc.  I was using the FFT (peak) if the Spectra Measurements express VI and kinda thought that maybe it was just magnitude.  I have no idea what those elements are that Jarrod spoke of.  I will try Jarrod's suggestion, it should work, however it is a bit confusing how the "build waveform" can combine the orignal waveform with something else and come out with most of the original waveform, i.e. how does it know to replace the y-component as opposed to multiplyig, adding, OR'ing, etc.?  The help is not real clear on this. 
Thanks, Bob
softhead
19 years ago
Permalink
OK Lynn, things are a bit more clear now.  I see a (time domain) waveform has t0, dt, Y (data), and attributes.  I am guessing f0 and df are the frequency domain counterparts to t0 and dt - of course we need something to reference the X axis.  I am not sure what the attributes are.  Your description of the build waveform helps. 
Do you know how to set the FFT length when using the Spectral Measuements VI?  I have used the Collector express VI to collect the power of 2 samples first (it seems to work) otherwise it would seem the FFT would get bits and pieces at a time, at some point ti would have to calculate - maybe somehow based on f0, df and the x scale I have chosen??
Also, do you know if you can perform a function based on the event when a waveform chart reaches the end, i.e starts over?
Thanks, bob
jiankang
19 years ago
Permalink
You may remove the DC component from the magnitude array. Then build a spectrum cluster with the following information: start frequency (fo), frequency resolution (df) and modified magnitude array (without DC component).
Attached is an example based on Jarrod's code. Wish it helps.


Remove_DC_Component.vi:
http://forums.ni.com/attachments/ni/170/186616/1/Remove_DC_Component.vi
softhead
19 years ago
Permalink
Thanks for the input.  Jarrod's suggestion is working well.  I basically just want to display a signal that has a DC bias larger than the signal and want to see/analyze the AC part of the signal.  The other thing is that the signal could have a large component at 1Hz and we want to see this along with the other frequency content to 100Hz.  When input a 1Hz sine wave, I see the DC component (bias) of the FFT plot actually move up and down with the wave, as well as interfere with the 1Hz.  Maybe I have not got everything quit right with respect to FFT length, samping, etc, but we just do not want to see the signal without the bias. 
Thanks. bob

Loading...