05-30-2011 06:12 PM
Can any one suggest how one can subtract the DC value of a frequency domain signal using the FFT vi ? I mean: I have an ac signal (1-10 Hz) with varying DC offset. I cannot use a high pass filter to remove DC. One option is to take FFT then subtract the dc value. Then take Inverse FFT.
05-31-2011 03:38 AM
As always with FFT you have to know your signal. Windowing and leakage are the keywords to look for. And yes FFT filtering is a tool that might work.
However a DC part is the mean value of your data. If you do a continuous data acquisition I would propose an exponential filter (a rebuild of a RC filter) with a high timeconstant . Computation is much less (one value memory and two add-multiply per datapoint) and you avoid jumps from one data block to the next.
01-01-2013 11:37 PM
What do you mean? i dont really understand =x
01-02-2013 08:06 AM
As Henrik said, you can remove the DC component but the results may not be what you want.
Removing the DC component of an FFT is, in fact, a form of high pass filtering. It does not give you much control over the filter response because it depends on the sampling rate and the number of samples. Leakage is a complication which makes the charactersitics of the signal (including the DC) have an effect of the filter response.
Please tell us more about your signal and the offset. Perhaps someone can offer a better solution. What is the source of the signal and the offset? How large is the signal? What is the smallest signal component of interest? How large is the offset? How fast does it vary? What is your samping rate? How many samples do you process at a time?
Lynn
01-02-2013 11:42 PM
Hi lynn!
I am not using a real time signal or a sine wave. I am using a downloaded ECG signal to get the spectrum. Here is my vi u can take a look.
01-03-2013 04:00 PM
Your method - subtracting the mean - is commonly used and often works well. If you look at the signal before and after subtracting the mean, you will see you still have some baseline variation. That may be respiration or motion artifact.The signal is clean enough that any threshold between 1020 and 1100 finds all the peaks.
TDMS files cannot be read on the Mac by the Express VI so I changed to the low level TDMS functions which are not platform dependent. This also has the advantage of generating waveform datatypes as the output rather thna the Dynamic Data Type. Using waveforms allows keeping the timing information. However, it appears that the timing information does not exist in your file, as it returns dt = 1. This results in x-axis displays not scaling appropriately for the signal.
Lynn
01-04-2013 03:07 AM
Okie! thanx!
04-02-2013 09:51 AM
Guys,
Could you be so kind to convert your example to LV2009, so I do not need to set up another post....
Many thanks in advance
Y3G (...when there is LTE)
04-02-2013 11:32 AM
Here is a 2009 version.
Lynn
04-05-2013 02:24 AM
Hy Lynn ,
Many thanks for your reply. Although I couldn't open two SubVis (Analysis), I could have guessed your approach. I tried before a similar approach as you can see from the pic but cannot get rid of the DC value although there is a 20 dB difference when not applying it.
Is it possible to get rid of the first BIN at all?
Since my FFT vector length are not always a power of 2, in my case the vector length is 614, I guess the Windowing takes care of it.
Any Idea how to improve my Spectral view?
My application is BB-15 MHz.
Many thanks for any hint
Y3G (...when there is LTE)