From 1f285996fcf5fcf3863f22e4e6c07250c4b95aa6 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 13 Feb 2013 13:56:18 +0100 Subject: [PATCH] matlab: updates to LH/RH circ. polarization calculation Signed-off-by: Thorsten Liebig --- matlab/private/ReadNF2FF.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/matlab/private/ReadNF2FF.m b/matlab/private/ReadNF2FF.m index f9bccac..5e44c69 100644 --- a/matlab/private/ReadNF2FF.m +++ b/matlab/private/ReadNF2FF.m @@ -61,12 +61,11 @@ nf2ff.E_cprh = []; nf2ff.E_cplh = []; % Setup vectors for converting to LHCP and RHCP polarization senses -cosphi = cos(nf2ff.phi)'; -sinphi = sin(nf2ff.phi)'; +[THETHA PHI] = ndgrid(nf2ff.theta,nf2ff.phi); +cosphi = cos(PHI); +sinphi = sin(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 + nf2ff.E_cprh{f} = (cosphi+1i*sinphi) .* (nf2ff.E_theta{f}+1i*nf2ff.E_phi{f})/sqrt(2); + nf2ff.E_cplh{f} = (cosphi-1i*sinphi) .* (nf2ff.E_theta{f}-1i*nf2ff.E_phi{f})/sqrt(2); end