Re: Help-octave Digest, Vol 43, Issue 52

View: New views
3 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Help-octave Digest, Vol 43, Issue 52

by Nuncio M :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

Re: Help-octave Digest, Vol 43, Issue 52

by bharat pathak :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear 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 !! -------------------------------

Sent: Monday, October 26, 2009 10:24 AM
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 52

by dastew :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.



Date: 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