comparison 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
comparison
equal deleted inserted replaced
18447:ff7e7928f160 18450:694e8f0b3862
107 else 107 else
108 region = "whole"; 108 region = "whole";
109 endif 109 endif
110 endif 110 endif
111 if (isempty (Fs)) 111 if (isempty (Fs))
112 freq_norm = true;
112 if (nargout == 0) 113 if (nargout == 0)
113 Fs = 2; 114 Fs = 2;
114 else 115 else
115 Fs = 2*pi; 116 Fs = 2*pi;
116 endif 117 endif
118 else
119 freq_norm = false;
117 endif 120 endif
118 121
119 a = a(:); 122 a = a(:);
120 b = b(:); 123 b = b(:);
121 124
169 ## Return values and don't plot. 172 ## Return values and don't plot.
170 h_r = h; 173 h_r = h;
171 f_r = f; 174 f_r = f;
172 else 175 else
173 ## Plot and don't return values. 176 ## Plot and don't return values.
174 freqz_plot (f, h); 177 freqz_plot (f, h, freq_norm);
175 endif 178 endif
176 179
177 endfunction 180 endfunction
178 181
179 182