📄 demo9.m
字号:
% uses setup from demo0disp('Decaying Exponential Sinewave and its Spectrum')disp('Generate time and frequency steps')Ts=Tp/(N)fs=1/Tsf=linspace(0,fs*(N-1)/N,N);disp('Generate time steps for one period (t)');t=linspace(0,Tp*(N-1)/N,N);disp('Generate time sequence (x) and plot it against time (t)')wn=2*pi*f0(3); z=zeta(4);%wn=2*pi*f0; z=zeta;%kzm=(z-sqrt(z^2-1))*wn, kzp=(z+sqrt(z^2-1))*wn;%x=wn/(sqrt(z^2-1))*(exp(-kzm*t) - exp(-kzp*t));x=dampsin(t,wn,z);title('Decaying exponential')xlabel('Time')plot(t,x);input('Any key to continue')disp('Generate DFT (X) of time series (x) and Compare with Fourier transform of continous data');XD=Ts*fft(x);w=2*pi*f;XC=dampsinf(w,wn,z);title('Fourier Transform (x) and Discrete Fourier Transform Spectra (-)')xlabel('Frequency/fs')ylabel('dB')plot(f/fs,20*log10(abs(XD)),'-',f/fs,20*log10(abs(XC)),'x');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -