?? convolution.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
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -