From 2ca306f70feaf975405de8e7dc08151f8e1d15d0 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 2 Jan 2013 19:23:25 +0100 Subject: [PATCH] nf2ff: calculate LH- and RH circular polarization Signed-off-by: Thorsten Liebig --- matlab/Tutorials/Helical_Antenna.m | 25 ++++++++++++++++++---- matlab/private/ReadNF2FF.m | 33 +++++++++++++++++++++--------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/matlab/Tutorials/Helical_Antenna.m b/matlab/Tutorials/Helical_Antenna.m index 27ee927..a6b0135 100644 --- a/matlab/Tutorials/Helical_Antenna.m +++ b/matlab/Tutorials/Helical_Antenna.m @@ -163,9 +163,9 @@ thetaRange = unique([0:0.5:90 90:180]); phiRange = (0:2:360) - 180; disp( 'calculating the 3D far field...' ); -nf2ff = CalcNF2FF(nf2ff, Sim_Path, f_res, thetaRange*pi/180, phiRange*pi/180,'Mode',1,'Outfile','3D_Pattern.h5','Verbose',1); +nf2ff = CalcNF2FF(nf2ff, Sim_Path, f_res, thetaRange*pi/180, phiRange*pi/180,'Mode',0,'Outfile','3D_Pattern.h5','Verbose',1); -theta_HPBW = thetaRange(find(nf2ff.E_norm{1}(:,1) + +% Setup vectors for converting to LHCP and RHCP polarization senses +cosphi = cos(nf2ff.phi)'; +sinphi = sin(nf2ff.phi)'; + +for f=1:numel(nf2ff.freq) + for n = 1:numel(nf2ff.theta) + nf2ff.E_cprh{f}(n,:) = (cosphi+1i*sinphi) .* (nf2ff.E_theta{f}(n,:)+1i*nf2ff.E_phi{f}(n,:))/sqrt(2); + nf2ff.E_cplh{f}(n,:) = (cosphi-1i*sinphi) .* (nf2ff.E_theta{f}(n,:)-1i*nf2ff.E_phi{f}(n,:))/sqrt(2); end end