www.gusucode.com > phased 案例源码 matlab代码程序 > phased/DirectivityOmnidirectionalMicrophoneElementExample.m
%% Directivity of Omnidirectional Microphone Element % Compute the directivity of an omnidirectional microphone element for % several different directions. %% % Create the omnidirectional microphone element system object. % Copyright 2015 The MathWorks, Inc. myMic = phased.OmnidirectionalMicrophoneElement(); %% % Select the angles of interest at constant elevation angle set equal to zero % degrees. Select seven azimuth angles centered at boresight (zero degrees % azimuth and zero degrees elevation). Finally, set the desired frequency to 1 kHz. ang = [-30,-20,-10,0,10,20,30; 0,0,0,0,0,0,0]; freq = 1000; %% % Compute the directivity along the constant elevation cut. d = directivity(myMic,freq,ang) %% % Next select the angles of interest to be at constant azimuth % angle at zero degrees. All elevation angles are centered around % boresight. The five elevation angles range from -20 to +20 degrees. Set % the desired frequency to 1 GHz. ang = [0,0,0,0,0; -20,-10,0,10,20]; freq = 1000; %% % Compute the directivity along the constant azimuth cut. d = directivity(myMic,freq,ang) %% % For an omnidirectional microphone, the directivity is independent of % direction.