4 Band Audio Equalizer Project

12
Design Project 2: Audio Equalizer By Derek Dodge with Dan and Indu Given various requirements, we were asked to create an audio equalizer with 4 second order band pass filters to filter the music. Once we calculated the correct resistor values for the circuit, we were able to create the equalizer and test it with phase response and gain simulations on pspice. Once these results were plotted, we built the circuit and tested the gain and phase shift with various potentiometer settings which adjusted the gains. We found that as the gain increased, the phase shift at that frequency would go closer to zero. We plot these results graphically later. After measurements were taken, we plugged in the speaker and tested our circuit to verify its functionality. It turned out that we did not need a power amplifier because we had enough power without one. Introduction: An audio equalizer has multiple filters that control the level of frequency response. Controlling the level of response from multiple frequency bands allows us to adjust the music to correct for imperfect levels of volume across the frequency domain. For example, we could boost the bass or decrease the treble in a song. Our audio equalizer consisted of 4 second order band pass filters which each filtered a different frequency range. Once these frequencies were filtered they were passed to another op amp which provided the total output of the equalizer. Theory: In short terms, an equalizer is made up of three main circuit elements; band pass filters, potentiometers for adjusting gains, and a final amplifier which contains all the current flow from each filter. Figure 1 below shows a second order band pass filter. Figure 1: Second order band pass filter.

Transcript of 4 Band Audio Equalizer Project

Page 1: 4 Band Audio Equalizer Project

Design Project 2: Audio EqualizerBy Derek Dodge with Dan and Indu

Given various requirements, we were asked to create an audio equalizer with 4 second order band pass filters to filter the music. Once we calculated the correct resistor values for the circuit, we were able to create the equalizer and test it with phase response and gain simulations on pspice. Once these results were plotted, we built the circuit and tested the gain and phase shift with various potentiometer settings which adjusted the gains. We found that as the gain increased, the phase shift at that frequency would go closer to zero. We plot these results graphically later. After measurements were taken, we plugged in the speaker and tested our circuit to verify its functionality. It turned out that we did not need a power amplifier because we had enough power without one.

Introduction:An audio equalizer has multiple filters that control the level of frequency response. Controlling the level of response from multiple frequency bands allows us to adjust the music to correct for imperfect levels of volume across the frequency domain. For example, we could boost the bass or decrease the treble in a song. Our audio equalizer consisted of 4 second order band pass filters which each filtered a different frequency range. Once these frequencies were filtered they were passed to another op amp which provided the total output of the equalizer.

Theory:In short terms, an equalizer is made up of three main circuit elements; band pass filters, potentiometers for adjusting gains, and a final amplifier which contains all the current flow from each filter. Figure 1 below shows a second order band pass filter.

Figure 1: Second order band pass filter.

The gain through this filter, H=(Vout/Vin), can be found using the node voltage method across the filter. Below is the derived equation for H.

Below is an image from our requirements that helped us perform all of our band pass filter calculations.

Figure 2: Equations used in our calculations.

After the music is filtered through the second order filters, the gain is set by a potentiometer which we used in other labs. It has a variable resistance which changes the voltage and current through the terminals connected in this circuit. Each

Page 2: 4 Band Audio Equalizer Project

potentiometer “flows into” the input of an op amp which changed the final gain to be more uniform. Op amps, used in previous labs, have a high gain which allowed us to power our speaker directly without the power amplifier.

Design:We were asked to design an equalizer with 4 band pass filters with adjustable gain. The table below shows the specifications of the circuit.

Figure 3 / Table 1: Given specifications for circuit.

These values allowed us to calculate our resistor and capacitor values to make a functional equalizer. We started by looking at Eq. 5 (in Figure 2), which corresponds to the variables in Figure 1.

640 Hz = 1 / (2πC√(R1R2))1000 Hz = 1 / (2πC√(R1R2))4000 Hz = 1 / (2πC√(R1R2))10000 Hz = 1 / (2πC√(R1R2))These are our 4 equations for the four band pass filters.Since we also know that we need a quality factor of 1, we can use Eq. 71 = .5(√(R2/R1))4 = R2/R14R1 = R2This is our relation between the two resistors for the second order filters.Using this relation in Eq. 5 we get:

