?? fft_contin.m
字號:
% Name:FFT_contin
clear,close all;
fs=input('Type in the sampling frequence fs=');
F=input('Type in F=');
N=fs/F;
M=ceil(log2(N));
N=2^M;
F=fs/N;
Tp=1/F;
T=Tp/N;
t=0:T:Tp;
x=input('Type in the sequence x(t)=');
%==========================================
% Computation of DFT using FFT
%==========================================
Xk=fft(x,N);
Xk=Xk*T*F;
%==========================================
% Plot the spectra curve
%==========================================
k=0:N-1;
subplot(211)
stem(t,x,'.'),title('The original sequence x(nT)')
xlabel('Time t');axis([0,Tp,1.1*min(x),1.1*max(x)])
subplot(212)
stem(k*F,abs(Xk),'r.'),title('The amplitude spectra of x(t)')
xlabel('Frequence in Hz'),axis([0,fs/2,0,1.1*max(abs(Xk))])
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -