Tue 10 Feb 2015 08:51:16 PM UTC, comment #15:
You're welcome, and thank you for taking time to write a note.
There are no paid staff for Octave and everyone of us here is a volunteer. But most of the time it's all silence when we solve a problem.
|
Tue 10 Feb 2015 07:35:02 PM UTC, comment #14:
as the original reporter, I VERY much appreciate all of the efforts.
|
Tue 10 Feb 2015 05:23:04 PM UTC, comment #13:
@Doug: I added some input validation and committed your changeset here (http://hg.savannah.gnu.org/hgweb/octave/rev/8724af455b11). Thanks, the plots look right to my eye now. Closing report.
|
Mon 09 Feb 2015 09:28:10 PM UTC, comment #12:
I have attached a patch that I think does what we want.
please try it.
(file #33040)
|
Wed 04 Feb 2015 04:18:12 PM UTC, comment #11:
Thanks, Mike.
I'm not sure why the graph "should" go to the pi or 2*pi value, given that the Matlab graph doesn't. However, I agree that it should plot all 10 points...
Sorry to have added only noise to this discussion :(
|
Wed 04 Feb 2015 01:50:30 PM UTC, comment #10:
You didn't paste the results of getting the x and y data from the plot, but someone on the list already provided that. Including here for completeness in case this gets forgotten:
So this is one more point than what is returned, and one more point than what Octave currently plots. So I think we all agree that the return value is correctly 10 points, but the plot should extend to the pi or 2*pi value.
|
Wed 04 Feb 2015 06:55:13 AM UTC, comment #9:
Rik, the output of your sequence of commands is attached. The last point is 1.8
(file #32990)
|
Fri 30 Jan 2015 05:31:39 PM UTC, comment #8:
@Doug: Maybe you can ask on the octave-maintainers list for someone to run
and see what the last x data point is.
|
Fri 30 Jan 2015 05:21:07 PM UTC, comment #7:
After looking at this for some time, I think this patch is what we want.
This adds 1 more point to the plot only for the half range. I dont think we need to change the "whole" plot, as the next point will be the same as the first point, and it is the DC (0 freq.) value.
(file #32951)
|
Mon 12 Jan 2015 12:52:00 AM UTC, comment #6:
Could somebody with access to Matlab run the following and report the results.
@Doug: using your patch this returns an 11-point vector whereas the documentation seems to imply this should return a 10-point vector (same as n). I think instead of changing the value of 'n' we want to change the spacing of Fs.
The code change below works to return a 10-point vector and display everything out to a normalized frequency of 1.0.
|
Mon 29 Dec 2014 05:52:31 PM UTC, comment #5:
if (strcmp (region, "whole"))
N = n;
else
N = 2*n;
endif
n=n+1; # add 1 to get all the way to PI
f = Fs * (0:n-1).' / N;
pad_sz = N*ceil (k/N);
b = postpad (b, pad_sz);
a = postpad (a, pad_sz);
This is where I put it.
I did not study the code to see if this is the best fix, just a quick try.
|
Mon 29 Dec 2014 05:19:57 PM UTC, comment #4:
Confirmed. It does seem like Octave should plot right up to either pi or 2*pi if 'whole' is given.
@Doug: Line 155 is a blank line in my copy of freqz.m on the development branch. Could you post the result of 'diff -u' so I can see where you were adding n=n+1?
|
Sat 27 Dec 2014 02:27:45 AM UTC, comment #3:
Try this at line 155:
n=n+1; # add 1 to get all the way to PI
|
Sat 27 Dec 2014 02:17:41 AM UTC, comment #2:
sorry my sugestion has problems.
|
Sat 27 Dec 2014 02:07:51 AM UTC, comment #1:
Goto line 156 in freqz.m and change it to:
f = Fs * (0:n).' / N;
Is this what you want.
I am not the one to decide, just helping to clarify what you want.
What does Matlab do?
|
Sat 27 Dec 2014 01:40:21 AM UTC, original submission:
when I use freqz(num,den,10)
I expected the endpoints to be included. I would think one would be interested in finite value (pi). However, it only yields data thru 0.9*pi. I would suggest adding/ensuring it also provides frequency response at pi (1 more step).
So, freqz(num,den,2) would produce (3) data values, not 2.
I often iterate things so as to match A/D response at the Nyquist frequency ...
|