3D pattern rotation

3 views (last 30 days)
John Adams
John Adams on 4 Feb 2023
Commented: Yash Srivastava on 20 Mar 2023
Hello,
I have an exported radiation pattern with the following form: a T1 matrix [Nx3], where:
1st column Amplitude;
2nd column Theta (from -180 to 180);
3rd column Phi (from -90 to 90);
By using the following code:
figure();
patternCustom(T1(:,1),T1(:,2),T1(:,3));
I get the correct radiation pattern, which is the following:
My problems are the following:
1) When I use another way to plot the pattern, I get something which is deformed (not talking about the rotation, but the shape itself)
This is how I try to plot the second one:
th_a = 360/stepsize;
phi_a = 180/stepsize;
T2= zeros(phi_a+1,th_a+1);
for n=1:phi_a+1
for i=1:th_a
T2(n,i) = T1(i+((n-1)*th_a),1);
end
end
theta = 0:stepsize:180;
phi = 0:stepsize:360;
freqVector = [30 30.00005].*1e9; % Frequency range for element pattern
antenna = phased.CustomAntennaElement('FrequencyVector',freqVector, ...
'PatternCoordinateSystem','phi-theta',...
'PhiAngles',phi,...
'ThetaAngles',theta,...
'MagnitudePattern',T2,...
'PhasePattern',zeros(size(T2)));
fmax = freqVector(end);
figure();
pattern(antenna,fmax,'Type','powerdb')
I think it's related to the fact that in the second way, phi is required from 0:360 and theta from 0:180, while from the exported way, I have phi from -90:90 and theta from -180:180.
How can I solve this issue? Of course, this is not the main problem, considering the fact I can use the first representation. The main problem, which I think it's quite related, is that this happens also when I try to use the rotpat function.
2) If I use the rotpat function, I get something deformed as well.
el = -90:stepsize:90;
az = -180:stepsize:180;
newax=roty(90);
pat = rotpat(T2,az,el,newax);
for n=1:phi_a+1
for i=1:th_a
T3(i+((n-1)*th_a),1) = pat(n,i);
end
end
figure();
patternCustom(T3(:,1),T1(:,2),T1(:,3));
How can I solve this issue? Of course, my main goal would be to rotate the radiation pattern.
Many thanks in advance.
  1 Comment
Yash Srivastava
Yash Srivastava on 20 Mar 2023
Hi John,
To have better understanding of your question, please provide T1 data.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!