freqz2

2-D frequency response

Syntax

[H, f1, f2] = freqz2(h, n1, n2)
[H, f1, f2] = freqz2(h, [n2 n1])
[H, f1, f2] = freqz2(h)
[H, f1, f2] = freqz2(h, f1, f2)
[...] = freqz2(h,...,[dx dy])
[...] = freqz2(h,...,dx)
freqz2(...)

Description

[H, f1, f2] = freqz2(h, n1, n2) returns H, the n2-by-n1 frequency response of h, and the frequency vectors f1 (of length n1) and f2 (of length n2). h is a two-dimensional FIR filter, in the form of a computational molecule. f1 and f2 are returned as normalized frequencies in the range -1.0 to 1.0, where 1.0 corresponds to half the sampling frequency, or π radians.

[H, f1, f2] = freqz2(h, [n2 n1]) returns the same result returned by [H,f1,f2] = freqz2(h,n1,n2).

[H, f1, f2] = freqz2(h) uses [n2 n1] = [64 64].

[H, f1, f2] = freqz2(h, f1, f2) returns the frequency response for the FIR filter h at frequency values in f1 and f2. These frequency values must be in the range -1.0 to 1.0, where 1.0 corresponds to half the sampling frequency, or π radians.

[...] = freqz2(h,...,[dx dy]) uses [dx dy] to override the intersample spacing in h. dx determines the spacing for the x dimension and dy determines the spacing for the y dimension. The default spacing is 0.5, which corresponds to a sampling frequency of 2.0.

[...] = freqz2(h,...,dx) uses dx to determine the intersample spacing in both dimensions.

freqz2(...)produces a mesh plot of the two-dimensional magnitude frequency response when no output arguments are specified.

Class Support

The input matrix h can be of class double or of any integer class. All other inputs to freqz2 must be of class double. All outputs are of class double.

Examples

Use the window method to create a 16-by-16 filter, then view its frequency response using freqz2.

Hd = zeros(16,16);
Hd(5:12,5:12) = 1;
Hd(7:10,7:10) = 0;
h = fwind1(Hd,bartlett(16));
colormap(jet(64))
freqz2(h,[32 32]); axis ([-1 1 -1 1 0 1])

See Also

Was this topic helpful?