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

📄 conv_integral.m

📁 matlab实现卷积运算。非常高兴业大家分享此代码。
💻 M
字号:
function [ y, t ] = conv_integral ( x, tx, h, th, p )
% ------------------------------------------------------------------
% The function of compute the convolution integal y(t) = x(t) * h(t)
% 求连续信号卷积函数
% ------------------------------------------------------------------
% y:  卷积积分y(t)对应的非零样值向量
% t:  f(t)的对应时间向量
% x:  x(t)非零样值向量
% h:  h(t)非零样值向量
% tx: x(t)的对应序号向量
% th: h(t)的对应序号向量
% p:  取样时间间隔
% --------------------------------------------------------------------
y = conv ( x, h );                          % 计算序列x与h的卷积y
y = y * p;
t0 = tx ( 1 ) + th ( 1 );                   % 计算卷积y非零样值的起点位置
tn = length ( x ) + length ( h ) - 2;       % 计算卷积y的非零样值的宽度
t = t0 : p : t0 + tn * p;                   % 确定卷积y非零样值的序号向量
subplot ( 221 );
plot ( tx, x );                             % 在子图1绘序列x(t)时域波形图
title ( 'Input Signals x(t)' );
xlabel ( 't' );
ylabel ( 'x(t)' );
subplot ( 222 );
plot ( th, h );                             % 在子图2绘序列h(t)时域波形图
title ( 'System h(t)' );
xlabel ( 't' );
ylabel ( 'h(t)' );
subplot ( 223 );
plot ( t, y );                              % 在子图3绘序列y(t)时域波形图
title ( 'Output Signals y(t) = x(t) * h(t)' );
xlabel ( 't' );
ylabel ( 'y(t)' );
h = get ( gca, 'position' );                % 修正输出信号窗口
h ( 3 ) = 2.5 * h ( 3 );
set ( gca, 'position', h );

⌨️ 快捷键说明

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