Matrix Complex - Matrix Example

 

This tutorial shows an example of a complex number with a 2x2 matrix  that is made up of complex number elements. It performs this operation for four paris points on the left side and displays the result on the right side as shown below. If you are familiar with wireless communication system, you would easily recognize it as QAM constellation. Actually this example is to show how the constellation changes when it is multiplexed with a certain complex matrix. I picked the complex matrix which is same or similar to the precoding matrix in LTE.

 

I used a matrix with a very special complex number which is very widely used in engineering. It is the complex number expressed in Euler form.

If you are not familiar with Complex Number, see my note on Complex number. If you don't know how to do complex number multiplication, see this note.

 

As shown below, a pair of points with the same color on the left is multiplied with a complex matrix and the result is plotted on the right side in the same color.

 

 

 

 

 

 

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

 

n = 20;

%m = (1/2) .* [1 1; ...

%              j exp(-j*n*2*pi/20)];

m =  [1 0; ...

     0 exp(-j*n*2*pi/20)];

 

tc = m * [c1; c2];

     

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

subplot(2,7,[1 3]);

hold on;

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

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

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

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

axis([-2 2 -2 2]);

hold off;

grid on;

box on;

 

subplot(2,7,[8 10]);

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]);

hold off;

grid on;

box on;

 

subplot(2,7,[5 7]);     

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]);

hold off;

grid on;

box on;

 

subplot(2,7,[12 14]);     

hold on;

tc2 = tc(2,:);

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

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

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

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

axis([-2 2 -2 2]);

hold off;

grid on;

box on;