John's Vademecum

Try to learn something about everything, and everything about something -Thomas Huxley “Darwin's bulldog” (1824-1895)

User Tools

Site Tools


public:calculator:progs:dm32_progs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
public:calculator:progs:dm32_progs [24/07/23 17:10 BST] – [Return Loss & SWR from Complex Impedance] johnpublic:calculator:progs:dm32_progs [06/03/25 06:49 GMT] (current) – external edit 127.0.0.1
Line 20: Line 20:
 Once the real and imaginary values are on the stack various "Complex" functions are accessed by <key>SHIFT</key><key>CMPLX</key><key>Function</key> for example to add Once the real and imaginary values are on the stack various "Complex" functions are accessed by <key>SHIFT</key><key>CMPLX</key><key>Function</key> for example to add
  
-Z<sub>1</sub> = (10 + j20) and Z<sub>2</sub> = (30 - j25) Z<sub>3</sub>+Z<sub>1</sub> = (10 + j20)  
 + 
 +and 
 + 
 +Z<sub>2</sub> = (30 - j25) 
 + 
 +gives 
 + 
 +Z<sub>3</sub> = Z<sub>1</sub> + Z<sub>2</sub> = ( 10 + j20 ) + ( 30 - j25 )
  
 <code> <code>
Line 56: Line 64:
 X has the real part of Z<sub>3</sub> (40) and Y has the imaginary part of Z<sub>3</sub> (-5) X has the real part of Z<sub>3</sub> (40) and Y has the imaginary part of Z<sub>3</sub> (-5)
  
-Z<sub>3</sub> = 40 - j 5+Z<sub>3</sub>40 - j5 )
  
  
-===== Section Two =====+===== The program  ===== 
 + 
 +<code> 
 + 
 +LBL Z 
 +INPUT R 
 +INPUT X 
 +X<>      ; swap so Real is R and Imag is X 
 +
 +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    
 +
 +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 |ρ| 
 +
 +RCL+ P 
 +
 +RCL- P 
 +÷ 
 +STO S       ; store VSWR ( 1 + |ρ| ) / ( 1 - |ρ| )  
 +RCL P        
 +LOG 
 +20 
 +
 +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 
 + 
 +</code> 
 + 
 +=== Example === 
 + 
 +  * Z = 65.2 + j 17.7 
 +  * R = 65.2 
 +  * X = 17.7 
 + 
 +  * Results on stack: 
 + 
 +<code> 
 +67.5598 
 +0.2002 
 +1.5006 
 +-13.9718 
 +</code> 
 + 
 +  * |Z| = 67.6 ohms 
 +  * |ρ| = 0.2 
 +  * SWR = 1.5:1 
 +  * Return Loss = 13.9dB
  
  
public/calculator/progs/dm32_progs.1690215033.txt.gz · Last modified: 06/03/25 06:49 GMT (external edit)