メインコンテンツ

pow2db

パワーのデシベルへの変換

説明

ydb = pow2db(y) では y で指定されているパワー測定値をデシベル (dB) で表します。パワーとデシベルの関係は、ydb = 10 log10(y) です。

すべて折りたたむ

2π/3 ラジアン/サンプルの正規化周波数を持つ、ノイズを含んだ正弦波の 1024 サンプルを生成します。pwelch を使用して信号のパワー スペクトルを推定します。推定をデシベル単位で表し、プロットします。

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)')

Figure contains an axes object. The axes object with xlabel omega / pi, ylabel Power (dB) contains an object of type line.

出力引数なしで pwelch を使用して計算を繰り返します。

pwelch(x,'power')

Figure contains an axes object. The axes object with title Welch Power Spectrum Estimate, xlabel Normalized Frequency ( times pi rad/sample), ylabel Power (dB) contains an object of type line.

入力引数

すべて折りたたむ

入力配列。スカラー、ベクトル、行列、または N 次元配列として指定します。y が非スカラーの場合、pow2db は要素単位の演算になります。

データ型: single | double

出力引数

すべて折りたたむ

dB 単位でのパワー測定値。y と同じサイズのスカラー、ベクトル、行列、N 次元配列として返されます。

拡張機能

すべて展開する

C/C++ コード生成
MATLAB® Coder™ を使用して C および C++ コードを生成します。

GPU コード生成
GPU Coder™ を使用して NVIDIA® GPU のための CUDA® コードを生成します。

バージョン履歴

R2007b で導入

参考

| | |