Power Meter
Measure power of voltage signal
 Library:
DSP System Toolbox / Statistics
Description
The Power Meter block computes the power measurements of a voltage signal. The power measurements include average power, peak power, and peaktoaverage power ratio. The block uses the sliding window method to compute these measurements. For more details, see Algorithms.
Ports
Input
Port_1
— Input signal
vector  matrix
Specify the input signal in volts as a vector or a matrix. If
x
is a matrix, each column is treated as an independent
channel. The power measurement is computed along each channel using the Sliding Window Method.
Data Types: single
 double
Complex Number Support: Yes
Output
Avg
— Average power
vector  matrix
Average power of the voltage signal, returned as a vector or a matrix, and measured in the units determined by the Power units parameter. For details on how the block computes the average power, see Average Power.
Dependencies
To enable this port, set Measurement to
Average power
or All
.
Data Types: single
 double
Peak
— Peak power
vector  matrix
Peak power of the voltage signal, returned as a vector or a matrix, and measured in the units determined by the Power units parameter. For details on how the block computes the peak power, see Peak Power.
Dependencies
To enable this port, set Measurement to Peak
power
or All
.
Data Types: single
 double
PAPR
— Peaktoaverage power ratio
vector  matrix
Peaktoaverage power ratio of the voltage signal, returned as a vector or a matrix. For details on how the block computes the peaktoaverage power ratio, see PeaktoAverage Power Ratio.
Dependencies
To enable this port, set Measurement to
Peaktoaverage power ratio
or
All
.
Data Types: single
 double
Parameters
Measurement
— Desired power measurement
Average power
(default)  Peak power
 Peaktoaverage power ratio
 All
Specify the desired power measurement as one of the following:
Average power
(default)Peak power
Peaktoaverage power ratio
All
For details on how the block computes these measurements, see Algorithms.
Window length
— Window length
256
(default)  positive integer
Specify the window length over which the measurement is computed as a positive integer.
Reference load (ohms)
— Reference load in ohms
1
(default)  positive scalar in ohms
Specify the reference load that the power meter uses to compute power values as a real, positive scalar in ovohms.
Tunable: Yes
Output power units
— Units of measured power values
dBm
(default)  dBW
 Watts
Specify the units of the measured power values as one of the following:
dBm
dBW
Watts
Simulate using
— Type of simulation to run
Code generation
(default)  Interpreted execution
Specify the type of simulation to run as one of the following:
Code generation
–– Simulate model using generated C code. The first time you run a simulation, Simulink^{®} generates C code for the block. The C code is reused for subsequent simulations, as long as the model does not change. This option requires additional startup time but provides faster simulation speed thanInterpreted execution
.Interpreted execution
–– Simulate model using the MATLAB^{®} interpreter. This option shortens startup time but has slower simulation speed thanCode generation
.
Model Examples
Block Characteristics
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

Algorithms
Sliding Window Method
In the sliding window method, the power measurement is computed over a finite duration of the signal. The window length defines the length of the data over which the algorithm computes the power value. The window moves as the new data comes in. The output for each input sample is the measurement done over the current sample and the Len – 1 previous samples. Len is the length of the sliding window in samples. To compute the first Len – 1 outputs, when the window does not have enough data yet, the algorithm fills the window with zeros. As an example, to compute the average power when the second input sample comes in, the algorithm fills the window with Len – 2 zeros. The input signal x
is then the two data samples followed by Len – 2 zeros.
For a more detailed example, see Sliding Window Method.
If the window is large, the power computed is closer to the stationary power of the data. For data that does not change rapidly, use a long window to get a smoother measurement. For data that changes fast, use a smaller window.
Average Power
The average power of the voltage signal is computed using the Sliding Window Method and is given by the following equations:
$$AvgPowe{r}_{dBm}=10{\mathrm{log}}_{10}\left(\mathrm{movAvg}\left({\leftx\right}^{2}\right)/R\right)+30$$
$$AvgPowe{r}_{dBW}=10{\mathrm{log}}_{10}\left(\mathrm{movAvg}\left({\leftx\right}^{2}\right)/R\right)$$
$$AvgPowe{r}_{Watts}=\mathrm{movAvg}\left({\leftx\right}^{2}\right)/R$$
where,
x is the input voltage signal.
R is the reference load (in ohms) that is used to compute the power value.
movAvg
computes the moving average using the sliding window method. Thepowermeter
object in MATLAB uses thedsp.MovingAverage
object and the Power Meter block in Simulink uses the Moving Average block.
Peak Power
The peak power of the voltage signal is computed using the Sliding Window Method and is given by the following equations:
$$PeakPowe{r}_{dBm}=10{\mathrm{log}}_{10}\left(\mathrm{movMax}\left({\leftx\right}^{2}\right)/R\right)+30$$
$$PeakPowe{r}_{dBW}=10{\mathrm{log}}_{10}\left(\mathrm{movMax}\left({\leftx\right}^{2}\right)/R\right)$$
$$PeakPowe{r}_{Watts}=\mathrm{movMax}\left({\leftx\right}^{2}\right)/R$$
where,
x is the input voltage signal.
R is the reference load (in ohms) that is used to compute the power value.
movMax
computes the moving maximum using the sliding window method. Thepowermeter
object in MATLAB uses thedsp.MovingMaximum
object and the Power Meter block in Simulink uses the Moving Maximum block.
PeaktoAverage Power Ratio
The peaktoaverage power ratio of the voltage signal is computed using the Sliding Window Method and is given by the following equations:
$$pkAvgPw{r}_{dBm}=10{\mathrm{log}}_{10}\left(\mathrm{movMax}\left({\leftx\right}^{2}\right)/\mathrm{movAvg}\left({\leftx\right}^{2}\right)\right)$$
$$pkAvgPw{r}_{dBW}=10{\mathrm{log}}_{10}\left(\mathrm{movMax}\left({\leftx\right}^{2}\right)/\mathrm{movAvg}\left({\leftx\right}^{2}\right)\right)$$
$$pkAvgPw{r}_{Watts}=\mathrm{movMax}\left({\leftx\right}^{2}\right)/\mathrm{movAvg}\left({\leftx\right}^{2}\right)$$
where,
x is the input voltage signal.
movAvg
computes the moving average using the sliding window method. Thepowermeter
object in MATLAB uses thedsp.MovingAverage
object and the Power Meter block in Simulink uses the Moving Average block.movMax
computes the moving maximum using the sliding window method. Thepowermeter
object in MATLAB uses thedsp.MovingMaximum
object and the Power Meter block in Simulink uses the Moving Maximum block.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
See Also
Objects
Blocks
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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
 América Latina (Español)
 Canada (English)
 United States (English)
Europe
 Belgium (English)
 Denmark (English)
 Deutschland (Deutsch)
 España (Español)
 Finland (English)
 France (Français)
 Ireland (English)
 Italia (Italiano)
 Luxembourg (English)
 Netherlands (English)
 Norway (English)
 Österreich (Deutsch)
 Portugal (English)
 Sweden (English)
 Switzerland
 United Kingdom (English)