[SciPy-user] normalized frequencies to pi radians / sample

Travis E. Oliphant oliphant at enthought.com
Tue Mar 18 15:45:43 EDT 2008


Forrest Sheng Bao wrote:
> Hi,
>
> I am trying to use buttord function to compute the order and frequency 
> of a Butterworth filter.
>  
> But I got confused about the passband and stopband edge frequency. 
> According to the doc,
>
>       wp, ws -- Passband and stopband edge frequencies, normalized from 0
>                 to 1 (1 corresponds to pi radians / sample).  For example:
>                    Lowpass:   wp = 0.2,          ws = 0.3
>                    Highpass:  wp = 0.3,          ws = 0.2
>                    Bandpass:  wp = [0.2, 0.5],   ws = [0.1, 0.6]
>                    Bandstop:  wp = [0.1, 0.6],   ws = [0.2, 0.5]
>
> I should normalize the frequency to pi radians / sample. Now, suppose 
> a frequency 10Hz and my sampling rate is 100 Hz. Is the normalized 
> frequency 0.1?
Simple answer:  Not quite.   

pi radians / sample is the Nyquist frequency which is 1/2 the sampling 
rate (or 50 Hz).  Thus,  10Hz corresponds to 0.2 in normalized space.

There are two basic steps in the normalization.

1) Convert from analog to digital         ( this maps analog frequency 
to digital [-pi to pi].  1/2 sampling frequency -> pi radians / sample)
2) Convert from [-pi to pi] to [-1 to 1] ( this maps 1/2 sampling 
frequency to 1). 

You can also just think about filtering in the "sampled" domain, 
recognizing that 1 corresponds to a frequency of 1/2 cycle .   

So, a 10 Hz wave-form sampled at 100 Hz would correspond to 10 samples / 
cycle (i.e. 0.1 cycles / sample or 0.2  (1/2-cycles / sample)).

Obviously the documentation could use some help to guide the un-initiated.

Best regards,

-Travis O.





More information about the SciPy-User mailing list