[Home]TelephonyHybridModel

HomePage | RecentChanges | Preferences | website home page

In about late 1983, I wanted to calculate the impedence looking into a telephone line and check our PABX telephone exchange, and I wrote a program for my NASCOM 2. It modelled the telephone connections used in the PSTN.

About 45 years ago, while at college, I brought my NASCOM 2 computer. It had 32K Ram and a 4Mhz Z80, and a 16x48 character display and was at home. BLS Pascal was available.

Recently, I updated the JavaScript? NASCOM2 to load BLS Pascal and some old pascal code from over 40 years ago.

https:/dev/nascom2/JavaScriptNascom2/jsnascom.html is a NASCOM 2 simulation in JavaScript?.

In about late 1983, I wanted to calculate the impedence looking into a telephone line and check our PABX telephone exchange.

At college, I did an electronics course, and we had a set of lectures on using ABCD matrices to model electronic circuits. This would allow Zin be calculated.

The GPO had a reasearch report from 1977:-

 [1] P K Webb Post Office Research Department Report 630, Computation of the Characteristics of Telephone Connections,1977.

This report is available from the online BT Archive:

https://www.digitalarchives.bt.com/CalmView/Record.aspx?src=CalmView.Catalog&id=BTA%2f3+BT1%2f11+RES%2fRES10%2f15%2f630&pos=16

Title: Computation of the Characteristics of Telephone Connections Finding number: TCC 23/630

It had this matrix:-

A Challenge! Could I write a program to use ABCD parameters and calculate the impedence presented to the phone line?

It was possible to build up a list of ABCD matrices using:-

 [R] := [R][N]

Pascal code:-

 VAR
  ar,ai,br,bi,cr,ci,dr,di,{temp   ABCD matrix}
  rar,rai,rbr,rbi,rcr,rci,rdr,rdi,{result ABCD matrix - an accumulator}
  nar,nai,nbr,nbi,ncr,nci,ndr,ndi,{next   ABCD matrix - see MULTMAT}
  w :real;

 PROCEDURE multmat(nar,nai,nbr,nbi,ncr,nci,ndr,ndi:REAL);
 {multiplies the complex two by two matries [r]:=[r]*[n]}
 BEGIN
  ar:=rar;ai:=rai;
  br:=rbr;bi:=rbi;
  cr:=rcr;ci:=rci;
  dr:=rdr;di:=rdi;

  rar:=ar*nar-ai*nai+br*ncr-bi*nci;
  rai:=ar*nai+ai*nar+br*nci+bi*ncr;

  rbr:=ar*nbr-ai*nbi+br*ndr-bi*ndi;
  rbi:=ar*nbi+ai*nbr+br*ndi+bi*ndr;

  rcr:=cr*nar-ci*nai+dr*ncr-di*nci;
  rci:=cr*nai+ci*nar+dr*nci+di*ncr;

  rdr:=cr*nbr-ci*nbi+dr*ndr-di*ndi;
  rdi:=cr*nbi+ci*nbr+dr*ndi+di*ndr;

 END;  {multmat}

After a long time, I worked out that I could model the Telephone Hybrid as a matrix so could use multmat() to chain an end to end connection, like building bricks.

https:/www/dougnapTheory/index.htm and https:/www/dougnapTheory/indexFurtherNotes.htm

Exchange:-

  [ hybrid ] [ 4 wire gain/losses ] [ hybrid ]

End to end:-

  [ Phone ] [ line ] [ Telephone Exchange  ] [ line ] [ phone ]

  [ Phone ] [ line ] [ hybrid ] [ 4 wire gain loss delay ][ hybrid ] [ line ] [ phone ]

Telephone Exchange:

Idea Phone:-

Phone / Hybrid Matrix:-

Use convert() a few times to get the required ratio.

or:-

converts to

Phone Line, 0.1km segments:

 [c][r][c]

 multy( 0    , w*2.5E-9)
 multz( 16.8 , 0 )
 multy( 0    , w*2.5E-9)

I could have appended a 0.1km segment, up to lineLength*10 times.

To speed it up and reduce rounding errors, I conditionally added [0.1km] *2^n

Build up using Double and Conditional add / successsive approximation,

