Radar Graphical Simulation | How to convert the range-azimuth matrix spectrum into a fan spectrum?

Editor of this article: Naughty brother's assistant
insert image description here

Hello everyone, recently I saw a question raised by a reader, that is, how to use MATLAB to draw a sector diagram of radar data range-azimuth, as shown below:
insert image description here

Usually the distance-azimuth spectrum, we are used to drawing a rectangular diagram instead of a fan diagram, but sometimes it is necessary to draw a fan diagram, such as in a paper or an interface for customer presentations. So how to solve this problem?

Naughty Brother made a special program for everyone, mainly for practicality, and you don’t have to worry about this kind of graphics in the future. The following is the rendering: (Figure 1: Distance-Azimuth Fan
insert image description here
Diagram)

This interface is just a preliminary effect. If you are not satisfied, you can modify the program I give later until it meets your own needs. The program is very simple, just a few lines of code, the core code is as follows:

%Convert polar coordinates to rectangular coordinates form
figure;%Public number: naughty continuous wave
X = R'*cosd(ang_ax); Y = R'*sind(ang_ax); %
clf;
pcolor(X,Y,pow2db(abs( range_az).^2));
axis equal tight %The unit scale of the x-axis is equal to the length of the unit scale of the y-axis, which can best reflect the actual curve;
shading interp %coloring, so that the color transitions smoothly
axis off
initialAz = -90; endAz = 90; %Dimension text
text((max®+10)*cosd(initialAz),(max®)*sind(initialAz),…
[num2str(initialAz) '^o']);
text((max®+10) *cosd(endAz),(max®)*sind(endAz),…
[num2str(endAz) '^o']);
text((max®+10)*cosd(0),(max®)*sind( 0),[num2str(0) '^o']);
colorbar; % heat value

This program fragment has been updated in the program of the article "Open Source Code | FMCW-MIMO Radar Simulation MATLAB (the last one in 2022)". After downloading and running, you can see it. Interested readers should try it out.

You can refer to this article for the code of using Pyhton to draw fan charts: https://github.com/moodoki/radical_sdk , the effect is shown in the following figure:
insert image description here

The core code is as follows:

from radicalsdk.geometry import PolarToCartesianWarp
p2c = PolarToCartesianWarp() #Project to Cartesian coordinate system
cartesian_radar = p2c(np.abs(rf.range_azimuth_capon)[np.newaxis, …, np.newaxis])
plt.figure()
with np. errstate(divide='ignore'):
plt.imshow(np.log(cartesian_radar[0, …]))
plt.show()

Guess you like

Origin blog.csdn.net/qq_35844208/article/details/128636203