640 = 1 / (2πC√(R1*4R1))We chose to use the 1 nF capacitors for all of our filters.640(2)(π)(1E-9F) = 1/√(4R1^2)2R1 = 1/(640*2π*1E-9)R1 = 1.24E5 ΩR2 = 4(1.24E5 Ω)R2 = 4.98E5 ΩUsing these calculations for the other filters gives us the table below.

Fo (Hz) C (F) R1 (Ω) 4R1 (R2)640 1.00E-09 1.24E+05 4.98E+051600 1.00E-09 4.98E+04 1.99E+054000 1.00E-09 1.99E+04 7.96E+0410000 1.00E-09 7.96E+03 3.18E+04

Table 2: Resistor values for the 4 band pass filters.

Figure 4: Pspice diagram for the 640 Hz band pass filter.

Once our second order band pass filters were created, we could connect them to the final op amp. For this op amp, we used pspice to estimate an R2 value that would give us a correct overall gain. We used 1 kΩ resistors connected to potentiometers which fed into this final op amp. Open all the way (gain of 2), R1 was 1 kΩ. After trial and error, an R2 value of 680 Ω gave us an overall gain of 2. This final op amp normalized our circuit. Below in Figure 5, is our op amp from pspice.

Page 3: 4 Band Audio Equalizer Project

Figure 5: pspice diagram for our final op amp. R2 is the 680 Ω resistor and the speaker is the 8 Ω resistor.

Putting it all together we get the circuit below in Figure 6.

Figure 6: pspice full equalizer.

After we got our simulation data, we built the equalizer.

Experiment:1) Once our circuit was complete, we set the gains for each band pass filter to 0.2. Once these gains were set, we measured the overall output voltage and phase response with respect to frequency. 2) We then set the gains to our max of 2.0 for each filter. Then we measured the output voltage and phase response again with respect to frequency.3) To view the full potential of our mixer, we set the .64 kHz filter to a gain of 2.0, the 1.6 kHz filter to a gain of .2, the 4 kHz filter to a gain of .2, and the 10 kHz filter to a gain of 2.0. Again we measured the amplitude and phase response.4) We verified the functionality of our equalizer by playing a song through the computer and wiring the output to a power amplifier which leads to the speaker. Once we could hear music, we adjusted the potentiometers to check the audio response.

Results / Discussion:1) We measured our total output voltage and divided it by our input voltage (1v) to get the gain. Below is a table for our data where the gains were set all the way down (.2 for each potentiometer)

FREQUENCY (Hz)

AMP RESPONSE (Gain)

300 0.025400 0.023500 0.0288600 0.026640 0.0278700 0.0238800 0.0246900 0.0219

1000 0.023

Page 4: 4 Band Audio Equalizer Project

1200 0.02541400 0.02351600 0.02351800 0.02542000 0.02462400 0.02352800 0.0223200 0.02273600 0.02424000 0.02155000 0.0256000 0.02167000 0.02428000 0.0249000 0.0235

10000 0.02512000 0.024215000 0.0254

Table 3: Values for .2 gain across each band pass filter. The phase shift was immeasurable since the gain was so small that we barely even picked up a signal.

The overall gain of the circuit here is very tiny which makes sense since our potentiometers were set the gain to minimum. Figure 7 below shows our results graphically.

100 1000 100000

0.005

0.01

0.015

0.02

0.025

0.03

0.035

Gain vs Frequency (.2)

Frequency (Hz)

Gain

(Vou

t/Vi

n)Figure 7: Our total gain across the frequency spectrum is a consistently small value.

The results from this graph make sense since at minimum gain, the circuit is essentially filtering out all of the frequencies. We would not hear much music at all since all frequencies are being minimized. Again, since we did not pick up much of a signal, the phase response could not be determined.

2) We opened the potentiometers to get a full gain of 2 across each filter. By measuring the same way we did in part 1, we got the values in Table 4 below.

FREQ (Hz) GAIN ΔT (μs)

Phase Shift (degrees)

300 1.13 640 69.12400 1.48 440 63.36500 1.77 240 43.2600 1.96 180 38.88640 1.98 140 32.256700 1.94 140 35.28800 1.86 80 23.04900 1.81 60 19.44

