Unit conversion dBm to dBuV and Vrms and vice versa

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
Post Reply
Kibabalu
Posts: 15
Joined: Sat Apr 03, 2021 2:36 pm

Unit conversion dBm to dBuV and Vrms and vice versa

Post by Kibabalu »

My old analog Rohde & Schwarz test receiver shows measurements in dBuV. But I'm used to 'think' in terms of dBm.
The conversion is not difficult, but annoying. Perfect reason for writing a program for my DM42 and free42 calculators.

A Similar situation with my spectrum analyser: Before I establish a connection I like to compute the Vrms on my 50Ohm input for the sended power in dBm. This to protect my spectrum analyzer for to high input voltages resp. to decide do I need DC blocker or do I need an attenuator or do I need no protection at all.

The following programs are doing the conversions for both cases in both directions.

Code: Select all

@ m2uV: dBm to dBuV Converter and vice versa
@
@ converting dBm to dBuV
@ 
@ dBuv = dBm + 90 + 20 * log(sqrt(Z0))
@ 
@ Frank Kirschbaum, frank.kirschbaum@gmail.com
@ 2021-04-10: Initial version
@
00 { 109-Byte Prgm }
01 LBL "m2uV"
02 MVAR "dBm"
03 MVAR "dBuV"
04 MVAR "Z0"
05 VARMENU "m2uV"

06 CF 21                @ continue programex ecution after a VIEW instruction
07 REALRES              @ calculate real results only
08 STOP
09 ASTO "CONTROL"       @ store the name of the unknown variable in CONTROL
10 PGMSLV ".m2uV"       @ specify solver routine
11 SOLVE IND "CONTROL"  @ Indirectly specify the variable to be solved
12 VIEW IND "CONTROL"   @ View the solution 
13 GTO "m2uV"           @ return to start

14 LBL ".m2uV"          @ function to solve
15 RCL "Z0"
16 SQRT
17 LOG
18 20
19 ×
20 90
21 +
22 RCL "dBm"
23 +
24 RCL- "dBuV"

25 END
and

Code: Select all

@ m2Vrms: dBm to VRMS Converter and vice versa
@
@ converting dBm to Vrms
@ 
@ V = 10^((dBm-30)/20)*sqrt(Z0) 
@
@ Frank Kirschbaum, frank.kirschbaum@gmail.com
@ 2021-04-10: Initial version
@
00 { 119-Byte Prgm }
01 LBL "m2Vrms"
02 MVAR "dBm"
03 MVAR "Vrms"
04 MVAR "Z0"
05 VARMENU "m2Vrms"

06 CF 21                @ continue programex ecution after a VIEW instruction
07 REALRES              @ calculate real results only
08 STOP
09 ASTO "CONTROL"       @ store the name of the unknown variable in CONTROL
10 PGMSLV ".m2Vrms"     @ specify solver routine
11 SOLVE IND "CONTROL"  @ Indirectly specify the variable to be solved
12 VIEW IND "CONTROL"   @ View the solution 
13 GTO "m2Vrms"         @ return to start

14 LBL ".m2Vrms"        @ function to solve
15 RCL "dBm"
16 30
17 -
18 20
19 ÷
20 10↑X
21 RCL "Z0"
22 SQRT
23 ×
24 RCL- "Vrms"

25 END
Last edited by Kibabalu on Tue Apr 13, 2021 7:12 pm, edited 1 time in total.
User avatar
grubi
Posts: 3
Joined: Tue Mar 23, 2021 4:55 pm
Location: Austria

Re: Unit conversion dBm to dBuV and Vrms and vice versa

Post by grubi »

Hi,
thanks for sharing.
I also wrote a program for dB conversion, but I didn't include any dbV conversion, since I never need(ed) it.
But I see that there still are some instruments showing dbuV.
The more interesting is that you finally taught me, how the VARMENU works!
Thanks to that I updated some of my programs.
Regards Michael
Kibabalu
Posts: 15
Joined: Sat Apr 03, 2021 2:36 pm

Re: Unit conversion dBm to dBuV and Vrms and vice versa

Post by Kibabalu »

Hi Grubi,

thank you for your feedback.

I have some of the programs from your github repository on my calculator. Thnx!

cu

Kibabalu
calc81
Posts: 1
Joined: Mon Feb 19, 2024 9:03 pm

Re: Unit conversion dBm to dBuV and Vrms and vice versa

Post by calc81 »

How can I change theses programs that it scows the numeric value and the unit like

10 dBm
50 Ohm
100 mV

instead of the ugly

Variable = value
R = 50

like Convert.raw (https://www.thecalculatorstore.com/Soft ... -for-HP42s)
User avatar
rudi
Posts: 415
Joined: Wed Nov 03, 2021 9:03 am
Location: Denmark
Contact:

Re: Unit conversion dBm to dBuV and Vrms and vice versa

Post by rudi »

Nice program - it is exactly for small tasks like this in our daily lifes, that the DM42 comes in handy!
/Rudi

DM-42 (s/n 06999), HP-42S, HP-35s, HP-11c, HP-32SII (ex HP-41CV, ex HP-75C, ex HP-48G + a lot, really lot of a accessories)
Denmark
Post Reply