Script MATLAB per mappare la corrispondenza tra piano S e piano Z
I punti del piano s sono legati al piano z dalla relazione:
e di seguito il codice di uno script MATLAB per mappare sul piano z i punti del piano s:
thetaS=0:pi/8:2*pi;
circ=exp(j*thetaS);
plot(circ);hold on
zz=ones(size(circ))*(.00001+j*0.0001)
plot([zz;circ])
axis 'square'% Visualising the complex exponential
% by
% Richard Hayes, November 2010
% Map s 2 z
%
clf;
whitebg('white');
ze=0.0001+j*0.0001;
T=1;
% S-plane
sigma=-.3;omega=1;
s=sigma+j*omega;
ha4=subplot(1,2,2);
hplot4=plot(s,'or','MarkerSize',12,'MarkerFaceColor','y','LineWidth',3);hold on;
title('s-plane',...
'FontSize',20)
plot([-4+j*0.00001 0-j*4;0.5+j*0.00001 0+j*4],'k','linewidth',4)
grid
axis([-4 0.5 -4 4]);
%sgrid
% z-plane
ha3=subplot(1,2,1);
z=exp(s*T)+ze;
hplot1=plot(z,'or','MarkerSize',12,'MarkerFaceColor','y','LineWidth',3);hold on;
%zgrid([],[]);axis 'square';
%zgrid;axis 'square';
thetaS=0:pi/8:2*pi;
circ=exp(j*thetaS);
plot(circ);hold on
zz=ones(size(circ))*(.00001+j*0.0001)
plot([zz;circ])
axis 'square'
title('z-plane',...
'FontSize',20)
while 1
set(hplot4,'XData',real(s),'YData',imag(s));
set(hplot1,'XData',real(z),'YData',imag(z));
axes(ha4)
% subplot(1,2,2)
% f=imag(log(z))/2/pi;
% title(['frequency = ' num2str(f)],...
% 'FontSize',14)
v1 = get(ha4,'currentpoint');
s=v1(1,1)+j*v1(1,2);
z=exp(s*T);
end
Fonte: rghmatlabstuff.wordpress.com