Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

how one can subtract the DC value of a frequency domain signal using the FFT vi ?

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.

0 Kudos
Message 1 of 11
(11,331 Views)

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.

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 11
(11,325 Views)

What do you mean? i dont really understand =x

0 Kudos
Message 3 of 11
(10,847 Views)

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

0 Kudos
Message 4 of 11
(10,831 Views)

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.

Download All
0 Kudos
Message 5 of 11
(10,824 Views)

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

0 Kudos
Message 6 of 11
(10,813 Views)

Okie! thanx!

0 Kudos
Message 7 of 11
(10,807 Views)

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)

0 Kudos
Message 8 of 11
(10,500 Views)

Here is a 2009 version.

 

Lynn

0 Kudos
Message 9 of 11
(10,498 Views)

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)

0 Kudos
Message 10 of 11
(10,449 Views)