Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: zero phase low pass filter - filtfilt and IFIR
Replies: 9   Last Post: May 15, 2013 4:25 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Yow Cheong Kok

Posts: 36
Registered: 6/19/06
Re: zero phase low pass filter - filtfilt and IFIR
Posted: Dec 13, 2009 8:22 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

hi,

i try the following, not much difference, the voice signal still have clear delay (lagging) effect. Any further idea to remove the delay effect ?

[x, Fs] = wavread('c:\wav\sample.wav');
h=fdesign.lowpass('Fp,Fst,Ap,Ast',1000,1010,0.1,1,Fs);
d=design(h,'equiripple'); %Lowpass FIR filter
disp(d);
[y,y_tail]=filter(d.Numerator,1,x);
disp(['ok2']);
gd = (numel(d.Numerator)-1)/2;
disp(['ok3']);
disp(size(y));
disp(size(y_tail));
len_y = length(y);
len_y_tail = length(y_tail);
df=length(y)-length(y_tail);
disp(df);
if (df >0)
disp(sprintf('3.1 = %d', df));
for k=len_y_tail:len_y
%disp(sprintf('bk = %d', k));
y_tail(k) = 0;
disp(sprintf('k = %d', k));
end
end
%Then you obtain the whole y by concatenating y and y_tail
y = [y, y_tail.'];
disp(['ok4']);
y_nodelay = y(floor(gd)+(1:numel(x)));
disp(['ok5']);
wavwrite(y_nodelay, 'c:\wav\filter\sample_new.wav');
disp(['ok6']);

regards,
yow



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.