Lab3 inf3410/inf4410 Fall 2005 INF 3410/4410 Lab 3 Simple active filters 1. Introduction In this lab we will explore the CMOS amplifier a little more regarding dynamic behavior. Then we will proceed with a simple application of active filters in multi-element loudspeakers. Seemingly a “loudspeaker” is one unit, by looking inside there are usually 2-3 loudspeaker elements inside the box. These are dedicated units, suitable for different audio frequencies. Typically you might find a bass element for low frequencies, a medium frequency range element and a high frequency (tremble) element. Figure 1 3-element loudspeaker As illustrated in Figure 1, the signal input from an audio amplifier is split in three signals and fed to the respective loudspeaker element. In front of each element a filter is inserted to ensure only designated frequencies are passed through. This filtering is required to ensure proper high quality operation of the loudspeaker elements. In most standard loudspeakers these filters are made with passive components like capacitors, resistors and inductors (coils). We will explore an active solution for the filters. Before implementing our filters, we will explore some properties of dynamic behavior of amplifiers. Both potential problems and possible solutions are treated. 2. Frequency measurement A common way of treating the dynamic behavior (or frequency response) of electronics is to produce a BODE-plot. 1 /7 Lab3 inf3410/inf4410 Fall 2005 Figure 2 BODE plot of a 1. order low pass filter with gain and phase. As illustrated in Figure 2 a BODE-plot is exhibiting (a) the gain as a function of frequency and (b) the phase response (delay) as a function of frequency. The input signal is a sinusoidal swept over the illustrated frequency. Both axes are using a logarithmic Xscale and the gain is shown in dB (decibel) defined as: log gain = 20 log10 ( A)dB with A as the signal gain. The signal has unity gain ( A = 1 = log10 (0) ) in the pass band and the signal is decreasing with 20dB for each 10-fold frequency increase in the stop band. Figure 3 first order RC filter As illustrated in Figure 3 we can make a first order passive filter with just one resistor and one capacitor. Question a): (2p) Code a MATLAB script for generating a 1-2V sinusoidal. Sweep the frequency from 100Hz to 1Mhz and measure the gain of the filter of Figure 3 for at least 5 different frequencies for each decade. Plot your results as a BODE-plot in MATLAB and determine the corner frequency of the filter. Phase shift or delay is a little harder to measure. You should look for the phase lag around the corner frequency of the filter. Question b): (2p) 2 /7 Lab3 inf3410/inf4410 Fall 2005 Determine the phase shift as a function of the filter in Figure 3 as a function of frequency. By measuring the delay, the phase may be computed. It is also possible to utilize mathematical functions available in most modern oscilloscopes. In MATLAB plot the combined BODE plot of both phase and gain. Do your measurements agree with analytical results? 3. Amplifier dynamics We will refine our transconductance amplifier from lab 2 and build a classic 2-stage amplifier. An additional output stage will increase the overall gain, but may also introduce some stability problems. Other typical amplifier features like slew-rate and unit-gain bandwidth will be treated. Figure 4 Two stage amplifier As shown in Figure 4 we have combined a differential pair as input stage and a commonsource output stage. Please note the decoupling capacitors on the rails avoiding railinduced noise. In Figure 4 we have also indicated a compensation capacitor, CC, we are going to introduce later. The 150kΩ resistor is used for biasing both the tail current of the input stage and the common-source output stage. We will explore our amplifier with maximum negative feedback in a configuration known as voltage follower. Figure 5 Voltage follower In our first measurement we will not use our compensation capacitor. Question c): (3p) 3 /7 Lab3 inf3410/inf4410 Fall 2005 Wire up the schematics shown in Figure 5. Apply a suitable sinusoidal (something like 2V@100Hz). Adjust your oscilloscope to capture in MATLAB a timedomain trace of the output voltage. Then add the compensation capacitor CC=0.1nF and make another MATLAB capture. Plot both traces together and explain the difference. What is the purpose of the compensation capacitor? In the following measurement we will keep our compensation capacitor connected. Next, we will determine the slew-rate limitation of the amplifier. We apply a large transition on the input and measure the quality of the output signal. Question d): (3p) Apply a square wave with large swing (±4V?) at 100Hz. You should see the output not quite keeping up with the abrupt changes of the input. By estimating the slope of the output transition, the slew-rate limit of the amplifier can be estimated. Determine the slew-rate limitation of both the positive going and negative going transition. In practical electronics we experience that whatever device (i.e. transistor, capacitor, resistor and even wires) is not like ideal devices. They all add secondary effects, typical resistive and capacitive in addition to the primary function. These unwanted additions are known as parasitics and have to be accounted for in our circuit design. One consequence is that circuits like our amplifier will not keep up with whatever input signal is given to it as we already know through our slew-rate experiment. As we crank up the input frequency, parasitics will kick in at some point and limit the maximum frequency the amplifier may handle. Question e): (3p) Apply a ±50mvV sinusoidal to the input of the voltage follower avoiding large signal slew-rate limitations. Sweep the input frequency to find the maximum frequency performance of the amplifier. In MATLAB make a BODE-plot of both frequency and phase characteristics of the amplifier. What is the bandwidth of the amplifier? Figure 6 Amplifer with a gain of 11. As illustrated in Figure 6 we may change the feedback of the amplifier by feeding back a fraction of the output signal. This modification adds a gain of approximately 11. With gain it is easier to hit the rails, so make sure your amplifier is not clipping the the following measurements. 4 /7 Lab3 inf3410/inf4410 Fall 2005 Question f): (2p) Apply a small input signal avoiding clipping and slew-rate limitations to the configuration shown in Figure 6. In MATLAB make a BODE-plot of both phase and gain and determine the corner frequency of this configuration. What is the bandwidth now? Compare with the results from the previous question and explain possible differences. Question g): (3p) A common measure of amplifier performance is called Gain-Bandwidth (GBW). From our previous two measurements GBW can be determined. Find GBW for both experiments and explain why this is an interesting amplifier parameter. 4. Active loudspeaker filter Next we will build up a simple active filter suitable for audio frequencies. Just to make it simple we will assume a loudspeaker with only two elements. The HF element should receive frequencies >1000Hz while the LF element should do frequencies <1000Hz. Although not so important in loudspeakers, we are avoiding inductors in integrated circuits. They are costly and hard to make on silicon. For this exercise we will restrict ourselves to only capacitors and resistors in addition to our opamps. The quality of the filters should not add distortion which would sound bad. We should make our filter as linear as possible avoiding added or reduced gain for some frequencies. The quality is affected not only by the quality of the components, but also by things like the selected topology, the length of the wires and quality of soldering and shielding. We will explore a very popular filter topology known as Sallen&Key filters and extract some key features. Figure 7 Sallen&Key filter By interchanging passive components as shown in Figure 7 we may change between high pass and low pass characteristics. The Sallen&Key filter is a 2. order filter with the transfer function: kω02 H (s ) = ω s 2 + 0 s + ω02 Q 5 /7 Lab3 inf3410/inf4410 Fall 2005 1 1 and Q = and k = A RC 3− A We will measure the performance of both filters with k≈1.5 (Butterworth filter). A suitable resistor value could be R≈50kΩ. For tuning purposes it might be useful to use pot-meters for the resistors enabling later adjustments. Question h): (2p) Find an appropriate value for the capacitor, C, giving a corner frequency of 1000Hz. Question i): (5p) Build both filters separately and in MATLAB make a BODE plot of both filters with a suitable sinusoidal input. Adjust the corner frequency to 1000HZ for both filters by adjusting the R. with ω0 = As suggestion in the introduction, the filters is going to ”drive” to loudspeaker elements. In the real world the sound pressure waves from the loudspeakers are mixed and are reaching our ears as sound. As an illustration we will mix the output signals using 2 capacitors. Figure 8 Simulated mixing of sound waves The schematics of Figure 8 illustrate how capacitive mixing can be done. Now we want to explore the overall linear performance of the combined filters by sweeping the input in the audio range. Question j): (3p) Measure the overall filter performance (Figure 8) and make BODE plots in MATLAB. For frequencies around 1000Hz pay special attention and explain possible deviations in both phase and gain. Some speaker elements are really not suited for low frequencies, even if they are bass elements. As a protection we could modify the filter for the bass element to filter out frequencies below, say 100Hz. A possible topology known as band-pass filter could be: 6 /7 Lab3 inf3410/inf4410 Fall 2005 Figure 9 Band pass Sallen&Key filter The transfer function above is still valid but both high and low frequencies are attenuated. Question k): (5p) Determine values for the Rs and Cs (not necessarily the same for all any more) for the band pass filter in Figure 9. Document your redesign by measured BODE plot in MATLAB. Explain performance changes compared to the low pass configuration. 7 /7