Power conversion from mW to dBm?

Determine the power of a signal in dBm if absolute value is 100mW. Code:
u=100mW;
10*log10(u)+30
Could someone show the correct code for this conversion?

回答 (1 件)

Star Strider
Star Strider 2017 年 4 月 25 日
編集済み: Star Strider 2017 年 4 月 25 日

0 投票

That seems to be correct according to the Wikipedia article on dBm.
An anonymous function version is:
dBm = @(mW) 10*log10(mW); % dBm As A Function Of Power In milliWatts
EDIT Corrected units.

6 件のコメント

Randy Marsh
Randy Marsh 2017 年 4 月 25 日
Could you show an actual working code for finding the power of a signal in dBm if absolute value is 100mW?
If not, where can I find code sample for this conversion?
Randy Marsh
Randy Marsh 2017 年 4 月 25 日
編集済み: Randy Marsh 2017 年 4 月 25 日
I have figured it out:
u=100; %mW
solution = 10*log10(u)+30
Star Strider
Star Strider 2017 年 4 月 25 日
The inverse is also given in the Wikipedia article, although it wouldn’t be difficult to calculate:
dBm = @(mW) 10*log10(mW); % dBm As A Function Of Power In milliWatts
mW = @(dBm) 10.^(dBm/10); % mW As A Function Of dBm
NOTE According to the Wikipedia article, the units in my original Answer were in Watts, not mW, an error on my part in transcribing the wrong equation. I corrected it, and in this Comment. The units are now correct.
For units in Watts:
dBm = @(W) 30 + 10*log10(W); % dBm As A Function Of Power In Watts
W = @(dBm) 10.^((dBm-30)/10); % W As A Function Of Power In dBm
Randy Marsh
Randy Marsh 2017 年 4 月 26 日
So, is my code from the second post correct?
Randy Marsh
Randy Marsh 2017 年 4 月 26 日
u=100; %mW
solution = 10*log10(u)+30
I don't know if 'u' here is in 'mW' or in 'W'.
Star Strider
Star Strider 2017 年 4 月 26 日
Here ‘u’ is in W, according to the Wikipedia article.
My apologies for the delay — serious computer problems. Firefox no longer works on my Win 8.1 machine, and routinely crashes it, destroying my MATLAB configuration files as well.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeTest Model Components についてさらに検索

タグ

質問済み:

2017 年 4 月 25 日

コメント済み:

2017 年 4 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by