The objective of the experiment was to design a simple and elegant pre-emphasis circuit to counteract the effects of an unknown filter inside a black box. This circuit potentially consisted of a combination of passive components such as resistors, capacitors and inductors. This unknown filter produced an output which was used to determine the filter's frequency response and the subsequent frequency response required by the pre-emphasis circuit.
The frequency response of the black box was determined by conducting a frequency sweep from 15 Hz to 20 kHz, then recording gain and phase shift information in a table. From this data, a Bode plot was created and it was observed that the unknown black box had the frequency response of a low pass filter, with the transfer function , where p and z are the poles and zeros of the filter respectively. To reverse the effects of the black box, the transfer function of the high pass filter was determined to be the inverse of that of the low pass filter, , in order to return the signal back to its original state. The pre-emphasis circuit to be designed was therefore found to be a high pass filter.
The desired circuit was designed using AC analysis and basic filter theory, and was tested both by simulation in LTSpice (using ideal components) and in the laboratory to test the circuit with the limitations associated with practical components. In both testing situations, a 10V peak-to-peak sinusoidal wave was used as the input signal. The final circuit design consisted of a basic RC filter followed by two non-inverting operational amplifiers used as voltage followers in order to manipulate the gain of the signal. The limitations associated with practical operational amplifiers deemed the filter inaccurate at higher frequencies due to the bandwidth and slew rate of the LM741 operational amplifier.
Table of Contents
Introduction
Pre-emphasis circuits are designed to shape a signal prior to it being sent to an output source to compensate for distortions the input signal may introduce (Azulykit, 2007). The following report will outline the knowledge, development, design and the steps taken in developing a pre-emphasis circuit capable of reversing the distortion effect of an unknown circuit, known as a 'black box'. This experiment began with the random selection of a black box which for the purpose of this report is number 23.
The black box consists of a mixture of passive components (resistors, capacitors, inductors) in an unknown circuit combination. In order to develop this pre-emphasis circuit, a frequency response of the unknown black box circuit is conducted to determine how both the phase and gain of the output is dependent on the sinusoidal input.
These processes to develop a final circuit capable of reversing the effects of the unknown black box will be presented in the following sections of the report as follows: background information on frequency response, filters and operational amplifiers; the design solutions and the multiple attempts required to complete this task; and finally a discussion which relates these results back to the theory.
3.0 Background
3.1 Frequency response
3.1.1 Gain
Gain is defined as the ratio of the amplitudes of the input and output sinusoids of a circuit (textbook) (see E3.2.1).
[E3.2.1]
3.1.2 Phase Shift
The phase shift of a circuit is the difference in phase angles between the input and output sinusoids (Svboda and Dorf, 2010). If the angle of the input signal is to be taken as 0o, the phase shift between two signals can be easily calculated (see E3.2.2).
[E3.2.2]
If the phase shift is positive, the output signal is said to be 'leading' with respect to the input signal. If negative, the output signal is 'lagging' (Svboda and Dorf, 2010).
3.1.3 Network functions
The network function of a system (H(ï·)) describes how the behaviour of a circuit is dependent on the frequency of the input, by determining the ratio of the phasor corresponding to the output sinusoid (Y(ï·)) to the phasor corresponding to the input (X(ï·)), defined in the frequency domain (see E3.2.3) (Svboda and Dorf, 2010). This function is also called the 'transfer function' of a circuit.
[E.3.2.3]
3.2 Filters
A filter is a circuit that can be used to eliminate unwanted factors such as noise from an electrical signal (Svboda and Dorf, 2010). A common use for filters is to take advantage of their different responses at particular frequencies. Some different filter types are discussed in the following sections.
One property of filters is the cutoff frequency (ï·c), which is the frequency of the signal at which the ratio of the output and input signals has a magnitude of (or 0.707). This can be found by determining the point at which the Bode plot of the filter reaches 3dB (20log10(ï·c)). The cutoff frequency determines the frequency at which the amount of attenuation due to the filter begins to increase (Dynamic Systems, 2005).
3.2.1 Low pass filters
Low pass filters are designed to pass signals of lower frequencies, while attenuating higher frequencies. The cutoff between these two levels of attenuation is defined by the cutoff frequency. The transfer function of a low pass filter can be seen in E3.3.1 below.
[E3.3.1]
In the above transfer function, z is the 'zero' of the filter and p is defined as the 'pole'. These can be determined by graphing a -20dB/decade line over the filter's Bode plot. The point at which this slope crosses the upper and lower limits of the Bode plot dictates the poles and zeros respectively.
3.2.2 High pass filters
High pass filters oppose in function to low pass filters, passing higher frequency signals while attenuating lower frequencies. The transfer function of a high pass filter is therefore the inverse of that of a low pass filter, as can be seen in E3.3.2.
[E3.3.2]
3.2.3 Combining filters
V2(ï·)
Vo(ï·)
Vi(ï·)
H2(ï·)
H1(ï·)When two filters are connected in series, their transfer functions are multiplied to obtain a new transfer function, as can be seen in Figure 3.3.3-1 and 3.3.3-2. The new transfer function is therefore H(ï·) = H1(ï·)H2(ï·).
Vi(ï·)
Vo(ï·)
H1(ï·)H2(ï·)Figure 3.2.3-1 - Two filters before combination
Figure 3.2.3 - Combination resulting in multiplication of transfer functions
3.2.4 Passive and active filters
There are two different styles of filter that can be used, depending on the limitations of the circuit and the characteristics required.
An active filter makes use of an active device, such as an operational amplifier, along with passive components such as resistors and capacitors. The following lists the characteristics of an active filter:
No inductors used
High input impedance, low output impedance
Load is isolated from the frequency determine network - variation in load therefore does not affect the filter
Adjustment of gain and cutoff frequency is possible
Variation in power supply voltage affects the output voltage (Zafar, 2011)
A passive filter, however, is a little less adjustable in comparison to the active filter, using only passive components such as resistors, capacitors and inductors. The following lists its characteristics:
Low input impedance, high output impedance (cannot drive low impedance load)
Load is not isolated - variation my affect the filter's characteristics
Alteration to gain not possible (Zafar, 2011)
3.3 Characteristics of ideal operational amplifiers
3.3.1 Gain and impedance
The ideal operational amplifier has characteristics that are modeled under ideal conditions, including:
Infinite voltage gain
Infinite input impedance
Zero output impedance
Zero input offset voltage
Infinite bandwidth (Svboda and Dorf, 2010)
However, in practice these properties will not always hold, altering (and sometimes limiting) the functionality of the operational amplifier. This will be discussed in later sections.
3.3.2 Bandwidth
An ideal operational amplifier has an infinite bandwidth, meaning that the device can amplify signals of any frequency from DC to AC (has an infinite frequency response). In practice however, the bandwidth is limited by the Gain Bandwidth Product (GB). An operational amplifier's GB is equal to the frequency at which the gain becomes unity (Storr, 2012).
3.3.3 Slew rate
The slew rate of an operational amplifier is defined as the 'rate at which the output voltage can change' (HyperPhysics, 2000). The slew rate of the LM741 is 0.5V/ïs, compared to a high speed operational amplifier's slew rate of 100V/ïs. At the cutoff frequency, an output swing will require a slew rate faster than the maximum slew rate of the device. Therefore the higher the cutoff frequency of the device, the less limited the amplitude of the distortion-free output voltage swing will be.
4.0 Design Solution
4.1 Black Box
4.1.1 Experimental Method - Black Box
The black box (with setup shown in Figure 4.1.1) was connected to a function generator on the input terminal. This was also grounded via the ground terminal of the black box. Channel 1 of the oscilloscope was connected to the input terminal, while Channel 2 of the oscilloscope was connected to the output terminal. Both channels were grounded.
Figure 4.1.1 - Black Box 23
The function generator was set to generate a 10V peak-to-peak sinusoidal wave, acting as the initial input signal into the black box. The frequency was set to a low 15 Hz, and measurements were taken of the input/output voltages and the phase differences between the two signals. All measurements were conducted using the oscilloscope to improve accuracy.
A frequency sweep was undertaken between the ranges of 15 Hz and 20 kHz, with the recorded values tabulated in an Excel spread sheet accordingly with matching frequencies. These results can be found in A1.1.
4.1.2 Experimental Results - Black Box
The tabulated data was now used to generate plots of both the phase and gain with respect to angular velocity (ω). Angular velocity was calculated using equation E4.1.2-1 below.
[E4.1.2-1]
Analysis of the graphs (found in A1.2-A1.3) confirmed that there was a single pole and zero for this particular black box. Using this information, it was possible to determine a transfer function as per Section 3.1.3. The general equation allowed a theoretical curve to be fitted to the bode plot. This theoretical function was achieved through the manipulation of both the pole and zero values. This task was completed using Excel; however alternative graphing studios may have been more appropriate.
From this theoretical model, it was determined that the transfer function of the black box was that found in equation E4.1.2-2 (where k is the DC gain).
[E4.1.2-2]
As the experimental showed the filter to have no gain, k can be taken as one. This shows the black box to be a combination of elements forming a low pass filter. As it was required that the input signal had to equal the output signal of the pre-emphasis circuit, using the combination of transfer functions theory (found in Section 3.2.3) it can be seen that Vo = Vin, so therefore . It was hence noted that the output signal (and its transfer function) must be the inverse of the input signal. The resulting transfer function of the pre-emphasis circuit can be seen in E4.1.2-3 below.
[E4.1.2-3]
The transfer function above forms a high pass filter, which will be designed in the following sections.
4.2 Text book circuit
4.2.1 Circuit design - Text book circuit
Figure 4.2.1 - Text book circuit to reverse the black box
This circuit was taken from p622 of the textbook due to its transfer function being in the same style as calculated in Section 4.1.3. Resistor and capacitor values were also calculated using the formulas on this page (Svboda and Dorf, 2010).
4.2.2 Experimental Method - Text book circuit
Given a potential circuit capable of reversing the effects of the black box had been designed, it was then tested. Constructed using the necessary resistor and capacitor values shown in Figure 4.2.1 above, the circuit was built on the breadboard while ±15V was supplied to the op amp through voltage rails.
The black box was connected to the function generator as in Section 4.1.1 and grounded as necessary. The output from the black box was then connected to the breadboard acting as the input signal to the reversing circuit. Channel 1 of the oscilloscope was connected to the input of the black box, while Channel 2 was connected to the output of the operational amplifier.
A frequency sweep was conducted from 15 Hz to 20 kHz. These values were not tabulated due to errors which will be discussed in Section 4.2.3.
4.2.3 Experimental Results - Text book circuit
From the initial trial of this circuit, it was clear almost instantly that there were several issues with this design. With an approximate gain of 0.1 for the entire frequency sweep, it was apparent that there was an issue with the magnitude of the output gain. The phase shift, however, appeared to be accurate for the entire sweep, ranging between approximately -4° and +7° from 15 Hz and 20 kHz.
In an attempt to counteract the decrease in gain, the ratio between resistors R1 and R2 was altered. After applying this correction to the circuit with no success, the circuit was disconnected from the black box and connected directly to the function generator. No numerical results were recorded from this experiment - observations however, were recorded throughout the process.
A frequency sweep of the supposed correcting circuit alone yielded that the circuit was behaving as a low pass filter. More manipulation of the circuit occurred including the reversal of the capacitor values which should have switched the circuit from a low pass to a high pass filter. However for an unknown reason, this again had no effect on the output and did not change the circuit to what was meant to be a high pass filter. No explanation for this could be determined, so it was decided that a new approach had to be taken in the design of a suitable high pass filter.
4.3 Initial circuit
4.3.1 Circuit design - Initial circuit
Figure 4.3.1 - Initial design circuit
Voltage followers are used in filter design when the input or output is required to stay at a specific value (Littlewats, 2012). It was decided that a voltage follower was needed in the design of the high pass filter so that the gain coming out of the black box could be easily controlled before being filtered due to the voltage follower's isolation in the circuit. The transfer function of the initial circuit can be found in E4.3.1 below.
[E4.3.1]
A non-inverting amplifier was added after the follower as to allow for gain at high frequencies. Gain at lower frequencies was addressed by the capacitors connected to the input, however due to the very small capacitance, at high frequencies this effect became insignificant. After simulation in LTSpice, resistor values were found.
4.3.2 Experimental Method - Initial circuit
The experimental method was identical to that of the textbook circuit, however using a different circuit design (as per Figure 4.3.1 above). Channel 1 of the oscilloscope was once again connected to the input of the black box, while Channel 2 was connected to the output of the second operational amplifier.
4.3.3 Experimental Results - Initial circuit
Following the frequency sweep of the initial circuit, it was again clear that the issues with gain had not been properly addressed. While the phase was still deemed to have been corrected due to the circuit, the gain was still small, approximately 0.1. This appeared to be very similar to the circuit tested in the week before and the remainder of the session was dedicated to attempting to troubleshoot the circuit. No results were taken, however observations of the gain increasing with larger frequencies were noted. The gain ranged from 0.6 to 0.65, still not adequate enough for the requirements. This will be discussed more in Section 5.
The experimental results showed that this filter design behaved more like a band stop filter rather than the required high pass filter, attenuating signals in a certain range will still passing signals of higher and lower frequencies. As stated in the experimental results, the gain issue had still not been corrected, even after countless simulations in LTSpice.
4.4 Final circuit
4.3.1 Circuit design - Final circuit
Figure 4.4.1 - Final design circuit
As seen in Figure 4.4.1, a general RC circuit was implemented at the start of the circuit as to create an initial frequency response, close to what was required, that could be easily corrected by the non-inverting amplifier configuration seen above. It was found that if the operational amplifiers were positioned before the filter, the 15V supplied to them would not be sufficient at lower frequencies. The gain created by U1 and U2 (the two operational amplifiers) was calculated by taken the inverse of the low frequency gain as given by the transfer function (see E4.4.1-1) (see A2.1 for derivation).
[E4.4.1-1]
The values of R1 and R2 were calculated using the circuit's cutoff frequency (as calculated by inverting the gain plot for the low pass filter). The low frequency gain as seen above is where 0.068-1 = 14.6. This implies that each operational amplifier is to have a gain of , giving R3 = R5 = 4.7k- and R4 = R6 = 13.26k-, using the non-inverting gain formula shown in E4.4.1-2.
[E4.4.1-2]
4.3.2 Experimental Method - Final circuit
The final circuit design was constructed using the necessary resistor and capacitor values shown in Figure 4.4.1 above. The circuit was built on the breadboard while ±15V was supplied to the two operational amplifiers.
The black box was connected to the function generator as before and grounded as necessary. The output from the black box was connected to the breadboard acting as the input to the reversing circuit. Channel 1 of the oscilloscope was connected to the input of the black box, while Channel 2 was connected to the output of the second operational amplifier.
A frequency sweep was conducted from 15 Hz to 20 kHz to determine if the circuit produced accurate results. Upon the conclusion of this sweep, it was determined that the results seemed accurate.
Measurements were then taken of frequencies over the 15 Hz to 20 kHz scale. These results were tabulated and graphed and can be located in A2.1-A2.3.
4.3.3 Experimental Results - Final circuit
By observation of the data and graphs found in A2.1-2.3 in comparison with the theoretical data, it can be seen that this final circuit amended the prior issues of attenuated signals in the wrong frequency bands. It could be seen on the oscilloscope the two waveforms were very similar and most of the time appeared identical. Once measurements were taken, it became apparent that this filter circuit adequately corrected the unknown circuit found inside the black box. The average phase shift across all frequencies was found to be only -2.5°, however excluding the last three points, this average is 1.8o. The most accurate shift was -0.2° at 2.4 kHz. It was noticed however that at significantly higher frequencies the change in phase angle changed suddenly to just over -11°. It is possible this measurement is due to human error.
The gain across the frequency sweep was found to be highly accurate. The average gain across the entire sweep was 0.97, compared to the preferred gain of one. It can be seen in the results in A2.1-2.3 that the gain reduced to 0.94 around the frequencies of 140 Hz to 400 Hz. Either side of this slump, the gain increased towards one, and at times had a gain of exactly one in the range of 2 kHz to 10 kHz.
5.0 Discussion
5.1 Relationship between results and theory
After completing the final experiment and analysis of the subsequent data, it was determined that the theory discussed in both section 3 and 4 accurately represented the results. The theoretical approximation for the transfer function of the final circuit (without the black box) was very accurate. Appendix A2.2 shows that the theoretical data for the gain peaks at a higher value than that of the experimental data for some values higher than 1000 rad/s (approximately 160 Hz). This accounts for the very small discrepancies in the overall gain found in Appendix A3.2. It was noted however that at certain frequencies, the accuracy was infringed due to limitations of individual components. Calculating the exact effect of these components is very difficult for use in the theoretical model, and was therefore ignored.
5.2 Effectiveness of design
All circuits used in this experiment were designed to be as simple as feasibly possible, while still maintaining operational effectiveness. The text book circuit which was initially trialled was a very simple circuit and elegant circuit. This however did not effectively reverse the effects of the black box. The initial circuit encountered much similar circumstances to that of the text book circuit, however at higher frequencies, gain did appear to be partially increasing. The final circuit, although not entirely simple, was still elegant and produced accurate results. At higher frequencies, it became apparent that the phase shift accuracy was poor, which will be discussed in Section 5.3. For the majority however, the pre-emphasis circuit designed to reverse the effects of the black box circuit was highly effective at frequencies lower that 12 kHz, obtained from the graph in Appendix A2.3.
5.3 Design limitations
The main limitations in the final design were due to the slew rate and Gain Bandwidth (GB) of the op amps, as well as the tolerance of the capacitors and resistors used. Limitations of the slew rate within the operational amplifier can be observed at higher frequencies. Given the slew rate of the LM741 is 0.5V/µs, it was observed that at much higher frequencies, the standard sinusoidal wave became distorted in shape. This effect was progressively worse as frequency continued to increase.
As can be seen in Appendix A2.3, the accuracy of the phase of the circuit deteriorated at higher frequencies due to GB. As can be determined from the graph, this appeared to occur at approximately 12 kHz.
Finally, the potential errors in the resistors and capacitors used could affect the final circuit design. Generally, all components come with an error tolerance between ±5% of the specified value of that particular component. Although the values may not excessively different, they could significantly impede the desired effects from the circuit.
5.4 Improvements to experimental procedure
Due to the limited time available in the laboratory, the circuit design was not tested with a wider range of voltage input values. Further experimentation could address this issue in order to ensure the black box is corrected across multiple voltage amplitudes.
While the data in the appendices was combined between the pre-emphasis high pass filter and the black box to obtain totals for gain and phase, it would be highly recommended to physically remeasure the overall outcome of the circuit, as well as measure the correction completed by the pre-emphasis circuit. This would require double the measurements during the practical which may cause a time issue, however more accurate data would be obtained.
5.5 Improvements to circuit design
The most significant improvement which could be made to the overall design of the circuit is that of the operational amplifier. By utilising an op amp with a significantly increased slew rate as discussed above, combined with an improved GB, it may be possible to correct some of the abnormalities found in the data results.
Additional corrections could be made in order to address the minor decrease in gain through the frequencies 65 Hz to 1 kHz, as seen in Appendix A3.2. Additionally, variance of the capacitor value could occur in order to attain a more accurate phase shift which does not fluctuate as significantly. These could both be areas of continued development.
Finally, it may be possible to develop a circuit with fewer components than that shows in the final design. If this was to occur, it would decrease the total potential error caused from the inaccuracies of the individual components themselves.
6.0 Conclusion
Following the detailed analysis and experimentation on black box 23, it was found that a pre-emphasis circuit needed to be developed to counteract a low pass filter. The transfer function of this filter was calculated to be:
Three attempts to counteract the effects of the black box took place. The first two circuits (Text book circuit, and Initial circuit) failed to successfully address the gain and phase changes adequately; however the final attempt was successful.
It was clear that limitations were present in regard to the LM741 op amp at higher frequencies which related to both the gain bandwidth and slew rate. Should the experiment be undertaken again, it is recommended that an operational amplifier with substantially better characteristics than the LM741 is used.
In conclusion, it is clear the circuit effectively reverses the effects of the unknown black box. While the circuit could be developed into a more refined model, the basic structure of the final circuit remains elegant and mostly simple. Therefore, a circuit which successfully counteracts the effect of black box 23 has successfully been designed.