octave-maintainers
[Top][All Lists]
Advanced

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

Re: Freqz behavior


From: Rik
Subject: Re: Freqz behavior
Date: Fri, 16 Jan 2015 14:10:51 -0800

On 01/16/2015 01:57 PM, Doug Stewart wrote:


On Fri, Jan 16, 2015 at 12:02 PM, Rik <address@hidden> wrote:
On 01/16/2015 05:31 AM, Doug Stewart wrote:
> On Thu, Jan 15, 2015 at 8:42 PM, Rik <address@hidden> wrote:
>
>     On 01/15/2015 05:35 PM, Doug Stewart wrote:
>>     On Thu, Jan 15, 2015 at 4:44 PM, Rik <address@hidden> wrote:
>>
>>         1/15/15
>>
>>         Could someone with access to the Signal Toolbox run the following:
>>
>>     I think Rik means some one with Matlab Signal Toolbox
>>
>>
>>         format long
>>         [a,b] = freqz (1, [1, -0.5, 0.8], 10)
>>
>>         Trying to resolve this bug https://savannah.gnu.org/bugs/?43895
where
>>         Octave is apparently off by 1 point.
>>
>>         --Rik
>>
>>
>     Thanks,  I've already been helped out by Tallis Huther da Costa.
>
>     --Rik
>
> How does Matlab handle this?

They do just what we thought.  When you request the output of freqz it
produces a vector with N elements.  When you don't request an output, and
want to have the filter response immediately plotted, they produce a vector
of N+1 elements.  I have a patch, but it only works if the "whole" argument
is not specified.  I'll send that to you and maybe you can see how to tweak
things.

[h,w] = freqz (b,a, N);     # h and w are N-point vectors
freqz (b, a, N);  # h and w are N+1-point vectors as determined by get (h,
'xdata') and get (h, 'ydata') on the created plot.

--Rik


What handle did you use to get the x and y size??
I tried
figure(3)
freqz1 (1, [1, -0.5, 0.8], 10 , "whole")
h = gca ()
get (h)
get (h, 'ydata')

And i get:
error: get: unknown axes property ydata


I have it working for "whole" but I want to verify it against Matlab before I finish it up.

freqz produces two plots within a single figure.  I grabbed the first one with

freqz (1, [1, -0.5, 0.8], 10)
subplot (2,1,1)
h = get (gca, 'children')
get (h, 'xdata')
get (h, 'ydata')

--Rik

p.s. At least for the 'half' argument Octave did a better job than Matlab and calculated the final point correctly.  Matlab gave an answer of Inf for the normalized frequency of 1.0 and the filter in the code.


reply via email to

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