How do I get a outer loop in a polar plot in MATLAB

To display the multiple microphone directive pattern, I wrote a simple MATLAB program.
% Super-cardiod = 0.57
% Hyper-Cardiod = 0.33
A_sen = 20.0; % sensitivity
c = 343; % speed of sound 343 m/s
Beta_1 = 0.33; % beta value for the shape of the directivity pattern
Beta_2 = 0.57; % beta value for the shape of the directivity pattern
d = 0.09; % distance between two microphones
Ang_freq = 90; % Angular frequency of sound
theta = linspace(-2*pi,2*pi); % Angular ref to microphone
U_total_1 = (A_sen *(Ang_freq*d)/c)*(Beta_1+cos(theta));
U_total_2 = (A_sen *(Ang_freq*d)/c)*(Beta_2+cos(theta));
subplot(2,1,1),polar(theta,U_total_1)
subplot(2,1,2),polar(theta,U_total_2)
The MATLAB program works to display the directivity pattern as below,
However, I'd like the inner loop to be an outer loop as shown in the link below.
I suppose this is due to the axes limits. But I'm not sure. How do I get the inner loop to show as an outer loop. Thank you..
Note: I am using R2014b. Therefore I don't have the polarplot function. So I will have to stick to the polar function in MATLAB.

4 Comments

But there are no loops in your code..?
If you see the figure or if you run the code, you will see that there is a big cardioid curve (big loop) and then there is a smaller loop (smaller cardioid) within the bigger cardioid. There is no loop/curve in the code. The loop/curve is in the polar plot.
You are trying to create a hypercardioid ?

Sign in to comment.

 Accepted Answer

Hi Union Olive,
If you replace
U_total_1 = (A_sen *(Ang_freq*d)/c)*(Beta_1+cos(theta));
with
U_total_1 = abs(A_sen *(Ang_freq*d)/c)*(Beta_1+cos(theta)));
and similarly with U_total_2 it should work.

4 Comments

Thank you. That worked. I did.
subplot(2,1,1),polar(theta,abs(U_total_1))
If I can get greedy here, do you know if there is another way to change the axes limits, I'd like to be able to display the negative values as well. I know it is possible using the new 'polarplot' function, but is there a way to do so with the 'polar' function?**
I had some doubts about how that pattern would look so I ran the hypercardioid case using polarplot and the limits [-.4, .7]. It doesn't look very helpful, since now U_total_1 = 0 is not at the origin any more and at first glance the pattern looks like a subcardioid. You lose a lot by not having zero output at the origin, and I believe the abs option is the most physically meaningful plot (although I have not looked into the possibility that abs^2 is what is wanted).
I would post a picture of the plot except I can't figure out how to copy it into this window, although almost everyone else in Matlabland can do it. (I know I could attach it as a png file or whatever but I would like to have the window option as well).
The picture-Frame button between the link icon and the paper clip is to insert images. Just make sure you have an empty line before and after the coding of the link. The system uses <<URL>> as the indication to put the image in-line.
Thanks David. I'll stick with the abs option. Since this is just for simulation, I'm fine with 'abs', I just wanted to see if there was anything else that could be done. Thank you again.

Sign in to comment.

More Answers (0)

Categories

Find more on Get Started with Phased Array System Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!