PHD Discussions Logo

Ask, Learn and Accelerate in your PhD Research

Question Icon Post Your Answer

Question Icon

2 years ago in Electrical Engineering By Rohan

I’ve exported 3D far-field data (theta, phi, E-field) from HFSS. How can I use MATLAB to post-process it into standard 2D rectilinear plots (e.g., E-plane and H-plane cuts)?

My EM solver outputs a .csv file with columns for Theta, Phi, and the complex-valued far-field (e.g., E_Theta, E_Phi). I want to generate normalized polar plots for specific phi cuts (like phi=0° for the E-plane) and also Cartesian plots of gain vs. theta. What's the most efficient way in MATLAB to handle this spherical coordinate data, extract the desired cuts, compute total field or gain, normalize it, and plot it? I'm also concerned about correctly handling the co-pol and cross-pol components.

All Answers (1 Answers In All)

By Sallehahsim Answered 1 year ago

Here's the core of the script I use. First, import the data using readmatrix or similar, ensuring you have matrices for Theta, Phi, and the complex E-field components. Second, define your cut plane. For an E-plane cut at Phi=0°, use logical indexing: idx = (Phi == 0); Theta_cut = Theta(idx); E_cut = E_theta(idx);. Third, compute the total far-field if needed: E_total = sqrt(abs(E_theta).^2 + abs(E_phi).^2);. Fourth, normalize to 0 dB: E_norm_dB = 20*log10( abs(E_cut) / max(abs(E_cut)) );. Finally, plot. Use polarplot for polar graphs (converting degrees to radians) or plot for Cartesian. For gain, you'll need to incorporate the radiation intensity formula. Remember to handle the phi=0° and phi=90° cuts carefully to get true principal planes.

                       

Your Answer