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 = [ ...
0 45; ...
14 45; ...
26 13; ...
39 45; ...
52 45; ...
52 0; ...
44 0; ...
44 38; ...
30 0; ...
21 0; ...
8 38; ...
8 0; ...
0 0; ...
0 45; ...
];
x = x';
c = x(1,:) + j*x(2,:);
n = 20;
m = [1; ...
exp(-j*n*2*pi/20)];
tc = m * c;
hFig = figure(1,'Position',[300 300 700 250]);
subplot(1,7,[1 3]);
%plot(x(1,:),x(2,:),'bo-','MarkerFaceColor',[1 0 0]);
plot(real(c),imag(c),'b-');
axis([-100 100 -100 100]);
grid on;
subplot(1,7,[5 7]);
%plot(tx(1,:),tx(2,:),'bo','MarkerFaceColor',[1 0 0]);
hold on;
plot(real(tc(1,:)),imag(tc(1,:)),'r-');
plot(real(tc(2,:)),imag(tc(2,:)),'k-');
axis([-100 100 -100 100]);
hold off;
grid on;
box on;
|