Terry Given said:
Hi Helmut,
can you clarify "run it backward" please?
do you mean take N samples, n = 0...(N-1)
and feed through the filter, giving y0...yN-1
Then starting with the last output YN-1 and working backwards to the
first output Y0, feed them through the same filter to give yy0...yyN-1 ?
So the second pass through the filter is in negative time, hence the
phase lags cancel.
Cheers
Terry
Hello Terry,
yes I have exactly tried that. The only thing we additionally need
is reversing the order of the samples after the second run through
the filter. y(N)=y(0), Y(N-1)=y(1), ....
I had a hard time with Scilab to check this, because I had no
experience with it before.
The result has been indeed a filtered signal with zero delay.
The example below runs a stored data sequence two times
through a 4th degree lowpass filter. The second pass
is done with the sequence reversed(last sample first).
The result is a zero delay dual pass 4th order Butterworth filter.
Best regards,
Helmut
Scilab example
--------------
! The for-loops reverse the data sequence.
! fg=0.02*fs fs=10kHz
t=(0:1e-4:0.1);
sigbase=sin(2*%pi*t*50)+0.5*sin(2*%pi*t*150);
signoise=sigbase+0.5*sin(2*pi*t*1100);
signoise=sigbase+0.5*sin(2*%pi*t*1100);
[hz]=iir(4,'lp','butt', [0.02 0], [0 0]);
y1=rtitr(hz(2),hz(3),signoise);
y2for=rtitr(hz(2),hz(3),y1);
for j=1:1001, y1rev(1,j)=y1(1002-j);end ;
y20rev=rtitr(hz(2),hz(3),y1rev);
for j=1:1001, y2rev(1,j)=y20rev(1002-j);end ;
xbasc
plot2d(t,signoise,style=3);
plot2d(t,sigbase,style=1);
plot2d(t,y2for,style=4);
plot2d(t,y2rev,style=5);