Matrix Complex - Matrix Example

 

Before you look into this tutorial, I would suggest you to try this tutorial first and get the complete understanding on how e^(i w) affect to a complex number on cartesian coordinate.

 

In this tutorial, a 1x2 vector is multiplied (innerproduct) with a 2x1 vector. The 1x2 vector is made up of two e^(i w) expressed as a red dot on the circumference of a unit circle and the 2x1 vector is made up of two complex number shown as a constellation. In this tutorial, the element value of 2x1 vector does not change, but the value of 1x2 vector changes on each slide.  By the result of element by element multiplication, a set of new complex number is produced as shown in the constellation A and B. To complete the operation of innerproduct, the two value A and B are summed up to produce the result X.

What I am trying to point out in this tutorial is that the two e^(i w) in 1x2 vector rotates at the same rate and in the same direction, and the result of multiplication of A and B shows that the constellation rotates at the same rate in the same direction. As a result, the sum of A and B (X) shows the rotation in the same direction.

 

 

 

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:tstep*40*2;

t=0:tstep:2*pi;

k=1;

d=0;

e3 = exp(k*t*j)*exp(j*d);

 

n = 40;

w1 = 1;

w2 = -1;

m1 =  exp(-j*w1*n*2*pi/40);     

m2 =  exp(-j*w2*n*2*pi/40);

 

tc1 = m1 * [c1];

tc2 = m2 * [c1];

     

hFig = figure(1,'Position',[300 300 900 300]);    

axisRange = [-3.1 3.1 -3.1 3.1];

 

subplot(2,5,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(m1),imag(m1),'ro',"markerfacecolor",[1 0 0],'MarkerSize',12);

daspect([1 1]);

quiver([0],[0],[real(m1)],[imag(m1)],"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(2,5,2);

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(m2),imag(m2),'ro',"markerfacecolor",[1 0 0],'MarkerSize',12);

daspect([1 1]);

quiver([0],[0],[real(m2)],[imag(m2)],"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(2,5,3);

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(axisRange);

daspect([1 1]);

hold off;

grid on;

box on;

 

subplot(2,5,8);

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(axisRange);

daspect([1 1]);

hold off;

grid on;

box on;

 

subplot(2,5,4);     

hold on;

tc = tc1(1,:);

plot(real(tc(1)),imag(tc(1)),'ro','MarkerFaceColor',[1 0 0],'MarkerSize',8);

plot(real(tc(2)),imag(tc(2)),'go','MarkerFaceColor',[0 1 0],'MarkerSize',8);

plot(real(tc(3)),imag(tc(3)),'bo','MarkerFaceColor',[0 0 1],'MarkerSize',8);

plot(real(tc(4)),imag(tc(4)),'ko','MarkerFaceColor',[0 0 0],'MarkerSize',8);

axis(axisRange);

daspect([1 1]);

hold off;

grid on;

box on;

 

subplot(2,5,9);     

hold on;

tc = tc2(1,:);

plot(real(tc(1)),imag(tc(1)),'ro','MarkerFaceColor',[1 0 0],'MarkerSize',8);

plot(real(tc(2)),imag(tc(2)),'go','MarkerFaceColor',[0 1 0],'MarkerSize',8);

plot(real(tc(3)),imag(tc(3)),'bo','MarkerFaceColor',[0 0 1],'MarkerSize',8);

plot(real(tc(4)),imag(tc(4)),'ko','MarkerFaceColor',[0 0 0],'MarkerSize',8);

axis(axisRange);

daspect([1 1]);

hold off;

grid on;

box on;

 

subplot(2,5,5);     

hold on;

tc = tc1(1,:)+tc2(1,:);

plot(real(tc(1)),imag(tc(1)),'ro','MarkerFaceColor',[1 0 0],'MarkerSize',8);

plot(real(tc(2)),imag(tc(2)),'go','MarkerFaceColor',[0 1 0],'MarkerSize',8);

plot(real(tc(3)),imag(tc(3)),'bo','MarkerFaceColor',[0 0 1],'MarkerSize',8);

plot(real(tc(4)),imag(tc(4)),'ko','MarkerFaceColor',[0 0 0],'MarkerSize',8);

axis(axisRange);

daspect([1 1]);

hold off;

grid on;

box on;