One-dimensional digital filter filter using
Filter
1-d Digital Filter Expand All in Page Syntax
y = filter (b,a,x)
[Y,ZF] = filter (b,a,x)
[Y,ZF] = filter (B,a,x,zi)
y = filter (B,a,x,zi,dim)
[...] = Filter (B,a,x,[],dim)
Filter function 0.15
H (z) =----------------------
1-0.8*z^-1
b = 0.15;
A = [1-0.8];
n = [0:100];
x = 2*sin (0.05*pi*n) + 2*RANDN (1, 101); % Filter forward sequence
imp = [1; zeros (1)];
H = Filter (b, A, IMP); The% filter function uses an X to transform the pre-filter sequence
w = conv (x, h);% to make the product
YC = w (1:101); % Filter Sequence
z= filter (b, a, x);% to filter
xlabel (' n ');
Ylabel (' x y yc ');
Plot (n, X, ' R ', n,z, ' B ', N,yc, ' m ');
Grid
The idea is simple, the first is to use the impact function Imp = [1; zeros (100,1)] to obtain the filter function, and then the product with the function
Operation Result: