Documentation

freqz2

二维频率响应

Syntax

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

Description

example

[H,f1,f2] = freqz2(h)returnsH,64-by-64frequency response ofh, and the frequency vectorsf1(of length64) andf2(of length64).his a two-dimensional FIR filter, in the form of a computational molecule.

freqz2returnsf1andf2as 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,[n1 n2])returnsH,n2-by-n1frequency response ofh, and the frequency vectorsf1(of lengthn1) andf2(of lengthn2). You can also specify[n1 n2]as two separate arguments,n1,n2.

[H,f1,f2] = freqz2(h,f1, f2)returns the frequency response for the FIR filterhat frequency values inf1andf2. These frequency values must be in the range -1.0 to 1.0, where 1.0 corresponds to half the sampling frequency, or π radians. You can also specify[f1 f2]as two separate arguments,f1, f2.

[___] = freqz2(h,___,[dx dy])uses[dx dy]to override the intersample spacing inh. You can also specify a scalar to specify the same spacing in both thexandydimensions.

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

Examples

collapse all

This example shows how to create a two-dimensional filter usingfwind1and how to view the filter's frequency response usingfreqz2.

Create an ideal frequency response.

Hd = zeros(16,16); Hd(5:12,5:12) = 1; Hd(7:10,7:10) = 0;

Create a 1-D window. This example uses a Bartlett window of length 16.

w = [0:2:16 16:-2:0]/16;

Create the 16-by-16 filter usingfwind1and the 1-D window. This filter gives the closest match to the ideal frequency response.

h = fwind1(Hd,w);

Display the actual frequency response of the filter.

colormap(parula(64)) freqz2(h,[32 32]); axis ([-1 1 -1 1 0 1])

Input Arguments

collapse all

2-D FIR filter, specified in the form of a computational molecule.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

Number of points in the frequency response, specified as a two-element vector.

Data Types:double

Frequency vectors, specified as numeric vectors.

Data Types:double

指定的样品间距,ed as a two-element vector of the form[dx dy]. The default spacing is 0.5, which corresponds to a sampling frequency of 2.0.dxdetermines the spacing for thexdimension anddydetermines the spacing for theydimension. If you specify a scalar,freqz2uses the value to determine the intersample spacing in both dimensions.

Data Types:double

Output Arguments

collapse all

Frequency response, returned as a numeric array.

Frequency vector, returned as a numeric vector.

Data Types:double

Frequency vector, returned as a numeric vector.

Introduced before R2006a

Was this topic helpful?