LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

butterworth filter : offset after filtering

Hi !

 

I am using a Agilent U2356A (acquisition central) to acquire a sinusoidal waveform, with a +/- 10 volts amplitude  and 300 Hz frequency. The Agilent central acquires 8000 points at 7812 Hz frquency.
I need to filter the signal to mitigate it at +/- 1 Hz.
I use a low pass filter (Butterworth) with an 2 order and a cutoff frequency of 100 Hz .
The amplitude of the obtained signal is correct, but the filter completely shifts the signal and it is not centered on zero after filtering.
In attached, a VI containing a table of the acquired data and the curve after filtering these data.

 

Thanks for any help,

 

Danaé

 

0 Kudos
Message 1 of 10
(8,296 Views)
What do you mean by mitigate it at +/- 1hz?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(8,267 Views)

Can you post vi as 2012 and/or a picture - hopefuly that will clarify your question as it is not entirely clear (if you are trying to acquire a 300Hz signal why do you have a 100Hz LP filter which will block the 300Hz? what is the +/-1Hz all about? the filter shifts the signal about zero - zero what? zero volts? zero Hz?)

0 Kudos
Message 3 of 10
(8,251 Views)

Yes, I'm sorry I have not been very clear.
So it's not +/- 1 Hz, but +/- 1 volt.
In fact I use a filter with the cutoff frequency of 100 Hz on a much higher frequency signal in order to attenuate the amplitude of my signal.
I want to get the sine  amplitude  of 10V to 1V using the filter.
This works except that the filter shifts the signal which is no centered on 0 volts but on -1 volt.

So I have an output sinus with  -2V / 0V amplitude but I would like a -1V / + 1V output sinus.

 

Thanks for your help,

 

Danaé

0 Kudos
Message 4 of 10
(8,241 Views)

So I am guessing that you probably have a slight offset on your input signal, which will get passed through the filter. Below you see a 300Hz signal passed through a 100Hz filter. The initial signal had 1V offset which carries through to the result.

 

butterworth offset.png

 

butterworth offset graphs.png

 

One way of removing this is taking a dc avarage and subtracting from the signal as given in this NI article

How Do I Remove a Dynamic DC Offset From My Acquired AC Signal? 

0 Kudos
Message 5 of 10
(8,230 Views)

Indeed, I had not thought to subtract the average. This is what I need!


Thanks a lot

0 Kudos
Message 6 of 10
(8,220 Views)

Did I get it rigth, that you have a signal of a certain amplitude and you want to scale it to 1V peak amplitude?

Why do you use a filter?  If the frequency is changing, so will the output amplitude of your filter.

My approach to such a problem would be:

Use tone detection to get frequency, amplitude  and phase of the measured signal and use this information to:

- create a clean analytical sine of the needed amplitude (and phase)

- simply scale by dividing the signal with the found amplitude .....

 

or:  LabVIEW has a dedicated vi for such a task.... to feed AWGs and AO tasks ...

 

 

 

 

 

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 7 of 10
(8,206 Views)

The subtract average will work if your signal is steady but if it varies over time then another approach would be to change the low pass into a bandpass filter with the lower cutoff frequency as low as you want to include the frequency in your result. DC is in fact simply 0 Hz frequency component and gets filtered out that way.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 10
(8,195 Views)

In fact, I have created  an acquisition software with Agilent centrals for a customer.
The acquired signals are linear (around 8 volts) and the client wanted to use a low pass filter to filter the acquired data (probably to remove noise).
I have to prove that the filter works, so the way to check this is to acquire a sinusoidal signal and filter it at lower, equal and higher frequencies than the cutoff frequency.
When I did that, I realized that the filter was shifting the DC component of my signal.
So I'm now wondering if the filter distorts the data of my continuous signals too...

0 Kudos
Message 9 of 10
(8,185 Views)

When I did that, I realized that the filter was shifting the DC component of my signal.

 

Filters don't do this (at least not LP Butterworth filters). Any dc offset was already present, introduced by your frequency source or your acquisition system or ground shift or waveform distortion etc. The filter won't add dc offset to the input signal (ac or dc).

 

Also, testing using a 20Vp-p 'noise' signal in a system designed to measure an 8Vdc signal seems a little extreme. Why not use your function generator to generate an 8V dc component with and without a realistic noise added (eg. a 2Vp-p 300Hz ac signal with 8V dc offset). Measure your results from (a) plain 8Vdc in and (b) 8Vdc with 1V, 2V, 3V, etc. of 'noise' added and look at the results.

0 Kudos
Message 10 of 10
(8,178 Views)