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

📄 experiment_3_ctft.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 M
字号:
%==================================================================
% Name:experiment3_1_ctft
%==================================================================
clear,close all,
p=0.01;            % p为时间间隔
t0=5;
t=[-t0:p:t0];       %给t赋值
x=input('Type in the signal x(t)=:');%输入信号
W1=input('Type in the frequency range(-W1~W1),W1=:');
N=512;            %频率抽样点数为2N+1=1025点
w1=W1/N;
W=-W1:w1:W1;     %给频率变量W赋值
X=x*exp(-j*t'*W)*p; %进行傅里叶变换
X1=abs(X);
phai=57.3*angle(X);
subplot(211)
plot(t,x),title('The time signal x(t)')
subplot(223)
plot(W/pi,X1),axis([-W1/pi,W1/pi,0,max(X1)])
title('The magnitude spectrum of x(t)')
xlabel('Frequency in pi radians/s')
subplot(224)
plot(W/pi,phai),axis([-W1/pi,W1/pi,-180,180])
title('The phase spectrum of x(t)')
xlabel('Frequency in pi radians/s')

⌨️ 快捷键说明

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