You are here : matlabSignal Processingpow2db

pow2db() - Signal Processing

ydb = pow2db(y) expresses
in decibels (dB) the power measurements specified in y.
The relationship between power and decibels is ydb = 10 log10(y).


Syntax

ydb = pow2db(y) example


Example

Power Spectrum of a Noisy SinusoidOpen This ExampleGenerate 1024 samples of a noisy sinusoid having a normalized frequency of 
 rad/sample. Estimate the power spectrum of the signal using pwelch. Express the estimate in decibels and plot it.n = 0:1024-1;
x = cos(2*pi*n/3) + randn(size(n));

[pxx,w] = pwelch(x,'power');

dB = pow2db(pxx);

plot(w/pi,dB)
xlabel('\omega / \pi')
ylabel('Power (dB)')

Repeat the computation using pwelch without output arguments.pwelch(x,'power')


Output / Return Value


Limitations


Alternatives / See Also


Reference