| Signal Processing Toolbox | Search  Help Desk |
| czt | Examples See Also |
Syntax
y = czt(x,m,w,a) y = czt(x)
Description
y = czt(x,m,w,a)
returns the chirp z-transform of signal x. The chirp z-transform is the z-transform of x along a spiral contour defined by w and a. m is a scalar that specifies the length of the transform, w is the ratio between points along the z-plane spiral contour of interest, and scalar a is the complex starting point on that contour. The contour, a spiral or "chirp" in the z-plane, is given by
z = a*(w.^-(0:m-1))
y = czt(x)
uses the following default values:
m = length(x)
w = exp(j*2*pi/m)
a = 1
czt returns the z-transform of x at m equally spaced points around the unit circle. This is equivalent to the discrete Fourier transform of x, or fft(x). The empty matrix [] specifies the default value for a parameter.
If x is a matrix, czt(x,m,w,a) transforms the columns of x.
Examples
Create a random vectorx of length 1013 and compute its DFT using czt. This is faster than the fft function on the same sequence.
x = randn(1013,1); y = czt(x);Use
czt to zoom in on a narrow-band section (100 to 150 Hz) of a filter's frequency response. First design the filter:
h = fir1(30,125/500,boxcar(31)); % filterEstablish frequency and CZT parameters:
Fs = 1000; f1 = 100; f2 = 150; % in Hertz m = 1024; w = exp(-jCompute both the DFT and CZT of the filter:*2*pi*(f2-f1)/(m*Fs)); a = exp(j*2*pi*f1/Fs);
y = fft(h,1000); z = czt(h,m,w,a);Create frequency vectors and compare the results:
fy = (0:length(y)-1)'*1000/length(y); fz = ((0:length(z)-1)'*(f2-f1)/length(z)) + f1; plot(fy(1:500),abs(y(1:500))); axis([1 500 0 1.2]) title('FFT') figure plot(fz,abs(z)); axis([f1 f2 0 1.2]) title('CZT')
![]()
Algorithm
czt uses the next power-of-2 length FFT to perform a fast convolution when computing the z-transform on a specified chirp contour [1]. czt can be significantly faster than fft for large, prime-length sequences.
Diagnostics
Ifm, w, or a is not a scalar, czt gives the following error message:
Inputs M, W, and A must be scalars.
See Also
fft |
One-dimensional fast Fourier transform. |
freqz |
Frequency response of digital filters. |
References
[1] Rabiner, L.R., and B. Gold. Theory and Application of Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1975. Pgs. 393-399.