Update:- 12/04/2023

Consider a terminal connected to the Network at the Network Termination Point , NTP.

[terminal]---+---[ line ]---[exchange]
            NTP
			
What is the Zc of the Terminal?
What is the Zc of the Exchange?
What is the Z looking into the line towards the Exchange at the NTP?
What is the Z looking into the line towards the Terminal at the Exchange?

The NTP is nominally 2km from the Exchange.

Model Phone line hybrid loss,hybrid,line phone of a Telephone connection

This page calculates the End to End gains and sidetone gains.

The theory for this was formulated in a pre digital age. The end to end delay was minimal.

The delays introduced by digital time switches and packetization are a problem and this simulation suffers from "sub-sampling and aliasing". This makes the graphs more artistic!

Model Phone line hybrid loss,hybrid,line phone

4wire to 2 wire, line, 2 to 4 wire, time-switch delay, 4 wire to 2 wire, line 2 wire to 4 wire.
=}--{==L==}--{=

Calculate Mic to ear gains.
  M, E near Phone
  m, e far phone

Calculation [ A B C D ]:
      [M]=[A B][m]  ==>  [E]=[a b][M]
      [E] [C D][e]       [e] [c d][m] see paper for formulae}

Summary:=
// 1,z_complex_z)    Terminal Complex Impedance Network = 370+ 620//310nf
// 2,z_complex_znom) The nominal exchange input impedance is 300 ohm + 1000 ohm || 220 nF
// Balance Z not explictlty stated.

Connection being modelled:-
// Phone
/*
  This models the hybrid inputing 4 wire to 2 wire [ M ] = [   ] [V]
  see paper on loudness ratings                    [ E ]   [   ] [I]
*/
twoto4(z_complex_z.r,z_complex_z.i,   z_complex_znom.r,z_complex_znom.i );

lines( ll );

// exchange Hybrid
fourto2(z_complex_znom.r,z_complex_znom.i , z_complex_z.r,z_complex_z.i )

// Digital loss and delay
fwgains(rs.nflossr,rs.nflossi,rs.fnlossr,rs.fnlossi);

// exchange Hybrid
twoto4(z_complex_znom.r,z_complex_znom.i , z_complex_z.r,z_complex_z.i );

lines( ll );

//phone
fourto2(z_complex_z.r,z_complex_z.i,  z_complex_znom.r,z_complex_znom.i )

convert();
/*
{ This rotates the variables of a two by two matrix clockwise
  [M]=[  ][m]  ==>  [E]=[ ][M]
  [E] [  ][e]       [e] [ ][m] see paper for formulae}
*/
M, E near Phone
m, e far phone

Calculation [ A B C D ]:
      [M]=[A B][m]  ==>  [E]=[a b][M]
      [E] [C D][e]       [e] [c d][m] see paper for formulae}

Use a timer to sweep a variable.
Magintude in dB, against Frequency Hz :
Presets:-

Telephone line_Near length: km 0.1 km sections Animate Line length:
Telephone line_Far length: km 0.1 km sections Animate Line length:
Exchange "Time Switch" Delay: ms Animate Delay:
Exchange Loss: a to b dB
Exchange Loss: b to a dB

NOTE: The Graph "sub-samples" or "aliases" if the delay is greater than 10ms as the graph is plotted against freq, incrementing by 50Hz. 1/50Hz is 20ms , so the frequency should really be incremented with a fine step, the more delay.

The delays introduced by digital time switches and packetization are a problem and this simulation suffers from "sub-sampling and aliasing". This makes the graphs more artistic!

/*
  for ( var fr = 100 ; fr < 4000; fr +=50 ) {
    c=1
    // jitter the frequency used to show up aliasing.
    freq[c] = fr+Math.random(1)*2.0-1.0
*/

all:
e/m:
E/m:
e/M:
E/M:
Edit the source code to enter the phone and exchange data.

Notes on Z explained in SIN 351n Fiqure 1 and 2

Complex Z add exchange Z = 370+ 620//310nf [ :
// 1) Terminal Complex Impedance Network = 370+ 620//310nf
// 2) The nominal exchange input impedance is 300 ohm + 1000 ohm || 220 nF (see Figure 2) at the NTP.
// The NTP is nominally 2km from the Exchange.

Delay and the Wave equation.

This page calculates the End to End gains and sidetone gains.

The early theory for this page was forulated in a pre digital age.

The delays introduced by digital time switches and packetization are a problem.

However, it was a rule of thumb that transmission line effects needed to be considered when the lengths were greater than an 1/8th of a wavelength. It may be better to rephrase this in terms of delay and period. If the delay is greater than an 1/8 of a period, transmission line theory must be considered.

For an 8kHz sample rate, the period between samples is 125us. 1kHz has a period of 1ms.

A time switch used in digital exchanges needs at least 125us, and is more than likely a few multiples.

Delays of tens of ms are now typical. VoIP may have a 20ms buffer!

So we are well into the rule requiring us to consider transmission line effects and reflections must be minimised to prevent problems.

The Wave equation relates distance, frequency and speed.

http://www.bbc.co.uk/bitesize/intermediate2/physics/waves_and_optics/wave_equation/revision/1/
The Wave Equation

The wave equation is a very important equation that is often used to help us describe waves in more detail.

Wave Speed = Frequency x Wavelength

v = f x lambda

Where:

Wave speed is in metres per seconds (m/s or ms-1)

Frequency is in Hertz (Hz).

Wavelength is in metres (m).

NB:

It should be noted that some particular waves have their own specific speeds.
The speed of light and all of the EM spectrum is 300,000,000 m/s or 3x10^8 m/s.

The speed of sound in air is 340 m/s.

The speed of light and sound in materials will alter, please check very carefully at the front of the paper in the data sheet which speed to use.

The speed of VoIP signal. is dimension of phone divided by the buffer size. Say phone is ~10cm wide , delay 20ms, "velocity" = 0.01/0.020 = 1/2 m/s

Update:- 25/12/2023

added Line A-leg , B-leg