Re: freqz behavior for 'whole'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: freqz behavior for 'whole'

Rik-4
On 01/30/2015 02:07 PM, [hidden email] wrote:
Subject:
Fwd: Help testing freqz (Doug Stewart)
From:
Doug Stewart [hidden email]
Date:
01/30/2015 01:44 PM
To:
[hidden email]
List-Post:
[hidden email]
Precedence:
list
MIME-Version:
1.0
References:
[hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email] [hidden email]
In-Reply-To:
[hidden email]
Message-ID:
[hidden email]
Content-Type:
multipart/alternative; boundary=047d7b66f93b2174ea050de581fb
Message:
1


---------- Forwarded message ----------
From: Doug Stewart <[hidden email]>
Date: Fri, Jan 30, 2015 at 4:42 PM
Subject: Re: Help testing freqz (Doug Stewart)
To: Antoine Wiedmer <[hidden email]>



Please reply at the bottom to allow those who arrive late to read from top to bottom.

On this list we always post inline or at the bottom.



On Fri, Jan 30, 2015 at 2:53 PM, Antoine Wiedmer <[hidden email]> wrote:
This on Matlab

freqz (1, [1, -0.5, 0.8],linspace(0,0.9,10),1);

gives the same than with octave


On 30.01.2015 20:25, Doug Stewart wrote:


On Fri, Jan 30, 2015 at 2:02 PM, Antoine Wiedmer <[hidden email]> wrote:
The output is:

ans =

         0    0.2000    0.4000    0.6000    0.8000    1.0000 1.2000    1.4000    1.6000    1.8000    2.0000

but:

>> size(ans)

ans =

     1    11


This does not make sense.
so the graph goes to 1.8 and the data for the graph goes to  2.0???????

 
On 30.01.2015 19:10, Doug Stewart wrote:
Would someone with Matlab run this code and see what the last value of x is.

on octave I get:

Column 10:

   1.80000



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






and if I do:

>> get (h, 'ydata')

ans =

   -2.2789    0.3236   14.0514   -0.6138   -5.8441   -7.2346   -5.8441   -0.6138   14.0514    0.3236       Inf

So matlab calculates 11 data points out to 2.0 but the Y value for the last point is Inf , and therefore the plotting engine does not plot the last point, That is why the graph stops at x=1.8


I don't think we should copy this kind of error. so my opinion is to go with the patch that I made.
see 

But if Rik wants to do it matlab's way then I will do it.

There's no point in copying silly behavior.  But I do like seeing the full symmetry of the function.  Since the behavior is periodic, why not use the y-value at y==0 for the final point at y==2 rather than Inf?

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: freqz behavior for 'whole'

Doug Stewart-4


On Fri, Jan 30, 2015 at 6:22 PM, Rik <[hidden email]> wrote:
On 01/30/2015 02:07 PM, [hidden email] wrote:


Please reply at the bottom to allow those who arrive late to read from top to bottom.

On this list we always post inline or at the bottom.



On Fri, Jan 30, 2015 at 2:53 PM, Antoine Wiedmer <[hidden email]> wrote:
This on Matlab

freqz (1, [1, -0.5, 0.8],linspace(0,0.9,10),1);

gives the same than with octave


On 30.01.2015 20:25, Doug Stewart wrote:


On Fri, Jan 30, 2015 at 2:02 PM, Antoine Wiedmer <[hidden email]> wrote:
The output is:

ans =

         0    0.2000    0.4000    0.6000    0.8000    1.0000 1.2000    1.4000    1.6000    1.8000    2.0000

but:

>> size(ans)

ans =

     1    11


This does not make sense.
so the graph goes to 1.8 and the data for the graph goes to  2.0???????

 
On 30.01.2015 19:10, Doug Stewart wrote:
Would someone with Matlab run this code and see what the last value of x is.

on octave I get:

Column 10:

   1.80000



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






and if I do:

>> get (h, 'ydata')

ans =

   -2.2789    0.3236   14.0514   -0.6138   -5.8441   -7.2346   -5.8441   -0.6138   14.0514    0.3236       Inf

So matlab calculates 11 data points out to 2.0 but the Y value for the last point is Inf , and therefore the plotting engine does not plot the last point, That is why the graph stops at x=1.8


I don't think we should copy this kind of error. so my opinion is to go with the patch that I made.
see 

But if Rik wants to do it matlab's way then I will do it.

There's no point in copying silly behavior.  But I do like seeing the full symmetry of the function.  Since the behavior is periodic, why not use the y-value at y==0 for the final point at y==2 rather than Inf?

--Rik

Ok I will look at it.
Doug