Main Content

freqspace

Frequency spacing for frequency response

Description

example

[f1,f2] = freqspace(n)returns the two-dimensional frequency vectorsf1f2for ann-by-nmatrix.

freqspacereturns the implied frequency range for equally spaced frequency responses.freqspaceis useful when creating desired frequency responses for various one- and two-dimensional applications.

[f1,f2] = freqspace([m n])returns the two-dimensional frequency vectorsf1f2for anm-by-nmatrix.

[x,y] = freqspace(___,'meshgrid')is equivalent to

[f1,f2] = freqspace(...); [x,y] = meshgrid(f1,f2);

f= freqspace(N)returns the one-dimensional frequency vectorfassumingN在t均匀间隔的点he unit circle.

f= freqspace(N,'whole')returnsN在t均匀间隔的点he whole unit circle. In this case,fis0:2/N:2*(N-1)/N.

Examples

collapse all

创建一个矩阵Hd其中包含一个近似对称的二维带通滤波器的带路响应,通带在0.1和0.5之间(归一化频率,其中1.0对应于采样频率的一半,或πradians.) Usefreqspaceto create the frequency vectorsf1f2.

[f1,f2] = freqspace(21,'meshgrid'); Hd = ones(21); r = sqrt(f1.^2 + f2.^2); Hd((r<0.1)|(r>0.5)) = 0; colormap(jet(64)) mesh(f1,f2,Hd)

Figure contains an axes object. The axes object contains an object of type surface.

Input Arguments

collapse all

Length of the frequency vectors, specified as a positive numeric scalar.

Data Types:single|double

Length of each frequency vector, specified as a two-element vector of the form[m n].

Data Types:single|double

Number of points around the unit circle, specified as a positive numeric scalar.

Data Types:single|double

Output Arguments

collapse all

2-D frequency vector, returned as a numeric vector.

Fornodd, bothf1f2are[-n+1:2:n-1]/n.

Forneven, bothf1f2are[-n:2:n-2]/n.

2-D frequency vector, returned as a numeric vector.f2has the same odd and even behavior asf1.

X-coordinates over a grid, returned as a numeric matrix.

Y-coordinates over a grid, returned as a numeric matrix.

1-D frequency vector of points around the unit circle, returned as a numeric vector ofNevenly spaced points.

  • ForNeven or odd,fis(0:2/N:1).

  • ForNeven,freqspacereturns(N+2)/2points.

  • ForNodd,freqspacereturns(N+1)/2points.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

See Also

|(Image Processing Toolbox)|(Image Processing Toolbox)|(Image Processing Toolbox)