Followings are the code that I wrote in Octave to creates all the plots shown in this page. You may copy these code and play with these codes. Change variables and try yourself until you get your own intuitive understanding.
< Code 1 >
x = [ ...
-1 1; ...
1 1; ...
1 -1; ...
-1 -1; ...
];
x = x';
c1 = x(1,:) + j*x(2,:);
c2 = circshift(c1,4);
tstep = pi/20;
t=0:tstep:2*pi;
k=1;
d=0;
e3 = exp(k*t*j)*exp(j*d);
n = 40;
m = exp(-j*n*2*pi/40);
tc = m * [c1; c2];
hFig = figure(1,'Position',[300 300 900 250]);
subplot(1,3,1);
hold on;
plot(real(e3),imag(e3),'k-');
hold on;
plot(real(e3),imag(e3),'bo','MarkerFaceColor',[0 0 1]);
axis([-1.1 1.1 -1.1 1.1]);
xlabel('real : e^{j t}');
ylabel('imaginary : e^{j t}');
plot(real(m),imag(m),'ro',"markerfacecolor",[1 0 0],'MarkerSize',12);
daspect([1 1]);
quiver([0],[0],[real(m)],[imag(m)],"color","red","maxheadsize", 0.1);
line([-1.2 1.2],[0 0],'color','black');
line([0 0],[-1.2 1.2],'color','black');
hold off;
box off;
axis off;
daspect([1 1]);
subplot(1,3,2);
hold on;
plot(real(c2(1)),imag(c2(1)),'ro','MarkerFaceColor',[1 0 0],'MarkerSize',8);
plot(real(c2(2)),imag(c2(2)),'go','MarkerFaceColor',[0 1 0],'MarkerSize',8);
plot(real(c2(3)),imag(c2(3)),'bo','MarkerFaceColor',[0 0 1],'MarkerSize',8);
plot(real(c2(4)),imag(c2(4)),'ko','MarkerFaceColor',[0 0 0],'MarkerSize',8);
axis([-2 2 -2 2]);
daspect([1 1]);
hold off;
grid on;
box on;
subplot(1,3,3);
hold on;
tc1 = tc(1,:);
plot(real(tc1(1)),imag(tc1(1)),'ro','MarkerFaceColor',[1 0 0],'MarkerSize',8);
plot(real(tc1(2)),imag(tc1(2)),'go','MarkerFaceColor',[0 1 0],'MarkerSize',8);
plot(real(tc1(3)),imag(tc1(3)),'bo','MarkerFaceColor',[0 0 1],'MarkerSize',8);
plot(real(tc1(4)),imag(tc1(4)),'ko','MarkerFaceColor',[0 0 0],'MarkerSize',8);
axis([-2 2 -2 2]);
daspect([1 1]);
hold off;
grid on;
box on;
|