1000 1.86 60 21.61200 2.02 48 20.7361400 2.35 16 8.0641600 2.35 4 2.3041800 2.22 10 6.482000 2.06 12 8.642400 1.81 14 12.0962800 1.77 10 10.083200 1.86 8 9.2163600 1.94 6 7.7764000 1.98 7 10.085000 1.9 10 186000 1.77 10 21.67000 1.7 9 22.688000 1.77 8 23.049000 1.81 8 25.92

10000 1.86 9 32.412000 1.81 10 43.215000 1.57 11 59.4

Page 5: 4 Band Audio Equalizer Project

Table 4: Measurements for a full gain of 2.0. We measured the phase response by using the cursor on the oscilloscope. With this ΔT value we converted it to a phase shift by doing:Phase shift = 360° * freq * ΔT

Below in Figure 8, we plot the gain vs frequency.

100 1000 10000 1000000

0.5

1

1.5

2

2.5

Gain vs Frequency (2.0)

Frequency (Hz)

Gain

(Vou

t/Vi

n)

Figure 8: Experimental results for gain vs frequency.

Comparatively, the theoretical data is shown below in the next few figures.

Figure 9: pspice gain plot Frequency (Hz) Output Voltage (V)

5.00E+01 1.73E-015.01E+01 1.73E-015.02E+01 1.74E-015.03E+01 1.74E-015.05E+01 1.75E-015.06E+01 1.75E-015.07E+01 1.75E-015.08E+01 1.76E-015.09E+01 1.76E-01

Table 5: Sample of data from pspice simulation. Since there were 3000 total points, we plotted all the points on Excel below.

1.00E+02 1.00E+03 1.00E+04 1.00E+050

0.5

1

1.5

2

2.5

Theoretical Voltage output across the Frequency Domain

Frequency (Hz)

Out

put v

olta

ge (V

)Figure 10: Theoretical pspice data again (blue). The voltage will be the same values for the gain since our input voltage is 1V. The orange points are our experimental data.

Our data lined up very well. The only problem was our gain at the 1600 Hz filter was slightly higher. This also proved that with the potentiometer all the way down, the music for that frequency band was minimized, and it was maximized with the potentiometer all the way up. Below in Figure 11 is our plot for phase shift.

Page 6: 4 Band Audio Equalizer Project

100 1000 10000 1000000

10

20

30

40

50

60

70

80

Absolute value of Phase Shift (2.0)

Frequency (Hz)

Phas

e sh

ift (d

egre

es)

Figure 11: Absolute value of phase shift since the oscilloscope does not give us a negative ΔT so our phase shift should like a line with some deviations that mostly slopes down like the pspice simulation below.

Figure 12: pspice simulation for phase shift on a decibel scale. Theoretically this line should have the same shape as our phase shift data.

Frequency (Hz) Phase response (dB)5.00E+01 -9.34E+015.01E+01 -9.34E+015.02E+01 -9.34E+015.03E+01 -9.34E+015.05E+01 -9.34E+015.06E+01 -9.34E+015.07E+01 -9.34E+015.08E+01 -9.34E+015.09E+01 -9.34E+015.12E+01 -9.35E+01

Table 6: Sample of data from pspice simulation. Since there were 3000 total

points, we plotted all the points on Excel below.

1.00E+02 1.00E+03 1.00E+04 1.00E+05

-350

-300

-250

-200

-150

-100

-50

0

Theoretical dB vs Frequency

Frequency (Hz)

20lo

g(Vo

ut/V

in) (

dB)

Figure 13: Theoretical pspice data again.

Our phase shift does not look like this one right now. Assuming that if we took away the “absolute value” of our data, the curve would look like the shape of Figure 13 but it would have a zero phase shift around 1600 Hz and then get increasingly more negative. This would make sense since the smallest phase shift would be in the middle of the frequency bands (around 640 to 10000 Hz). A smaller phase shift results in a greater gain. Neither extreme of the frequency spectrum was amplified so it makes sense that the absolute value of the phase shift will be greatest at the two ends. There is minimal gain at these frequencies since we had no filters to amplify the very low and very high frequencies.

3) We set the 640 Hz filter to a gain of 2, the 1600 Hz filter to a gain of .2, the 4000 Hz filter to a gain of .2, and the 10000 Hz filter to a gain of 2. This amplified the highs and lows of the music but canceled out the mid-range music. We took measurements shown in the table below.

Page 7: 4 Band Audio Equalizer Project

FREQ (Hz) GAIN ΔT (μs)Phase shift (degrees)

