08-11-2017 11:54 AM
I am using DAQ to read voltage change from two pressure transducer, one 0 to 5 bar, other 0 to 50 bar. In block diagram (as first picture 1), I read signal with DAQMAX and show merge the signal to one graphic indicator, the top line of merge signal be added a filter to filter the noisy of 0 to 50bar pressure transducer signal, however after filtering, (picture 2) the 0 to 50 bar data shows the time delay (white line) compare than 0 to 5bar data which is the one without filter(red line), How can I line up the after-filter signal with the original signal?
08-11-2017 12:12 PM
In real time, you can't. It's in the nature of low-pass filtering. In post-processing, you can try the Zero Phase filter. I've also heard of people passing data through a filter twice, but reversing the data for the second pass to "undo" the same delay induced by the first pass. I imagine that could leave some small edge effects at the beginning and end of the data.
-Kevin P
08-11-2017 12:52 PM
Maybe it isn't possible in true real time, but the delay introduced by your filter is a fraction of a second. If you are willing to delay the display of the data by that much time, you can sync the two signals by introducing the appropriate time delay to the waveform data.
Of course a lot of this depends on the type of filters you are using. How are you filtering your data? Do you need a particular type of filter, or will any smoothing function do?
08-11-2017 02:42 PM
You haven't shown us any code and there are millions of ways to filter a signal, each with adjustable parameters. Looking at your data, the noise is mostly comprised of small spikes, so I believe you could get away with much gentler filtering, which would also lessen the time delay.
What filter are you using, what are the tuning parameters and what is the reason for your choices?
08-11-2017 02:57 PM
@Kevin_Price wrote:
In real time, you can't. It's in the nature of low-pass filtering. In post-processing, you can try the Zero Phase filter. I've also heard of people passing data through a filter twice, but reversing the data for the second pass to "undo" the same delay induced by the first pass. I imagine that could leave some small edge effects at the beginning and end of the data.
-Kevin P
I have used that approach but a much more simple solution is to apply the same filter to both signals so they both get the same delay.
PLEASE CORRECT ME IF I AM WRONG...
Additionally I BELIEVE the delay is a factor of the order of the filter so another filter of the same order but with different cut-off frequencies etc... could be used on the OTHER signal.
Ben
08-11-2017 03:15 PM
Exactly, I saw people did it one time by pass through data to two filter and each time with reverse 1d array, but it been long time ago, I forgot how can he made it?
08-11-2017 03:19 PM
I saw people did it one time by pass through data to two filter and each time with reverse 1d array, but it been long time ago, I forgot how can he made it? I post the snapshot below, I am using configure filter with smoothing mode.
08-11-2017 03:21 PM
I saw people did it one time by pass through data to two filter and each time with reverse 1d array, but it been long time ago, I forgot how can he made it? I post the snapshot below, I am using configure filter with smoothing mode.
08-11-2017 03:24 PM
Paul, please attach the vi files. Pictures of your monitor are very difficult to see. If you want to show pictures, at least use snipping tool, or better yet in the block diagram use "Edit -> Create VI snippet from selection"
08-12-2017 11:46 AM
Regarding Filters and Delays:
Suppose I have sampled data, particularly data with some "random" component (let's call it "noise") present. I want to (digitally) filter it, so I take some (usually small) subset of the data, say N consecutive points, and compute some function on those points to give me a number. With which of my N (let's make N odd, for simplicity) points to I associate my number? One logical answer is that I associate it with the middle value, as it represents the "middle of the pack of data" that went into the computation. Indeed, common forms of low-pass filters are the "moving average" and the "median" filter, both of which express (in their names, if nothing else, "middle").
What about if the data are being acquired? I can't (without polishing my Crystal Ball) know about points in the future, so I must base my filter on the current point and N-1 points in the past. This introduces a time delay, as the filter can be said to represent the response N/2 samples earlier.
On the other hand, if I have access to all of the data in advance, I can "center" my filter on a point and use the N/2 points that come earlier and the N/2 points that come later. The technique mentioned of running the filter from the beginning to the end of the data, then reversing the data (= reversing time) and doing it again is a similar but slightly different technique (can you see why? it amounts to averaging an N-point filter advanced by N/2 points with another N-point filter retarded by N/2 points -- you can work out the math if you are sufficiently curious).
Bob Schor