Mon 10 Feb 2014 02:33:31 PM UTC, comment #4:
I just get a bunch of errors. Sorry I don't have time to look into it right now, probably it's a minor issue that prevents it from working.
Error using angle (line 6)
Not enough input arguments.
Error in extract_phase>unwrap_phase (line 43)
phi=unwrap(angle(h));
Error in extract_phase (line 12)
phi = unwrap_phase(h,upn_or_w,iswholerange);
Error in phasez (line 99)
[phi,w] = extract_phase(h,upn_or_w,iswholerange,upfactor,w,addpoint);
Error in freqz (line 123)
phi = phasez(b,a,varargin{:});
|
Wed 05 Feb 2014 04:23:07 PM UTC, comment #1:
Confirmed, judging by the example plot here:
http://www.mathworks.com/help/signal/ref/freqz.html
This is something I've run into before but not gotten around to yet. I'd recommend going even further to make the appearance closer to what users may expect: ditch the legend, labels on x and y axes for both plots.
Can someone with access to Matlab check whether the x axis label says "Normalized Frequency (rad)" vs "Frequency (Hz)" depending on whether the optional "fs" argument is given to freqz?
|
Wed 05 Feb 2014 02:05:14 PM UTC, original submission:
freqz plot has two magnitude plots that zooms in on "interesting areas" in octave while matlab has one plot with the full magnitude.
diff was made against 3.6.4 but the problem remains in latest version
--- C:\Program Files\Octave-3.6.4\share\octave\3.6.4\m\signal\freqz_plot.m 2013-05-28 20:20:18.000000000 +0200
+++ freqz_plot.m 2013-08-13 09:51:33.093494000 +0200
@@ -40,23 +40,13 @@
phase = unwrap (arg (h));
maxmag = max (mag);
- subplot (3, 1, 1);
+ subplot (2, 1, 1);
plot (w, mag);
grid ("on");
- legend ("Pass band (dB)");
- axis ([w(1), w(n), maxmag-3, maxmag], "labely");
+ legend ("Magnitude (dB)");
+ axis ("autoy", "labely");
- subplot (3, 1, 2);
- plot (w, mag);
- grid ("on");
- legend ("Stop band (dB)");
- if (maxmag - min (mag) > 100)
- axis ([w(1), w(n), maxmag-100, maxmag], "labely");
- else
- axis ("autoy", "labely");
- endif
-
- subplot (3, 1, 3);
+ subplot (2, 1, 2);
plot (w, phase360/(2pi));
grid ("on");
legend ("Phase (degrees)");
|