[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: freqz problems
From: |
Robert A. Macy |
Subject: |
Re: freqz problems |
Date: |
Wed, 28 Sep 2005 10:38:30 -0700 |
octave uses indices starting at 1 going up 512
you forced 0 to 511
different
that's my guess.
- Robert -
On Wed, 28 Sep 2005 12:08:09 -0500
"Raman Venkataramani" <address@hidden> wrote:
> Hello,
>
> I was wondering if this is a known bug. I am running
> octave version 2.1.50.
> In this example, I am computing the frequency response of
> an FIR filter "h".
>
> octave:96>
> octave:96> h=[1, 0.5]
> h =
>
> 1.00000 0.50000
>
> octave:97> H=freqz(h, 1, 512, "whole");
> octave:98> H2=freqz(h, 1, 2*pi*[0:511]/512);
> octave:99> norm(H-H2)
> ans = 27.713
> octave:100> norm(abs(H)-abs(H2))
> ans = 5.3545e-15
> octave:101>
>
> I would have expected that H = H2, but only their
> magnitudes are equal. It
> turns out that H is the correct answer and H2 is the
> reponse of a shifter
> version of h with h(2) being the sample at the origin and
> h(1) is the
> sampele at time -1.
>
> Thanks,
> Raman
>
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- freqz problems, Raman Venkataramani, 2005/09/28
- Re: freqz problems,
Robert A. Macy <=