-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathpolo.asv
More file actions
executable file
·33 lines (24 loc) · 752 Bytes
/
polo.asv
File metadata and controls
executable file
·33 lines (24 loc) · 752 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
function [y]=polo(x,z0,tol)
%OK se polo è a fase minima abs(z0)<1
if(abs(z0)<1)
in=1e-5; %valore che in realtà è di y(-1), serve come impulso ad alimentare
%il meccanismo ricorsivo che alimenta il polo
y(1)=x(1)+z0*in; %impuso in ingresso che alimenta il polo (cioè X(z) a banda piatta, 1)
y(2)=x(2)+z0*y(1);
i=2;
while(i<length(x))
y(i+1)=x(i+1)+z0*y(i);
i=i+1;
end
else
in=1e-5; %stavolta è il campione che alimenta il circuito ricorsivo n=1
%troverà la sequenza convergente anticausale, cioè che va da 0 a -n
y(1)=(1/z0)*(in-x(1));
y(2)=(1/z0)*(y(1)-x(2));
i=2;
while(i<length(x))
y(i+1)=(1/z0)*(y(i)-x(i));
i=i+1;
end
y=fliplr(y);
end