freqz produces incorrect output
Ben Abbott
bpabbott at mac.com
Sun Jan 25 11:07:14 CST 2009
On Jan 25, 2009, at 2:39 AM, Søren Hauberg wrote:
> lør, 24 01 2009 kl. 19:57 -0500, skrev Ben Abbott:
>> I look at a simple example.
>>
>> freqz (ones (20, 1), 1, 512, "half", 2)
>
> I've never used this function before, so I don't know how it's
> supposed
> to work, but I can compare with Matlab. I've posted the result of this
> code at http://hauberg.org/freqz
ok, the Matlab version doesn't include the passband plot. Otherwise it
looks the same.
>> In the event, the problem is with FIR lengths > 512, I tried
>>
>> freqz (postpad (ones (20, 1), 768), 1, 512, "half", 2);
>
>> freqz (prepad (ones (20, 1), 768), 1, 512, "half", 2);
>
> Unfortunately, I cannot run this code in Matlab as it doesn't have
> 'postpad' and 'prepad'.
>
> Søren
Søren, can you try these instead?
freqz ([ones(1, 20), zeros(1, 768-20)], 1, 512, "half", 2);
freqz ([zeros(1, 768-20), ones(1, 20)], 1, 512, "half", 2);
TIA
Ben
More information about the Bug-octave
mailing list