CustomMicrophoneElement object creates
a custom microphone element.
To compute the response of the microphone element for specified directions:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
H = phased.CustomMicrophoneElement creates
a custom microphone system object,
H, that models
a custom microphone element.
H = phased.CustomMicrophoneElement( creates
a custom microphone object,
H, with each specified
property set to the specified value. You can specify additional name-value
pair arguments in any order as (
Operating frequency vector
Specify the frequencies in hertz where the frequency responses of element are measured as a vector. The elements of the vector must be increasing. The microphone element has no response outside the specified frequency range.
Specify the frequency responses in decibels measured at the
frequencies defined in the
Polar pattern measuring frequencies
Specify the measuring frequencies in hertz of the polar patterns
as a row vector of length M. The measuring frequencies must be within
the frequency range specified in the
Polar pattern measuring angles
Specify the measuring angles in degrees of the polar patterns as a row vector of length N. The angles are measured from the central pickup axis of the microphone, and must be between –180 and 180, inclusive.
Specify the polar patterns of the microphone element as an M-by-N
matrix. M is the number of measuring frequencies specified in the
Default: An omnidirectional pattern with 0 dB response everywhere
|directivity||Directivity of custom microphone element|
|pattern||Plot custom microphone element directivity and patterns|
|patternAzimuth||Plot custom microphone element directivity or pattern versus azimuth|
|patternElevation||Plot custom microphone element directivity or pattern versus elevation|
|plotResponse||Plot response pattern of microphone|
|step||Output response of microphone|
Create a custom cardioid microphone, and calculate the microphone response at 500, 1500, and 2000 Hz in two directions: (0,0) azimuth and elevation, and (40,50) azimuth and elevation.
sCustMic = phased.CustomMicrophoneElement; sCustMic.PolarPatternFrequencies = [500 1000]; sCustMic.PolarPattern = mag2db([... 0.5+0.5*cosd(sCustMic.PolarPatternAngles);... 0.6+0.4*cosd(sCustMic.PolarPatternAngles)]); resp = step(sCustMic,[500 1500 2000],[0 0; 40 50]')
resp = 1.0000 1.0000 1.0000 0.7424 0.7939 0.7939
The total response of a custom microphone element is a combination
of its frequency response and spatial response.
both responses using nearest neighbor interpolation and then multiplies
them to form the total response. When the
value is nonscalar, the object specifies multiple polar patterns.
In this case, the interpolation uses the polar pattern that is measured
closest to the specified frequency.
Usage notes and limitations:
plotResponse methods are not supported.
See System Objects in MATLAB Code Generation (MATLAB Coder).