LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use Zero phase filter for continuous filtering?

I have to filter a large amount of data without any phase shift from original signal. The Zero phase filter does it but it has to be used in single shot mode. It doesn't have any "Init/Cont" input terminal which other filters have. Is there any way to implement zero phase filtering to filter data continuously?

0 Kudos
Message 1 of 6
(3,246 Views)

The Zero Phase filter (DBL) VI has an init/cont terminal, which is optional.
init/cont controls the initialization of the internal states. The default is FALSE. The first time this VI runs or ifinit/cont is FALSE, LabVIEW initializes the internal states to 0. If init/cont is TRUE, LabVIEW initializes the internal states to the final states from the previous call to this instance of this VI. To process a large data sequence that consists of smaller blocks, set this input to FALSE for the first block and to TRUE for continuous filtering of all remaining blocks. For more details, refer to: http://zone.ni.com/reference/en-XX/help/371361E-01/lvanls/zero_phase_filter/

0 Kudos
Message 2 of 6
(3,224 Views)

The Zero phase filter vi in the reference document is mentioned as an obsolete vi, in recent labview versions. If we open that vi, there is a warning, saying this vi is obsolete and has to be replaced with new vi which is not having that "Init/Cont" terminal. If we search for zero phase filter in labview palettes, we get a vi which is not having any option for continuous filtering. 

I have tried that obsolete vi for continuous filtering, with initialisation only for first instance. But there is some distortion in the output data , probably due to initialisation in every instance.

It seems it is not suitable for continuous filtering.

0 Kudos
Message 3 of 6
(3,203 Views)

See this thread were I talked about implementing a zero phase filter.

 

ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(3,195 Views)

The zero phase filtering method seen in your thread will work, if the filtering happens as a single shot operation. It will remove the edge effects of zero phase filtering.

 

But for an application wherein data arrives as small blocks, it has to filter each block of the data and also it has to maintain the continuity of filtering. 

For example in every 1 sec, I'm getting 500 samples of data. I have to use this zero phase filtering for each block of 500 samples, in each second. But what seems to happen is, between the end of one data block and beginning of next data block( between 500th sample and 501th sample or between the end of 1st sec data and beginning of 2nd sec data), there is a discontinuity, or distortion.

 

Normal IIR (butterworth)filter maintains this continuity between data blocks, but with phase shift.

Zero phase filtering doesn't introduce any phase shift but it is unable to maintain the continuity, it seems. 

 

Is it possible to have a filter meeting both these requirements?

0 Kudos
Message 5 of 6
(3,175 Views)

@AJ_CS wrote:

The zero phase filtering method seen in your thread will work, if the filtering happens as a single shot operation. It will remove the edge effects of zero phase filtering.

 

But for an application wherein data arrives as small blocks, it has to filter each block of the data and also it has to maintain the continuity of filtering. 

For example in every 1 sec, I'm getting 500 samples of data. I have to use this zero phase filtering for each block of 500 samples, in each second. But what seems to happen is, between the end of one data block and beginning of next data block( between 500th sample and 501th sample or between the end of 1st sec data and beginning of 2nd sec data), there is a discontinuity, or distortion.

 

Normal IIR (butterworth)filter maintains this continuity between data blocks, but with phase shift.

Zero phase filtering doesn't introduce any phase shift but it is unable to maintain the continuity, it seems. 

 

Is it possible to have a filter meeting both these requirements?


 

In a nut-shell yes.

 

It will require you apply the technique I illustrated in that thread repeatedly each time you get an update. The "reflection about the end points" cleans up the disconinuities. I suspect there may be some theory that what you end up with can not be proven using any formal math approach, but it closely mimics what the human mind does when we ask ourselves "If it continues like that that, what do I expect?".

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 6
(3,165 Views)