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

📄 demo2.m

📁 这是一个 York大学开发的FDTD代码。很好用的工具
💻 M
字号:
disp('Demonstrate FFT for rectangular pulse train')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)')x=prect(t,Tw,Tp);plot(t,x,'+')title ('Original pulse train')xlabel('Time')input('Any key to continue')disp('Generate FFT (X) of time series (x) and plot the real and imaginary parts');X=Ts*fft(x);plot(f,real(X),'o',f,imag(X),'*')title('DFT of pulse train - real o, imag *')xlabel('Frequency')input('Any key to continue')disp('Generate time sequence (xr) from FFT (X) and plot it against time (t)')xr=1/Ts*ifft(X);plot(t,x,'+',t,real(xr),'o')
title('Pulse train + and Inverse Transform o (DFT)')xlabel('Time')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -