Wednesday, August 29, 2012

MATLAB - Circular Polarization


polarization
% =========================================================================
% ***************************** Polarization ******************************
% ***************************** By Mahesha MG *****************************
% The following code visualises circular polarization
% sin(theta) and cos(theta) are two waves propagating normal to screen
% The graph is section view where red colored rotating vector shows
% the resultant
% Date: 29/08/2012
% =========================================================================
clear
clc
theta=0:2*pi/1000:2*pi;
x=cos(theta);
y=sin(theta);
x1(1)=0;
y1(1)=0;
xaxx=[-1;1];
xaxy=[0;0];
yaxx=[0;0];
yaxy=[-1;1];
figure('color','white');
for i=1:1:size(x')
    x1(2)=x(i);
    y1(2)=y(i);
    xcompx(1)=x(i);
    xcompy(1)=y(i);
    xcompy(2)=0;
    xcompx(2)=sqrt(x(i)^2+y(i)^2)*cos(theta(i));
    ycompx(1)=x(i);
    ycompy(1)=y(i);
    ycompx(2)=0;
    ycompy(2)=sqrt(x(i)^2+y(i)^2)*sin(theta(i));
    plot(xaxx,xaxy,'b',yaxx,yaxy,'g',x,y,'r',xcompx,xcompy,'-b',ycompx,ycompy,'-g',x1,y1,'-ro')
    axis square;
    title('Circular polarization | By Mahesha MG 2012')
    getframe;

end

6 comments:

  1. very nice, now how about right and left hand circular, then vert and hor pol at same time !

    ReplyDelete
  2. Show right and left hand circular polarization together
    Show vertical and horizontal polarization together

    ReplyDelete
  3. simply high teaching. Thank sir

    ReplyDelete