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