⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fft_contin.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 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 + -