How can I rotate an antenna pattern in MATLAB?

213 Views Asked by At

I have the data of an antenna pattern (azimuth, elevation, gain: including 361x361 numbers). I wanted to rotate the elevation by function circshift(). However, when I rotated the elevation angle and checked the antenna pattern by using function patternCustom(Mag, Theta, Phi), the back lobe of the antenna disappeared. How can I fix it?

I may be not familiar with the definition of patternCustom().

Here is my function to rotate the elevation angle:

function shifted = shiftEl(mag, rot)
    shifted = zeros(size(mag));
    for i = 0 : 360
        shifted(1 + i * 361 : 361 + i * 361) = circshift(mag(1 + i * 361 : 361 + i * 361), rot);
    end
end

In the main function, I rotated elevation angle (90-Phi) by rotating magnitude:

mag_shift = shiftEl(mag, 30);
1

There are 1 best solutions below

3
Andrew On

Based on your provided code, it seems that you are trying to rotate the elevation angles of an antenna pattern by using the 'circshift' function in MATLAB. However, this approach is not appropriate for rotating the elevation angles.

The 'circshift' function is designed for circular shifting of elements within an array, which means it shifts the values without altering their order or relationship. In the case of antenna patterns, simply shifting the magnitude values without adjusting the corresponding elevation angles will not result in a proper rotation of the pattern.

To correctly rotate the elevation angles, you need to modify the elevation data directly rather than shifting the magnitude values. Here's an example of how you can rotate the elevation angles:

Define the rotation angle in degrees

rotation_angle = 30

Convert rotation angle to radians

rotation_angle_rad = deg2rad(rotation_angle)

Rotate elevation angles

rotated_elevation = Theta + rotation_angle_rad

Ensure that rotated_elevation is within the valid range (0 to pi)

rotated_elevation = mod(rotated_elevation, pi)

Visualize the rotated antenna pattern using patternCustom or other visualization methods

patternCustom(mag, rotated_elevation, Phi)