peak2rms
Peak-magnitude-to-RMS ratio
Description
Examples
Peak-Magnitude-to-RMS Ratio of Sinusoid
计算peak-magnitude-to-RMS ratio of a 100 Hz sinusoid sampled at 1 kHz.
t = 0:0.001:1-0.001; x = cos(2*pi*100*t); y = peak2rms(x)
y = 1.4142
Peak-Magnitude-to-RMS Ratio of Complex Exponential
Create a complex exponential with a frequency of rad/sample. Find the peak-magnitude-to-RMS ratio.
n = 0:99; x = exp(1j*pi/4*n); y = peak2rms(x)
y = 1
Peak-Magnitude-to-RMS Ratios of 2-D Matrix
Create a matrix in which each column is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the column index.
计算peak-magnitude-to-RMS ratios of the columns.
t = 0:0.001:1-0.001; x = cos(2*pi*100*t)'*(1:4); y = peak2rms(x)
y =1×41.4142 1.4142 1.4142 1.4142
Peak-Magnitude-to-RMS Ratios of 2-D Matrix Along Specified Dimension
Create a matrix in which each row is a 100 Hz sinusoid sampled at 1 kHz with a different amplitude. The amplitude is equal to the row index.
计算RMS levels of the rows, specifying the dimension equal to 2 with thedim
argument.
t = 0:0.001:1-0.001; x = (1:4)'*cos(2*pi*100*t); y = peak2rms(x,2)
y =4×11.4142 1.4142 1.4142 1.4142
Input Arguments
x
—Input array
vector|matrix|N-D array|gpuArray
object
Input signal, specified as a vector, matrix,N-D array, orgpuArray
object.
SeeRun MATLAB Functions on a GPU(Parallel Computing Toolbox) andGPU Support by Release(Parallel Computing Toolbox) for details ongpuArray
objects.
Data Types:double
|single
Complex Number Support:Yes
dim
—Dimension to operate along
正整数标量
Dimension to operate along, specified as a positive integer scalar. By default,peak2rms
operates along the first array dimension ofx
with size greater than 1. For example, ifx
is a row or column vector,y
is a real-valued scalar. Ifx
is anN-by-Mmatrix withN> 1,y
is a 1-by-Mrow vector containing the peak-magnitude-to-RMS levels of the columns ofy
.
Data Types:double
|single
Output Arguments
y
— Peak-magnitude-to-RMS-ratio
scalar | matrix |N-D array |gpuArray
object
Peak-magnitude-to-RMS ratio, specified as a real-valued scalar, matrix,N-D array, orgpuArray
object.
More About
Peak-Magnitude-to-RMS Ratio
The peak-magnitude-to-RMS ratio is
where theℓ-infinity norm and RMS values are computed along the specified dimension.
References
[1]IEEE®Standard on Transitions, Pulses, and Related Waveforms, IEEE Standard 181, 2003.
Extended Capabilities
Tall Arrays
Calculate with arrays that have more rows than fit in memory.
This function fully supports tall arrays. For more information, seeTall Arrays(MATLAB).
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, seeRun MATLAB Functions on a GPU(Parallel Computing Toolbox).
Introduced in R2012a
Open Example
A modified version of this example exists on your system. Do you want to open this version instead?
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)