diff scripts/signal/freqz.m @ 18450:694e8f0b3862 stable

freqz: Make frequency response plot visually compatible with Matlab (bug #41464) * freqz_plot.m: Eliminate the extraneous "pass band" subplot for visual compatibility with Matlab. Use y-axis labels instead of legends. Always autoscale the y-axis. Label the frequency axis in units of normalized radians or Hz depending on a new optional argument. * freqz.m: Tell freqz_plot whether the frequency vector is in normalized radians or Hz.
author Mike Miller <mtmiller@ieee.org>
date Thu, 13 Feb 2014 00:00:10 -0500
parents d63878346099
children 9d59bc3dc12d
line wrap: on
line diff
--- a/scripts/signal/freqz.m	Mon Feb 10 13:00:44 2014 -0200
+++ b/scripts/signal/freqz.m	Thu Feb 13 00:00:10 2014 -0500
@@ -109,11 +109,14 @@
     endif
   endif
   if (isempty (Fs))
+    freq_norm = true;
     if (nargout == 0)
       Fs = 2;
     else
       Fs = 2*pi;
     endif
+  else
+    freq_norm = false;
   endif
 
   a = a(:);
@@ -171,7 +174,7 @@
     f_r = f;
   else
     ## Plot and don't return values.
-    freqz_plot (f, h);
+    freqz_plot (f, h, freq_norm);
   endif
 
 endfunction