On 7 November 2011 22:42, Jeffrey Cunningham <jeff...@jkcunningham.com> wrote:
> On Mon, 07 Nov 2011 10:16:39 -0800, Carnė Draug <carandraug+...@gmail.com>
> wrote:
>
>> On 7 November 2011 16:43, Alberto Cuadrado <a.cuadr...@gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> I think there is a bug in the fir1 function in signal-1.0.11 (and
>>> probably
>>> also in 1.1.1 because I don't see significant changes in the code). The
>>> problem is that single-band lowpass filters returned by fir1 don't have a
>>> DC
>>> gain of 1. For example:
>>>
>>> octave-3.2.4:1> sum(fir1(240,0.01))
>>> ans =  1.1822
>>>
>>> That should return 1 (with low-order filters the problem is not so
>>> obvious).
>>>
>>> Regards
>>>
>>> Alberto Cuadrado
>>
>> I can confirm that this still occurs in octave 3.4.3 with signal 1.1.
>> Do you think you can contribute a patch to fix this?
>>
>
>
> Are you sure it is a bug? I am assuming that you want the filter to be
> normalized the same way as Matlab's fir1 function, and they say:
>
>   "By default, the filter is scaled so that the center of the first passband
> has a magnitude of exactly 1 after windowing."
>
> In other words, they are normalizing so the *frequency domain* passband
> comes out to 1. The d.c. output level divided by the bandwidth will be
> (roughly) 1.

I asked in ##matlab and it seems it returns exactly 1 there.

Carnė

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to