| Filter Design Toolbox | ![]() |
Apply a quantized fast Fourier transform to data
Syntax
Description
y = fft(F,x) uses quantized FFT (fast Fourier transform) F to compute the FFT of vector x. The parameters of the quantized FFT are specified in quantized FFT F. The radix is specified by F.radix. The decimation is specified by F.decimation. The length of the FFT is specified by F.length. When the length of x is less than F.length, x is padded with zeros. When x is longer than F.length, x is truncated. For matrices, the FFT operation is applied to each column. For N-D arrays, the FFT operation operates on the first nonsingleton dimension.
y = fft(F,x,dim) applies the quantized FFT operation across the dimension dim.
Examples
When you quantize a sinusoid, you generate errors as a result of the quantization process. This example demonstrates this effect. We create a sinusoid, quantize it, and look at the error between the quantized and unquantized sinusoids. Then we plot the FFTs for both signals.
n = 128; t = (0:n-1/n); x = sin(2*pi*16*t)/16;% Reference sinusoid q = quantizer([5 4]); f = qfft('length',n,'inputformat',q); plot(t,[quantize(q,x);x]);% Plot both signals plot(t,[quantize(q,x)-x]);% Plot the error plot(t,[20*log10(abs(fft(f,x)));... (20*log10(abs(fft(x)))/20)])% Plot the FFTs for both signals
The following figure presents the results.
Looking at the subplot of the error between the reference and quantized sinusoids, you see that the error is periodic. Because the error is periodic, the FFT of the quantized sinusoid includes periodic frequency content not in the reference signal, as seen in the FFTs subplot.
See Also
get, ifft, qreport, qfft, set
| fdatool | filter | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |