### Table of Contents

# DM32 Progs

** Description **

## Return Loss & SWR from Complex Impedance

Input Rs and Xs to calculate |z|, |ρ|, VSWR and R.Loss

#### Complex numbers in DM32

The DM32/HP31Sii handles complex numbers by treating stack-X as *Real*, stack-Y and *Imaginary* for one complex number, and stack-Z as *Real* and stack-T as *Imaginary* for a second complex number.

This means the normal 4 level stack can hold 2 complex numbers. This is similar to the HP41 Advantage Pack's method.

To store a complex number in a register actually requires two to be used - one for Real part and one for Imaginary part. This is similar to the HP15C/DM15L.

Once the real and imaginary values are on the stack various “Complex” functions are accessed by `SHIFT``CMPLX``Function` for example to add

Z_{1} = (10 + j20)

and

Z_{2} = (30 - j25)

gives

Z_{3} = Z_{1} + Z_{2} = ( 10 + j20 ) + ( 30 - j25 )

20 ENTER 10 ENTER 25 CHS ENTER 30

The stack will show

20.0000 10.0000 -25.0000 30.0000

Then carry out the addition

SHIFT CMPLX +

The display will show

20.0000 10.0000 -5.0000 40.0000

X has the real part of Z_{3} (40) and Y has the imaginary part of Z_{3} (-5)

Z_{3} = ( 40 - j5 )

## The program

LBL Z INPUT R INPUT X X<>Y ; swap so Real is R and Imag is X 0 ENTER 50 ; enter Zo as 50 + j 0 CMPLX + ; complex addition Z + Zo STO A ; store intermediate value Re (Z + Zo) R↓ STO B ; store intermediate value Im (Z + Zo) R↓ ; X and Y stack now holds input Z real & imag again 0 ENTER 50 ; enter Zo as 50 + j 0 (again) CMPLX - ; complex subtraction Z - Zo RCL B ; Im (Z + Zo) RCL A ; Re (Z + Zo) CMPLX ÷ ; complex divide (STACK z,t holds (Z - Zo) stack x,y holds (Z + Zo) (from reg. A & B) to calculate complex reflection coeff. ρ STO E ; save Re ρ R↓ STO F ; save Im ρ RCL E y,x -> θ, r ; convert complex rectangular ρ to mag/angle - X holds the magnitude |ρ| ( Y holds the angle, but we don't care) STO P ; save |ρ| 1 RCL+ P 1 RCL- P ÷ STO S ; store VSWR ( 1 + |ρ| ) / ( 1 - |ρ| ) RCL P LOG 20 X STO Y ; store Return Loss = 20 LOG |ρ| RCL X RCL R y,x -> θ, r STO Z ; store magnitude of impedance |z| RCL P ; |ρ| RCL S ; VSWR RCL Y ; Return Loss RTN

#### Example

- Z = 65.2 + j 17.7
- R = 65.2
- X = 17.7

- Results on stack:

67.5598 0.2002 1.5006 -13.9718

- |Z| = 67.6 ohms
- |ρ| = 0.2
- SWR = 1.5:1
- Return Loss = 13.9dB

— *John Pumford-Green 19/07/23 06:08*