|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: Help-octave Digest, Vol 43, Issue 52Dear Nuncio,
This is the code I had
written for design of butterworth
filter. It also has an example
to compute the order.
You need to send me "Virtual
Coffee" if you like the
code.
Regards
Bharat Pathak
Arithos Designs
DSP Products and Trainings.
//-------------------------------------------- code
to design butterworth filter with given specs.
clear;
close all; hold on; %------------------------------------------
specification section -------------------------------------------
ap = 3; % ripple in
db
as = 50; % stopband attenuation in db fp = 2000; fs = 2500; Fs = 8000; %-------------- let the design begin
----------------------------------------------------------------------
Fn = Fs/2;
Wp = fp/Fn; Ws = fs/Fn; %------------------ compute the order and get the
numerator and denominator polynomial
[N, Wc] = buttord(Wp, Ws, ap, as);
[b, a ] = butter(N, Wc); %-------------- plot the magnitude response in log
domain with frequency as x-axis
[hz, f] = freqz(b, a, 1024, Fs);
plot(f, 20*log10(abs(hz))); %------------------------------------------------------------------ !!
Coffee Time !! -------------------------------
From: nuncio.m@...
Sent: Monday, October 26, 2009 10:24 AM
To: help-octave@...
Subject: Re: Help-octave Digest, Vol 43, Issue 52 Hi all, I am trying to use the butterworth filter. After filtering the signal I feel there is a slight phase shift. HOw can this be removed?. Also how to specify the order of the filter. eg; butter(1,fc/nysq) , does this mean a first order butterworth filter?. Thanks and regards -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma Goa-403804
_______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
|
|
RE: Help-octave Digest, Vol 43, Issue 52Date: Mon, 26 Oct 2009 10:24:22 +0530 Subject: Re: Help-octave Digest, Vol 43, Issue 52 From: nuncio.m@... To: help-octave@... Hi all, I am trying to use the butterworth filter. After filtering the signal I feel there is a slight phase shift. HOw can this be removed?. There IS going to be a phase shift. All filters ( That I know.) have a phase shift, and unless you have a FIR filter they will all produce some phase distortion. That is -- Different frequencies have a different phase shift. So if different frequencies have a different time delay going through your filter then you will have a hard time removing the phase shift. If you have only one frequency going through the filter then it is possible to compensate for the delay-- just change your time reference. Also how to specify the order of the filter. eg; butter(1,fc/nysq) , does this mean a first order butterworth filter?. Yes and butter(5,fc/nysq) this is a 5th order filter. You owe me a virtual coffee also :-) Doug Stewart Thanks and regards -- Nuncio.M Research Scientist National Center for Antarctic and Ocean research Head land Sada Vasco da Gamma Goa-403804 _______________________________________________ Help-octave mailing list Help-octave@... https://www-old.cae.wisc.edu/mailman/listinfo/help-octave |
| Free embeddable forum powered by Nabble | Forum Help |