下載/瀏覽

Download Report

Transcript 下載/瀏覽

FFT Tutorial
University of Rhode Island Department of
Electrical and Computer Engineering
ELE 436: Communication Systems
Presenter: Lung-Chin Huang
Outline
•
•
•
•
•
Getting to Know the FFT
Review of Transforms
Understanding the DFT
Matlab and the FFT
Spectrum Analysis with the FFT and Matlab
Getting to Know the FFT
• FFT=快速傅立葉變換, FFT是更快版本的
離散型的傅立葉變換(DFT)
• DFT是在地區頻率(頻譜)分析是相當重要的,
因為它在時域和轉換上需要一個離散訊號,
並將其訊號轉換成離散頻域表示
Review of Transforms
•
•
•
•
拉普拉斯變換:
連續時間傅立葉變換:
z變換:
離散傅立葉變換:
Understanding the DFT
• 周期性: DTFT的週期性是在一個周期的延
伸,從f=0至fs, 其中fs為採樣頻率
• 對稱性: 當檢查過該地區在 0至fs,可以看
到有偶對稱的中心點為0.5fs
Matlab and the FFT (1/2)
典型的語法計算FFT
n = [0:29];
x = cos(2*pi*n/10)
N1 = 64;
N2 = 128;
N3 = 256;
X1 = abs(fft(x,N1));
X2 = abs(fft(x,N2));
X3 = abs(fft(x,N3));
F1 = [0 : N1 - 1]/N1;
F2 = [0 : N2 - 1]/N2;
F3 = [0 : N3 - 1]/N3;
subplot(3,1,1)
plot(F1,X1,'-x'),title('N = 64'),axis([0 1 0 20])
subplot(3,1,2)
plot(F2,X2,'-x'),title('N = 128'),axis([0 1 0 20])
subplot(3,1,3)
plot(F3,X3,'-x'),title('N = 256'),axis([0 1 0 20])
Matlab and the FFT (2/2)
n = [0:29];
x1 = cos(2*pi*n/10); % 3 periods
x2 = [x1 x1]; % 6 periods
x3 = [x1 x1 x1]; % 9 periods
N = 2048;
X1 = abs(fft(x1,N));
X2 = abs(fft(x2,N));
X3 = abs(fft(x3,N));
F = [0:N-1]/N;
subplot(3,1,1)
plot(F,X1),title('3 periods'),axis([0 1 0 50])
subplot(3,1,2)
plot(F,X2),title('6 periods'),axis([0 1 0 50])
subplot(3,1,3)
plot(F,X3),title('9 periods'),axis([0 1 0 50])
Spectrum Analysis with the FFT and Matlab
n = [0:149];
x1 = cos(2*pi*n/10);
N = 2048;
X = abs(fft(x1,N));
X = fftshift(X);
F = [-N/2:N/2-1]/N;
plot(F,X),
xlabel('frequency / f s')
THE END
奈奎斯特定理
奈奎斯特定理:取樣速率> 2 * 受測訊號的最高頻率部份
奈奎斯特頻率的正弦波範例