Quote:

Objective: To develop a C Program to calculate components of matching

attenuators.

Introduction: You are to develop a C program to help design resistive attenuation and matching

pads for a telephone line. Generally, telephone lines and electronic equipment need to be matched to

their source and loads to avoid reflection of the signals. Attenuators are used to reduce the level of

large signals that need to be fed to a more sensitive circuit.

Theory:

The two types of attenuator are Tee and Pi. Both are used extensively.

There are two types of each, balanced and unbalanced. Unbalanced type use a

Common earthed return, while balanced types do not.

The Tee arrangement can be used in its unbalanced form, or its balanced form

(Sometimes known as a balanced H network).

Figure 1: Tee Networks with equations.

Figure 2: Pi Network with equations.

Figure 3: Minimum Loss Pad.

Z1 is the impedance seen looking into the network, while Z2 is the impedance seen

looking into the output. So if the source (generator) has an output impedance of 600

And the load has an impedance of 75then the network will be arranged to have

Z1=600, and Z2=75.

Since the networks are all designed to introduce a loss (expressed in dB or Decibels)

then this is used, with the Z1, Z2 values to calculate the resistor values.

Task:

What you have to do is develop a program to ask the user what kind of

network she/he wants, what the input and output impedance's are to be, and what the loss is. The program should then calculate the value of the resistance values and display them, along with the other network parameters. You might like to start by designing the program for the Tee network first. Then go on to develop the Pi network. Test each as you develop it to avoid having a lot of error to deal with at one time. Finally, the program askes the user if they want to save the design to a file. This involves saving the resistor values, input and output impedances, and attenuator loss information to a file. Hint: Use a C struct for this so as to keep all the data together. You will need to do some research to complete this part of the assignment.

The complete program can be developed as a menu program with an option to terminate the program, or perform another calculation.

Test Case example:

Test Case 1: If Z1=600 ohms, Z2=900 ohms, an unbalanced Tee with a loss of 15db would have the following resistor values. R1=369.29 ohms, R2=688.89 ohms,

R3=269.88 ohms.

For other test cases, check your results by comparing with hand calculations.