LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

accurate fft after dc offset removal

Solved!
Go to solution

I'm new to labview pls. I tried to remove the dc offset of a generated sine signal but observed that the fft does not work well, it only sees the magnitude of the first amplitude. However, if I connect the signal directly without dc removal, it works well. Can someone advise on what to do because it is important that i remove the dc offset. And I do not want to presume that I have knowledge of the offset.My VI is attached.

0 Kudos
Message 1 of 4
(4,699 Views)
Solution
Accepted by topic author Lolps

Use a slightly different technique for removing the offset. The Averaged DC-RMS.vi produces a waveform of offset values while you really only want a single scalar value. Use the Mean.vi (Mathematics >> Probability & Statistics palette).

 

remove offset.png

 

There is no need to feed a waveform to the FFT.vi because it only looks at the Y values. If you want a waveform-like cluster to feed to the graph, you can either create your own from the sampling rate and number of samples or use the FFT Spectrum (Mag-Phase) VI from the Signal Processing palette.

 

You also seem to have an aversion to straight wires.  It is much easier to read and understand a block diagram if the wires have minimal numbers of bends and do not pass behind other objects.

 

Lynn

0 Kudos
Message 2 of 4
(4,664 Views)

And some words about an accurate FFT:

 

The FFT assumes that the signal provided is periodic and you provide exactly one (or n) periodes. In all other cases you get a more or less accurate FFT result.

If you provide one (or n) full periodes of your signal, the offset will show up in the first bin, no need to remove it 😉

 

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 3 of 4
(4,638 Views)

Hi Lynn,

 

It worked nicely.

 

Thanks.

0 Kudos
Message 4 of 4
(4,631 Views)