On Mon, 07 Nov 2011 17:48:51 -0800, Carnë Draug <carandraug+...@gmail.com>
wrote:

> On 7 November 2011 22:42, Jeffrey Cunningham <jeff...@jkcunningham.com>
>>
>> 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ė


Right. I don't know what I was thinking of: The dc level is the sum of the  
weights.
But I'm not seeing a problem. Here's a low-pass fir1 filter:

  b = fir1(48,[0,0.35]);
  sum(b) => 1.005

freqz shows unity gain in the passband. And I can drive it with a unit  
gain d.c. voltage and after it stops ringing I get unity output.

   c=filter(b,1,ones(520,1))(end) ==> 1.005

I think I see what his trouble is. He doesn't have nearly enough  
coefficients for a low-pass filter that narrow. Its a bad fit to an  
impulse-function.

octave:17> version
ans = 3.2.4
octave:19> sum(fir1(240,0.01))
ans =  1.1822
octave:20> sum(fir1(512,0.01))
ans =  1.0804
octave:21> sum(fir1(10000,0.01))
ans =  0.99934


Jeff

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