LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

filter

Hello all,
 
I want to filter an analog signal with an IIR low pass filter. When I have filtered the signal
for a couple of seconds, I want to change the cut off frequency from 0.1Hz to 0.01Hz.
I know, it's a very lo frequency.
 
When I change this frequency, the filter resets. This is not what I want. Is there another way
to filter a signal and change the cut off frequency during filtering a signal?
 
Greets,
 
Martijn
0 Kudos
Message 1 of 13
(3,258 Views)
Martijn,

Any filter has a transient response when it first starts, so I think you will have difficulty with switching cutoff frequencies.

Can you run two filters, one at each frequency, and select which output you want to view?

Lynn
Message 2 of 13
(3,214 Views)
Hello Lynn,

But all these filters in LabView take "0" as a reference, that's why there is a big step at the
beginning of these filters. Why can't I give these filters another starting reference?

When I use two filters, the 0.01Hz filter takes a very long time to reach it's steady state. I'm
doing a measurement of 2minutes and when I use the 0.01Hz filter, this filter is at the same level
the signal is when the measurement is almost finished.

Do you have other sugestions?

Martijn
0 Kudos
Message 3 of 13
(3,200 Views)
Martijn,

I was off work a few days due to illness so I did not see your query until now.

With a 0.01 Hz cutoff frequency 2 minutes is just slightly longer than one cycle of a signal which would pass through the filter. The transient is almost certainly longer than that.

Your question about a starting reference makes it sound like your signal has a significant DC offset. I do not know of any way to give a filter a different reference point. Almost all filter literature assumes periodic time varying signals with no DC offset because it is mathematically more convenient and for most signals (except where the desired output is DC), a reasonable assumption. If the offset is known or varies more slowly than your signal, perhaps you could subtract it off before filtering and then add it back in if needed after the filter.

Can you describe in more detail what you are trying to do? What is the source of the input signal? How much DC offset does it have? What interfering signals are likely to be present? What is the desired signal and what are you going to do with it after the filter? With this information someone may be able to offer an alternative approach to solving your problem.

Lynn
Message 4 of 13
(3,168 Views)
Hi Martijn,

it might be usefull to open up the LabVIEW filter VIs, some of them have the possibility to feed a filter into it.

Be aware you change a copy and not the original!

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 13
(3,160 Views)

Hello Lynn,

 

You're right about the filter literature and I also have a big DC offset in my signals. Maybe it is a possibility to substract

them from the signals. But the problem is that the signals have to be measured, filtered and assessed real time. So I don't

know the maximum DC offset.

 

What I want to do is sample a signal form an external opamp with a DAQcard (). The frequency is 10kHz. I want to assess

it real time and store it in a *.TDMS file. The filtered data is displayed in a graph. The DCoffset is very big. 1Vdc and +/- 100mVac.

I want to filter with a LowPass filter from 0.01Hz so the filter creates a smooth line which filteres out almost all AC and follows the

DC (well when it has reached the DC level 🙂 ).

 

I hope this helpes a bit.

 

Martijn

0 Kudos
Message 6 of 13
(3,136 Views)

Hello Ton,

 

I have taken a look in some of the LabView filter VI's, but I couldn't find anything what has something to do with

a DC offset. But what do you mean with feedinbg a filter into such a VI? What is the advantache of feeding a

filter into a VI?

 

Martijn

0 Kudos
Message 7 of 13
(3,135 Views)
Martijn,

Please clarify a few things.

1. The frequency is 10 kHz. Is this the sampling frequency or the frequency of the AC component? What is the nature and source of the AC signal?

2. You mention assessing and measuring in real time. "Real time" does not always mean the same thing to different people. How much time delay can you allow between the occurrence of the signal and the availability of the measurement? Is the result of the measurement used to automatically control something or is it just displayed to a user?

3. You mention "following the DC..." This suggests that the DC level is varying with time. How fast does it vary? How often do you need updates? Do you need to know the DC level or do you need to know something about the AC signal or both?

Depending on what you are doing with these signals, there may be other approaches besides filtering which would work well.

Lynn
Message 8 of 13
(3,118 Views)
Hello Martijn,

If you open the 'Butterworth Filter.vi' you will see it calculates the filter coefficients (every time) and calls the IIR Cascade Filter.vi
Inside the IIR Cascade Filter.vi you will see a so called 'functional global'
You could feed the output of the fast filter to the input of the slow filter, but you should do it on copies of the original and with a little twist:

Here are some disclaimers:
I have never tested or used this trick

Ton


Message Edited by TonP on 02-18-2008 08:32 PM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 9 of 13
(3,116 Views)

Hello Ton,

 

Thank you for your aswer. I'll soon take a look at it and try what you suggest.

 

Martijn

0 Kudos
Message 10 of 13
(3,092 Views)