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

    %% 3-D Response of Cardioid Microphone Over Restricted Range of Angles  
% Plot the 3-D response of a custom cardioid microphone in space but with
% both the azimuth and elevation angles restricted to the range -40 to 40
% degrees in 0.1 degree increments.   

% Copyright 2015 The MathWorks, Inc.


%%  
% Create a custom microphone element with a cardioid pattern.  
h = phased.CustomMicrophoneElement;
h.PolarPatternFrequencies = [500 1000];
h.PolarPattern = mag2db([...
    0.5+0.5*cosd(h.PolarPatternAngles);...
    0.6+0.4*cosd(h.PolarPatternAngles)]);
%%
% Plot the 3-D response.
fc = 500;
plotResponse(h,fc,'Format','polar','RespCut','3D',...
    'Unit','mag','AzimuthAngles',[-40:0.1:40],...
    'ElevationAngles',[-40:0.1:40]);