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

📄 ip_01_06.m

📁 现上传电子工业出版社出版的国外电子与通信教材系列一书:现代通信系统(MATLAB版)(第二版)中的脚本文件与M文件
💻 M
字号:
% MATLAB script for Illustrative Problem 6, Chapter 1
echo on
ts=0.2;                     % set parameters
fs=1/ts;
df=0.01;
x=[zeros(1,10),[0:0.2:1],ones(1,9),[1:-0.2:0],zeros(1,10)];
[X,x,df1]=fftseq(x,ts,df);          % derive the FFT
X1=X/fs;                                    % scaling
f=[0:df1:df1*(length(x)-1)]-fs/2;           % frequency vector for FFT
f1=[-2.5:0.001:2.5];                        % frequency vector for analytic approach
y=4*(sinc(2*f1)).^2-(sinc(f1)).^2;          % exact Fourier transform
pause % Press akey to see the plot of the Fourier Transform derived analytically.
clf
subplot(2,1,1)
plot(f1,abs(y));
xlabel('Frequency')
title('Magnitude-pectrum of x(t) derived analytically')
pause % Press akey to see the plot of the Fourier Transform derived numerically.
subplot(2,1,2)
plot(f,fftshift(abs(X1)));
xlabel('Frequency')
title('Magnitude-pectrum of x(t) derived numerically')

⌨️ 快捷键说明

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