[SciPy-dev] Question about Kaiser Implementation in firwin

Buehler, Eric (AGRE) Eric.Buehler at smiths-aerospace.com
Thu Jul 13 14:24:36 CDT 2006


I have been using the signal.firwin FIR design tool and I have a
question about the implementation.

I am generating a kaiser window with the following parameters:
N = 128
Cutoff = ~4e7
width = .3

All of the special kaiser generation parameters in the function follow
Oppenheim and Schafer well.  Even the sinc function for linear phase is
follows exactly.

However, the last line of the firwin function is causing me some

1538    win = get_window(window,N,fftbins=1)
1539    alpha = N//2
1540    m = numpy.arange(0,N)
1541    h = win*special.sinc(cutoff*(m-alpha))
1542    return h / sum(h)

Line 1542 of filter_design.py, "return h / sum(h)", normalizes the
function where it doesn't seem necessary, at least in the kaiser window
case.  Without the normalization, the kaiser window already returns a
value of 1 at the zero frequency point.  This normalization scales all
of the data, making the window difficult to use in the frequency domain.

Can someone point me to the rationale for this line?  Looking at the
code, this seems to be a pretty recent change (within the last year/year
and a half).


Eric Buehler
eric <dot> buehler <at> smiths-aerospace <dot> com

The information contained in, or attached to, this e-mail, may contain confidential information and is intended solely for the use of the individual or entity to whom they are addressed and may be subject to legal privilege.  If you have received this e-mail in error you should notify the sender immediately by reply e-mail, delete the message from your system and notify your system manager.  Please do not copy it for any purpose, or disclose its contents to any other person.  The views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company.  The recipient should check this e-mail and any attachments for the presence of viruses.  The company accepts no liability for any damage caused, directly or indirectly, by any virus transmitted in this email.

More information about the Scipy-dev mailing list