300 0.705 600 64.8400 0.971 320 46.08500 1.216 180 32.4600 1.363 60 12.96640 1.377 40 9.216700 1.3529 60 15.12800 1.245 80 23.04900 1.18 90 29.16

1000 1 110 39.61200 0.765 100 43.21400 0.6078 110 55.441600 0.529 76 43.7761800 0.4412 72 46.6562000 0.373 52 37.442400 0.294 16 13.8242800 0.274 68 68.5443200 0.194 78 89.8563600 0.261 76 98.4964000 0.362 26 37.445000 0.607 22 39.66000 0.794 16 34.567000 0.9705 9 22.688000 1.117 5 14.49000 1.255 1.2 3.888

10000 1.294 4 14.412000 1.216 6.4 27.64815000 1.0196 8 43.2

Table 7: Measurements for gains of 2/.2/.2/2. We calculated phase shift the same way from part 2.

Below, we show our gain vs frequency results graphically.

100 1000 10000 1000000

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

Gain vs Frequency (2-.2-.2-2)

Frequency (Hz)

Gain

(Vou

t/Vi

n)

Figure 14: Gain vs Frequency when the mid-range frequencies are cut off.

These results make sense because the gains of the lows and highs are all the way up whereas the gains for the mid-range bands are minimized. This means that the output and gain will be high for bass and treble, and low for mid-range music. The graph below shows the phase shift for the simulation above.

100 1000 10000 1000000

20

40

60

80

100

120

Absolute Value of Phase Shift (2-.2-.2-2)

Frequency (Hz)

Phas

e Sh

ift (d

egre

es)

Figure 15: Absolute value of phase shift since the oscilloscope does not give a negative ΔT value.

Page 8: 4 Band Audio Equalizer Project

Some of the values in the middle of this graph had very small amplitudes which made phase shift very hard to measure. This gave us some error but theoretically, our plot should have looked like Figure 16 below.

Absolute Phase Shift example

Figure 16: Theoretical visual for phase shift where blue is our data and orange is zero phase shift. The two zero points are the resonance frequencies 640 Hz and 10000 Hz. These frequencies have max gain and minimum phase shift.

Getting rid of the absolute values, we will get something that looks like Figure 17 below.

Theoretical Phase Shift ex-ample

Figure 17: Theoretical visual for phase shift without the absolute value. The zero points are still the same.

Looking at figures 15 to 17, points closer to the zero phase shift will have a higher gain and points farther from the zero phase shift will a smaller gain. This makes sense according to our experimental data. Since there are two peaks around 640 Hz and 10000 Hz, this shows that the gains for these bands were boosted (open at a gain of 2) and the other bands were closed (at a gain of .2).

4) We plugged in our speaker and replaced the function generator input with the input from the computer. We played a song from YouTube and it played fairly clearly through the speaker with the gains all the way up. When the gains were turned down it did affect the music. With the gain set to the specifications from part 3, we heard less mid-range and more of the really high notes and cymbals. Turning the 640 Hz filter all the way down silenced most of the guitar in the music.

Conclusion:After calculating the values for the resistors in the filters and op amp, we were able to put resistors in series to create resistor values very close to the theoretical ideal values. Once we built the circuit like we did in pspice, we tested measurements with the gains set to minimum (.2). This gave us very small readings which could be expected since it was not allowing the music through any band. Then we set the gains to max (2) and took more measurements. Our data was very similar to the theoretical pspice results. The gain was high around the resonance frequencies of the filters and it dropped off on each end of the frequency spectrum. The phase shift was minimal close to the resonance frequencies. Then we set the filters to 2/.2/.2/2 for the 640/1600/4000/100000 Hz bands respectively. This gave us the results we were expecting. The gains were high only around the 640 Hz and 10000 Hz bands.

Page 9: 4 Band Audio Equalizer Project

This made sense since the gain was turned down for the frequencies between them. At the 640 Hz and 100000 Hz bands, the phase shift was closer to zero which corresponded to max gains. Once we wired the speaker in, we had created a functional audio equalizer. We did not need to use a power amplifier because our volume was loud and clear enough without it but it would have been interesting to see if we could get a very clear sound with a power amplifier.

References:Figure 1: Design project assignment documentFigure 2: Design project assignment documentFigure 3: Design project assignment document