measure adjacent channel power ratio (acpr) -凯发k8网页登录
measure adjacent channel power ratio (acpr)
description
the comm.acpr
system object™ measures the acpr of an input signal.
to measure the acpr of an input signal:
create the
comm.acpr
object and set its properties.call the object with arguments, as if it were a function.
to learn more about how system objects work, see what are system objects?
creation
description
creates an acpr measurement
system object.acpr
= comm.acpr
sets properties using one or more name-value
arguments. for example, acpr
= comm.acpr(name
,value
)comm.acpr('normalizedfrequency',true)
creates
an acpr measurement object with normalized frequency values.
properties
unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. objects lock when you call them, and the function unlocks them.
if a property is tunable, you can change its value at any time.
for more information on changing property values, see .
normalizedfrequency
— normalized frequency values
0
or false
(default) | 1
or true
normalized frequency values, specified as one of these logical values.
0
(false
) — frequency values are measured in hz.1
(true
) — frequency values are normalized in the range [-1, 1].
data types: logical
| double
samplerate
— sample rate of input signal
1000000
(default) | positive scalar
sample rate of input signal in hz, specified as a positive scalar.
dependencies
to enable this property, set the normalizedfrequency
property to false
.
data types: double
mainchannelfrequency
— main channel center frequency
0
(default) | numeric scalar
main channel center frequency, specified as a numeric scalar.
if you set the
normalizedfrequency
property totrue
, specify the center frequency as a normalized value in the range [−1, 1].if you set the
normalizedfrequency
property tofalse
, specify the center frequency in hz.
this property specifies where the object measures the main channel power in the
bandwidth specified by the mainmeasurementbandwidth
property. for more details on how to set these
two properties, see algorithms.
data types: double
mainmeasurementbandwidth
— main channel measurement bandwidth
50000
(default) | positive scalar
main channel measurement bandwidth, specified as a positive scalar.
if you set the
normalizedfrequency
property totrue
, specify the measurement bandwidth as a normalized value in the range [0, 1].if you set the
normalizedfrequency
property tofalse
, specify the measurement bandwidth in hz.
this property specifies the bandwidth in which the object measures the main channel
power. the measurement is taken at the center of the frequency, specified by the
mainchannelfrequency
property. for more details on how to set these two
properties, see algorithms.
data types: double
adjacentchanneloffset
— adjacent channel frequency offsets
[-100000 100000]
(default) | numeric scalar | numeric row vector
adjacent channel frequency offsets, specified as a numeric scalar or row vector comprising frequencies that define the location of adjacent channels of interest.
if you set the
normalizedfrequency
property totrue
, specify the adjacent channel frequency offsets as normalized values in the range [−1, 1].if you set the
normalizedfrequency
property tofalse
, specify the adjacent channel frequency offsets in hz.
the offset values indicate the distance between the main channel center frequency and adjacent channel center frequencies. positive offsets indicate adjacent channels to the right of the main channel center frequency. negative offsets indicate adjacent channels to the left of the main channel center frequency. for more details on how to set properties of the adjacent channels, see algorithms.
data types: double
adjacentmeasurementbandwidth
— measurement bandwidth for each adjacent channel
50000
(default) | numeric scalar or row vector
measurement bandwidth for each adjacent channel, specified as one of these options.
numeric scalar — the object obtains all adjacent channel power measurements within equal measurement bandwidths.
numeric row vector of length equal to the number of offsets specified in the
adjacentchanneloffset
property — the object obtains each adjacent channel power measurement based on its specific bandwidth that is centered at the frequency defined by the corresponding frequency offset. theadjacentchanneloffset
property defines this frequency offset.
set the values of this property with respect to the normalizedfrequency
property.
if you set the
normalizedfrequency
property totrue
, specify the measurement bandwidth values as normalized values in the range [0, 1].if you set the
normalizedfrequency
property tofalse
, specify the measurement bandwidth values in hz.
for more details on how to set properties of the adjacent channels, see algorithms.
data types: double
measurementfiltersource
— source of measurement filter
'none'
(default) | 'property'
source of the measurement filter, specified as one of these values.
'none'
— the object does not apply filtering to obtain acpr measurements.'property'
— the object applies a measurement filter to the main channel before measuring the average power. specify the measurement filter coefficients by using themeasurementfilter
property. each of the adjacent channel bands also receives a measurement filter.
data types: char
| string
measurementfilter
— measurement filter coefficients
1
(default) | numeric row vector
measurement filter coefficients, specified as a numeric row vector containing the coefficients of an fir filter in descending polynomial powers. center the response of the filter at dc. the object automatically shifts and applies the filter response at each of the main and adjacent channel center frequencies before obtaining the average power measurements. the internal filter states persist between calls to the object. to clear the states, call the object function.
the default value specifies an all-pass filter that has no effect on the measurements.
dependencies
to enable this property, set the measurementfiltersource
property to
'property'
.
data types: double
spectralestimation
— spectral estimation control
'auto'
(default) | 'specify frequency resolution'
| 'specify window parameters'
spectral estimation control, specified as one of these values.
'auto'
— the object obtains power measurements with a welch spectral estimator with zero-percent overlap, a hamming window, and a segment length equal to the length of the input data vector. the spectral estimator set can achieve the maximum frequency resolution that is attainable with the input data length.'specify frequency resolution'
— the object uses the value specified by thefrequencyresolution
property to automatically compute the size of the spectral estimator data window.'specify window parameters'
— the object obtains power measurements with a welch spectral estimator determined by thesegmentlength
,overlappercentage
,window
, andsidelobeattenuation
properties. in this setting, thefrequencyresolution
property does not apply, but you can use these properties to control also the resolution.
data types: char
| string
segmentlength
— segment length for spectral estimator
64
(default) | positive integer
segment length for the spectral estimator in samples, specified as a positive integer. the segment length enables you to make tradeoffs between frequency resolution and variance in the spectral estimates. a long segment length results in better resolution. a short segment length results in more averaging and a decrease in variance.
dependencies
to enable this property, set the spectralestimation
property to 'specify window
parameters'
.
data types: double
overlappercentage
— overlap percentage between segments
0
(default) | numeric scalar in the range [0, 100]
overlap percentage between segments in the spectral estimator, specified as a numeric scalar in the range [0, 100].
dependencies
to enable this property, set the spectralestimation
property to 'specify window
parameters'
.
data types: double
window
— window function for spectral estimator
'hamming'
(default) | 'bartlett'
| 'bartlett-hanning'
| 'blackman'
| 'blackman-harris'
| 'bohman'
| 'chebyshev'
| 'flat top'
| 'hann'
| 'nuttall'
| 'parzen'
| 'rectangular'
| 'triangular'
window function for the spectral estimator, specified as
'hamming'
, 'bartlett'
,
'bartlett-hanning'
, 'blackman'
,
'blackman-harris'
, 'bohman'
,
'chebyshev'
, 'flat top'
,
'hann'
, 'nuttall'
, 'parzen'
,
'rectangular'
, or 'triangular'
.
the default hamming window has a sidelobe attenuation of 42.5 db. this attenuation can mask spectral content below this value, relative to the peak spectral content. choosing different windows enables you to make tradeoffs between resolution and sidelobe attenuation.
dependencies
to enable this property, set the spectralestimation
property to 'specify window
parameters'
.
data types: char
| string
sidelobeattenuation
— sidelobe attenuation for chebyshev window
100
(default) | nonnegative scalar
sidelobe attenuation for the chebyshev window function in db, specified as a nonnegative scalar.
dependencies
to enable this property, set the spectralestimation
property to 'specify window
parameters'
and the window
property to
'chebyshev'
.
data types: double
frequencyresolution
— frequency resolution of spectral estimator
10625
(default) | numeric scalar
frequency resolution of the spectral estimator, specified as a numeric scalar.
if you set the
normalizedfrequency
property totrue
, specify the frequency resolution as a normalized value in the range [0, 1].if you set the
normalizedfrequency
property tofalse
, specify the frequency resolution in hz.
dependencies
to enable this property, set the spectralestimation
property to 'specify frequency
resolution'
.
data types: double
fftlength
— number of fft points
'next power of 2'
(default) | 'same as segment length'
| 'custom'
number of fast fourier transform (fft) points that the spectral estimator uses, specified as one of these values.
'next power of 2'
— the object sets the number of fft points to the next power of 2 that is greater thanmax(
.segmentlength
,256)'same as segment length'
— the object sets the number of fft points to the value of thesegmentlength
property.'custom'
— the object sets the number of fft points to the value of thecustomfftlength
property.
data types: char
| string
customfftlength
— custom number of fft points
256
(default) | positive integer
custom number of fft points, specified as a positive integer.
dependencies
to enable this property, set the fftlength
property
to 'custom'
.
data types: double
maxhold
— maximum-hold setting control
0
or false
(default) | 1
or true
maximum-hold setting control, specified as one of these logical values.
0
(false
) — the object obtains power measurements by using instantaneous power spectral density estimates.1
(true
) — the object obtains power measurements by comparing two vectors. one vector is the current estimated power spectral density vector (obtained with the current input data frame). the object checks this vector against the previous maximum-hold accumulated power spectral density vector (obtained at the previous call of the object). the object stores the maximum values at each frequency bin and uses these values to compute average power measurements. to clear the maximum-hold spectrum, use thereset
object function.
tunable: yes
data types: logical
| double
powerunits
— power measurement units
'dbm'
(default) | 'dbw'
| 'watts'
power measurement units, specified as one of these values.
'dbm'
or'dbw'
— the object returns acpr measurements in a dbc scale (the adjacent channel power referenced to the main channel power).'watts'
— the object returns acpr measurements in a linear scale.
data types: char
| string
mainchannelpoweroutputport
— option to enable main channel power measurement output
0
or false
(default) | 1
or true
option to enable main channel power measurement output, specified as a logical
0
(false
) or 1
(true
). when you set this property to true
, the
object returns the main channel power measurement. the main channel power is the power
of the input signal measured in the band specified by the mainchannelfrequency
and mainmeasurementbandwidth
properties. the object returns the power
measurements in the unit specified by the powerunits
property.
data types: logical
| double
adjacentchannelpoweroutputport
— option to enable adjacent channel power measurements output
0
or false
(default) | 1
or true
option to enable adjacent channel power measurements output, specified as a logical
0
(false
) or 1
(true
). when you set this property to true
, the
object returns a vector containing adjacent channel power measurements. the adjacent
channel powers correspond to the power of the input measured in the bands specified by
the adjacentchanneloffset
and adjacentmeasurementbandwidth
properties. the object returns the power
measurements in the unit specified by the powerunits
property.
data types: logical
| double
usage
syntax
description
measures the acpr in input data adjchpowratio
= acpr(signal
)signal
. the measurements are at the
frequency bands specified by the mainchannelfrequency
, mainmeasurementbandwidth
, adjacentchanneloffset
, and adjacentmeasurementbandwidth
properties.
[
measures the main channel power, adjchpowratio
,mainchpow
] = acpr(signal
)mainchpow
. to use this syntax, set
the mainchannelpoweroutputport
property to true
. the main
channel power is measured within the main channel frequency band specified by the
mainchannelfrequency
and mainmeasurementbandwidth
properties.
[
measures the adjacent channel powers, adjchpowratio
,adjchpow
] = acpr(signal
)adjchpow
. to use this syntax,
set the adjacentchannelpoweroutputport
property to true
. the
adjacent channel powers are measured at the adjacent frequency bands specified by the
adjacentchanneloffset
and adjacentmeasurementbandwidth
properties.
[
measures the acpr, the main channel power, and adjacent channel powers. to use this
syntax, set the adjchpowratio
,mainchpow
,adjchpow
] = acpr(signal
)mainchannelpoweroutputport
and adjacentchannelpoweroutputport
properties to true
.
input arguments
signal
— input signal
column vector of complex numbers
input signal, specified as a column vector of complex numbers.
data types: double
complex number support: yes
output arguments
adjchpowratio
— acpr measurements
numeric row vector
acpr measurements, returned as a numeric row vector. the length of the vector
equals the number of adjacent channels specified by the adjacentchanneloffset
property.
data types: double
mainchpow
— main channel power measurements
numeric scalar
main channel power measurements, returned as a numeric scalar. the powerunits
property specifies
the units used for the returned value.
data types: double
adjchpow
— adjacent channel power measurements
numeric row vector
adjacent channel power measurements, returned as a numeric row vector. the length
of the vector equals the number of adjacent channels specified by the adjacentchanneloffset
property. the powerunits
property specifies
the units used for the returned value.
data types: double
object functions
to use an object function, specify the
system object as the first input argument. for
example, to release system resources of a system object named obj
, use
this syntax:
release(obj)
common to all system objects
run system object algorithm | |
release resources and allow changes to system object property values and input characteristics | |
reset internal states of system object |
examples
measure acpr of 16-qam signal
generate data with an alphabet size of 16, and then modulate the data.
x = randi([0 15],5000,1); y = qammod(x,16);
upsample the data by using a rectangular pulse shape.
l = 8; ypulse = rectpulse(y,l);
create an acpr measurement object.
acpr = comm.acpr(... 'samplerate',3.84e6*8, ... 'mainchannelfrequency',0, ... 'mainmeasurementbandwidth',3.84e6, ... 'adjacentchanneloffset',[-5e6 5e6], ... 'adjacentmeasurementbandwidth',3.84e6, ... 'mainchannelpoweroutputport',true, ... 'adjacentchannelpoweroutputport',true);
measure the acpr, main channel power, and adjacent channel powers of the modulated signal.
[adjchpowratio,mainchpow,adjchpow] = acpr(ypulse)
adjchpowratio = 1×2
-14.3659 -14.3681
mainchpow = 38.8668
adjchpow = 1×2
24.5010 24.4988
algorithms
to comply with the nyquist sampling theorem, these conditions must be satisfied when you set the frequencies and measurement bandwidths of the main and adjacent channels.
if you set the normalizedfrequency
property to false
, , where is the sampling frequency specified by the samplerate
property.
if you set the normalizedfrequency
property to
true
, .
extended capabilities
c/c code generation
generate c and c code using matlab® coder™.
usage notes and limitations:
supports mex code generation. does not support code generation for standalone applications.
see (matlab coder).
version history
introduced in r2012a
打开示例
您曾对此示例进行过修改。是否要打开带有您的编辑的示例?
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
select a web site
choose a web site to get translated content where available and see local events and offers. based on your location, we recommend that you select: .
you can also select a web site from the following list:
how to get best site performance
select the china site (in chinese or english) for best site performance. other mathworks country sites are not optimized for visits from your location.
americas
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)