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

📄 overlapadd.m

📁 基于双线性变换法的IIR滤波器范例 该滤波器为低通原型 可根据需要自行转换成高通 带通 以及重叠累加和重叠保留的例子
💻 M
字号:
function [yn] = overlapadd(xn,hn,M)
N = length(hn);
N1 = length(xn);
p = N1/M;
x = zeros(1,M);
y = zeros(p+1,M);
z = zeros(p+1,N1+M-1);
%split input xn into M points segment and store in matrix y
for k = [0:1:p-1]
    x = xn(M*k+1:M*(k+1));
    y(k+1,:) = x;
end
%handle the leaving elements of xn and add zeros to satisfy
%each segment with M points
if N1>M*(k+1)
    l = 1;
    for i = [M*(k+1)+1:N1]
        y(k+2,l) = xn(i);
        l = l+1;
    end
end
%conv hn and new input then shift and store the result in a new matrix z
b=0;
for j = [1:p+1]
    z(j,b*M+1:b*M+N+M-1) = conv(y(j,:),hn);
    b=b+1;
end
%add each row of z so the last row will be the final result
for j = [1:p]
    z(j+1,:) = z(j,:)+z(j+1,:)
end
yn = z(j+1,:)

⌨️ 快捷键说明

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