help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use fir1 with 'scale'


From: Per Persson
Subject: Re: How to use fir1 with 'scale'
Date: Sun, 25 Jul 2004 11:41:39 +0200


On Jul 21, 2004, at 21:32, Paul Kienzle wrote:


Try: b = fir1(nfilt,0.01,'low', hamming(nfilt+1),'scale') instead.
(nfilt is the number of delays, not coeffs)

Don't know why passing just the window name doesn't work.

Because the author didn't think to implement it?  He will
accept patches though 8-)

If you are going to attempt this, you should check not only
for strings, but also for typeinfo(window)=="function handle"
(there is no 'isfunction' call, and 'exist' only accepts strings).

While you are at it, you should accept the arguments
        scale | noscale
        low | high | pass | stop | dc-0|dc-1
        hamming | hanning | gausswin | triang | boxcar | ...
in any order.

OK, I think the patch below is a beginning.

It lets you use the name or function handle of a windowing function in addition to a window vector, and arguments may be passed in any order.
It only changes the argument parsing part of the function.
An incomplete set of tests is also included.

Some clean-up of the old code is possible with these changes, and fir2 should also be changed to allow window names to be passed directly.

I'll try and find some time to do it, but anyone is welcome to beat me to it.

/Per

Attachment: fir1.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]