fft变换matlab函数.docxVIP

  • 1
  • 0
  • 约2.63千字
  • 约 4页
  • 2017-06-14 发布于广东
  • 举报
fft变换matlab函数

The Matlab demonstration program Discrete Fourier Transform is also helpful. It may be accessed by typing demo at the Matlab prompt. The dft function computes magnitudes and phases for a signal’s spectrum or a system’s frequency response using the DFT formula directly. It is used as follows: [mag,phase,k] = dft(x) where x is a signal, or [mag,phase,k] = dft(h) where h is an impulse response. The dft function is functionally identical to the dfs function from the  HYPERLINK H:\\测试信号分析与处理\\Site Files\\Chapters\\CH8SUMM\\Matlab8\\matlab8.HTM Matlab section for chapter 8. The results of dft can be plotted using the function plotdft, which is functionally identical to plotdfs. For example, x = [1 –2 3 0 4 –1 5 0]; [mag,phase,k] = dft(x); plotdft(mag,phase,k,1) Magnitude Spectrum Phase Spectrum ? The function fft computes the same outputs as the function dft, but does so more efficiently. The fft is calculated and plotted as follows: xx = fft(x); mag = abs(xx); phase = angle(xx); k = 0:(length(xx)-1); plotfft(mag,phase,k,1); Note that, like plotdft, the function plotfft is functionally identical to plotdfs. The FFT spectrum is shown below for the signal produced by the command x = rand(1,32) – 0.5; Signal Magnitude Spectrum Phase Spectrum ? When the FFT for a signal is known, the signal can be found from the complex FFT values using the ifft function. From the example above, check_x = ifft(xx); and check_x equals x. ? The function winfft permits windowing options for the FFT to be explored. For each window type, the window function multiplies the signal samples before the FFT is taken. For the rectangular, Hanning, Hamming and Blackman windows, the form is: [mag,phase,k] = winfft(x,rect); [mag,phase,k] = winfft(x,hanning); [mag,phase,k] = winfft(x,hamming); [mag,phase,k] = winfft(x,blackman); For the Kaiser window, the form is: [mag,phase,k] = winfft(x,kaiser,beta); ? Spectra for digital images may be obtained from a matrix of gray scale levels using Matlab’s fft2

文档评论(0)

1亿VIP精品文档

相关文档