www.gusucode.com > phased 案例源码 matlab代码程序 > phased/AzimuthResponseCardioidMicrophoneExample.m

    %% Azimuth Response and Directivity of Cardioid Microphone
% Design a cardioid microphone to
% operate in the frequency range between 500 and 1000 Hz.

% Copyright 2015 The MathWorks, Inc.

h = phased.CustomMicrophoneElement;
h.PolarPatternFrequencies = [500 1000];
h.PolarPattern = mag2db([...
    0.5+0.5*cosd(h.PolarPatternAngles);...
    0.6+0.4*cosd(h.PolarPatternAngles)]);
%%
% Display a polar plot of an azimuth cut of the response at 500 Hz and 1000 Hz.
fc = 500;
plotResponse(h,[fc 2*fc],'RespCut','Az','Format','Polar');

%%
% Plot the directivity as a line plot for the same two frequencies.
plotResponse(h,[fc 2*fc],'RespCut','Az','Format','Line','Unit','dbi');