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

📄 problem2_46.m

📁 经典《信号与系统》教程的matlab例程,对深入理解信号与系统相关概念有很大帮助
💻 M
字号:
%==========================================================================
% Name:example2_6.m
% The program demonstrate the convolution of two continuou-time signals
% please expressed the signals in terms of the unit step function.
% for example:e(t)=exp(-2*t).*u(t).
%==========================================================================
clear;close all;
t0=-8;
t1=8;
p=0.01;
t=t0:p:t1;
x=2*exp(-3*t).*u(t-1);
h=0.5*exp(-2*t+1).*u(t+1);
y=p*conv(x,h);%卷积计算

%将卷积的结果取得和两个输入的信号一样长,以便在相同的坐标中绘制其图形并方便比较。
l=length(y);
m=2*t0:p:t0-p;
n=t1+p:p:2*t1;
m1=zeros(1,abs(t0/p));
n1=zeros(1,abs(t1/p));
lm=length(m1);
ln=length(n1);
y=y([lm+1:l-ln]);
%以下程序绘制激励信号和系统冲激响应的波形
subplot(3,2,1)
plot(t,x);axis([t0,t1,0,0.1*max(h)]);
grid on;title('The input signal x(t)')
subplot(3,2,2)
plot(t,h,'r');axis([t0,t1,1.1*min(h),1.2*max(h)]);
grid on;title('The impulse response h(t)')
subplot(3,1,2);
plot(t,y,'r');axis([-4,4,1.1*min(y),1.2*max(y)]);grid on;
%text(.5*t1,.8*max(hl),'HR(w):');
subplot(3,1,3);
f=(exp(-2*t)-exp(-3*t)).*u(t);
plot(t,f,'r');grid on;
axis([-4,4,1.1*min(f),1.2*max(f)]);%text(.5*t1,.8*max(f),'H(w):');
    
 

⌨️ 快捷键说明

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