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

📄 convolution.m

📁 AR模型的源程序。
💻 M
字号:
% File: convolution.m
% -------------------
% This file is used to compute the convolution of two sequences.

function [y_output] = convolution(x_input, h_input)
% y_output: convolution output
% h_input:  hir filter
% x_input:  input sequence
L = length(x_input); % length of input sequence
M = length(h_input) - 1; % order of hir filter
y_output = zeros(L + M, 1);
y_output_cast = zeros(L + M + 1, 1);
for n = 2: (L + M + 1)
    y_output_cast(n) = 0;
    for m = max(1, (n - L)): min((n - 1), (M + 1))
        y_output_cast(n) = y_output_cast(n) + h_input(m) * x_input(n - m);
    end
end
for n = 1: (L + M)
    y_output(n) = y_output_cast(n + 1);
end

⌨️ 快捷键说明

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