Convert lineLength*10 to binary integer. Conditionally add [0.1km]*2^n

  [ A ] := [ R ]   // accumulator
  [ R ] := [ C ][ R ][ C ]    // init 0.1km segment 

  then work out [ R ] :=[ R ] * [ R ] to get [ R ]*1, [ R ]*2 , [ R ]*4,  [ R ]*8,  [ R ]*16,  [ R ]*32,  [ R ]*64  

  while  ( lineLength > 0 ) {
    if ( ( lineLen & 1 ) >0 ) { // test LSB and conditionally append [ R ] *2^n
       [ A ] := [ A ][ R ] 
    }
    [ R ]:=[ R ][ R ]         // to give 0.1km, 0.2km, 0.4km, 0.8km, 1.6km, 3.2km, 6.4km...
    lineLength := lineLength DIV 2 
  }
  [ R ] :=[ A]

Artificial Line boxes use a similar technique using switches, switching in 2^n lengths of line.

These were reasonably easy to code up on the NASCOM 2 using pascal.

Computing Resources - Use my NASCOM 2

In 1983, at work, there was a microprocessor developement system, a terminal you could log onto a remoter computer and use Fortran, and manuals that were 2 miles from where I worked.

We could also log on to a remote computer at the GPO who had a program called CATNAP that could model telephone connections and check our PABX design.

At home, I had a NASCOM 2 Z80 based computer with 32K of RAM. Using BASIC would have been a challenge.

BLS Pascal was available, and later on Turbo Pascal was available for CP/M and the IBM XT.

So I worked out I could multiply the ABCD matrices using Pascal. multmat() and ADCD theory could be used.

I can now download BLS Pascal for the NASCOM2 and run it.

https:/dev/nascom2/JavaScriptNascom2/jsnascom.html can load BLS pascal and some pascal to calculate ABCD matrices.

So BLS pascal became Turbo Pascal and then Delphi . I brought Turbo Pascal for CP/M and Turbo Pascal 6.0 for the PC.

Using the examples on these pages, I can chain matrices together.

https:/www/dougnapTheory/index20080620_210434.htm - some simple notes

https:/www/dougnapTheory/index.htm

https:/www/dougnapTheory/indexFurtherNotes.htm

It is possible to run Turbo Pascal 3.0 in DosBox? and use more modern editors.

ABCD matrice notes :- https://www.njohnson.co.uk/index.php?menu=2&submenu=2&subsubmenu=14 has some theory on ABCD matrices.

In 2009 I ported the Turbo Pascal code to JavaScript?

In about 2009 , I ported some of the code from Turbo Pascal to JavaScript?, so I could run it in the web browser.

https:/www/dougnapTheory/flot/a_artline.htm

FLOT was used to plot graphs, and the JavaScript? could animate calculations.

Later on I tried using the HTML Canvas and JavaScript? to see if I could plot some of the Complex Z used

https:/www/dougnapTheory/graph1sampleZ.htm can be used to plot the Z

Work out Zin for Line at different lengths and terminated by Zc and plot them:

I added some curves of Z+lengths of line. It was explained to me that Zb was picked to minimise side tone at the longer line lengths.

In the plot below, the RED line morphs to the GREEN line as more telephone line is added. The dark blue line is Zso the impedence for minimum sidetone.

https:/www/dougnapTheory/graph1sampleZandFilterMatrix.htm can be used to plot the Z+PhoneLine?

People talk softer if they hear their own voice as sidetone.

People talk louder if they cannot hear their sidetone.

Also, people hear their own voice via their jaw bone, so there is no need to minimise sidetone at these frequencies.

Conclusion

As a retro Computing activity, could I load the code into BLS pascal, on Tommy Thorn's JavaScript? NASCOM2?

Auto Typing the code was complicated by the keyboard layout.

Recently, I modified the Nascom2 simultator to load BLS pascal, DMA source code into memory and run some Pascal code from over 40 years ago!

https:/dev/nascom2/JavaScriptNascom2/jsnascom.html can load BLS pascal and some pascal to calculate ABCD matrices.

The model was useful in the late 1970's. Nowdays, the VoIP? delays across the exchange are much more. The loss across the exchange was increased from 3dB to 6dB.

Zc is Zc +/- the reflected Far end signal , which is -12 dB or more.

An understanding of Smith Charts would have probably been enough!

Soon, 2 wire telephone will be relegated , when the PSTN is turned off.

All part of the Retro Computer Hobby.


HomePage | RecentChanges | Preferences | website home page
This page is read-only | View other revisions
Last edited 2026-10-08 5:52 pm by dougrice.plus.com (diff)
Search:
home page