comparison scripts/signal/freqz_plot.m @ 18521:9d59bc3dc12d stable

doc: Update docstrings for freqz, freqz_plot. * freqz.m: List alternative calling forms. Eliminate extra space caused by expansion in ifnottex macro. Remove mention of plotting stop band. Add seealso link to freqz_plot. * freqz_plot.m: Use freq_norm as the name for the third input to match the code. Remove mention of plotting stop band. Add seealso link to freqz.
author Rik <rik@octave.org>
date Thu, 13 Feb 2014 07:45:59 -0800
parents 694e8f0b3862
children 4197fc428c7d
comparison
equal deleted inserted replaced
18518:694e8f0b3862 18521:9d59bc3dc12d
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {} freqz_plot (@var{w}, @var{h}) 20 ## @deftypefn {Function File} {} freqz_plot (@var{w}, @var{h})
21 ## @deftypefnx {Function File} {} freqz_plot (@var{w}, @var{h}, @var{freq_hz}) 21 ## @deftypefnx {Function File} {} freqz_plot (@var{w}, @var{h}, @var{freq_norm})
22 ## Plot the pass band, stop band and phase response of @var{h}. If the 22 ## Plot the magnitude and phase response of @var{h}.
23 ## optional @var{freq_norm} argument is true, the frequency vector @var{w} 23 ##
24 ## is in units of normalized radians and the x-axis is labeled as such. 24 ## If the optional @var{freq_norm} argument is true, the frequency vector
25 ## @var{w} is in units of normalized radians. If @var{freq_norm} is false, or
26 ## not given, then @var{w} is measured in Hertz.
27 ## @seealso{freqz}
25 ## @end deftypefn 28 ## @end deftypefn
26 29
27 ## Author: Paul Kienzle <pkienzle@users.sf.net> 30 ## Author: Paul Kienzle <pkienzle@users.sf.net>
28 31
29 function freqz_plot (w, h, freq_norm = false) 32 function freqz_plot (w, h, freq_norm = false)
41 44
42 mag = 20 * log10 (abs (h)); 45 mag = 20 * log10 (abs (h));
43 phase = unwrap (arg (h)); 46 phase = unwrap (arg (h));
44 47
45 if (freq_norm) 48 if (freq_norm)
46 x_label = "Normalized Frequency (\\times\\pi rad/sample)"; 49 x_label = 'Normalized Frequency (\times\pi rad/sample)';
47 else 50 else
48 x_label = "Frequency (Hz)"; 51 x_label = "Frequency (Hz)";
49 endif 52 endif
50 53
51 subplot (2, 1, 1); 54 subplot (2, 1, 1);