You are on page 1of 8

Noise cancellation in headphones

Experiment No. 4

EE324: Control System Lab

Group No. 6

Full Name Enrollment No.


Om Unhale 210070058
Harsh Agrawal 210070032
Kadiyala Sai Susrush 210070038

November 12, 2023


Contents

1 Objectives 1

2 Control Algorithm 1

3 Challenges Faced and Solutions 2

4 Results 3

5 Observations and Inferences 5

6 References 6
Noise cancellation in headphones

1 | Objectives
The aim of the experiment is:
To design and implement an analog circuit for noise cancellation in headphones using closed-loop control
gain techniques satisfying the following requirements.
The objectives to be followed:

■ To achieve an attenuation of 20 dB when a noise of 100 Hz frequency is applied.


■ To design an analog compensator to stabilize the system, i.e. loop shaping of the loop transfer
function.
This was implemented as described in the following steps :

■ Go through the properties of headphones by constructing the appropriate circuit and identify the
kind of system(frequency response analysis) using Headphone setup, DSO, Function generator,
Probes, Amplifier ICs, Breadboard, Wires, Jumpers, Wire stripper in a proper way.

■ Evaluate the bode plot of the system and find a transfer function to lift the bode plot to achieve an
attenuation of 20 dB when a noise of 100 Hz frequency is applied.
■ Design an open-loop circuit gain circuit on the breadboard to achieve this transfer function.
■ Now, make a fresh bode plot for the recent circuit with open-loop gain to check the working of the
open-loop gain circuit.
■ Now modify the previous circuit to a closed-loop circuit to give feedback to input so that even if a
disturbance is applied, the circuit will feedback itself to give the required results.
■ Check the working of the circuit by applying a frequency of 100Hz and also take other readings to
make a bode-plot of the final system.

2 | Control Algorithm
Matlab code:

frequency = [49.69, 76.26, 85.32, 100.0, 200.8, 302.1, 515.5, 750.8, 1008.0, 1515.0, 2041.0, 2509.0,
input_data = [1.74, 1.8, 1.8, 1.62, 1.62, 1.62, 1.66, 1.78, 1.76, 1.74, 1.74, 1.72, 1.72, 1.72, 1.7,
output_data = [0.27, 0.44, 0.45, 0.55, 0.608, 0.52, 0.48, 0.43, 0.4, 0.88, 0.98, 1.0, 0.82, 0.62, 0.4

% Calculate magnitude
magnitude = output_data ./ input_data;

phase = [150.0, 114.0, 95.0, 90.0, 30.0, 10.0, -10.0, -15.0, -18.8, -40.0, -70.0, -115.0, -165.0, -20

phase_rad = phase;

% Convert magnitude to dB
magnitude_dB = 20*log10(magnitude);

% y= 20*log10(10*magnitude);

omega = 2*pi*frequency;

s = zpk(’s’);
R = 3900;
QR = 1800;
C = 1e-6;
C1 = 0.05e-6;

Page 1
Noise cancellation in headphones

R2 = 342;
R1 = 1000;
R3 = 1000;
r = 2200;
num = (C1/C)(C1/C)*sˆ2 + (1/C)((1/R1) - (r/(R*R3)))*s + 1/(C*C*R*R2);
den = sˆ2 + s/(QR*C) + 1/(R*R*C*C);
sys = num/den;
% sys = 0.05*(s+4000)(s+4000)/((s+250)(s+300));

% [mag_tf, phase_tf] = bode(sys, omega);


[mag_tf, phase_tf, wout] = bode(sys, frequency);

% print(mag_tf)
%bode(sys)
temp = transpose(squeeze(mag_tf));

y=20*log10( (magnitude .* transpose(squeeze(mag_tf))));

phase_rad = phase_rad + transpose(squeeze(phase_tf))*(2*pi/180);

% Bode plot
figure;
subplot(2,1,1);
semilogx(frequency, y, ’LineWidth’, 2);
grid on;
xlabel(’Frequency (Hz)’);
ylabel(’Magnitude (dB)’);
title(’Bode Plot - Magnitude’);

subplot(2,1,2);
semilogx(frequency, phase_rad, ’LineWidth’, 2);
grid on;
xlabel(’Frequency (Hz)’);
ylabel(’Phase (radians)’);
title(’Bode Plot - Phase’);

3 | Challenges Faced and Solutions


We initially connected the circuit in the wrong fashion, which led to the burning of components, and it
took a lot of time to figure out this. Adding to this, the DSO setup provided to us was faulty.

After making the bode plot, implementing the transfer function was a heavy task, identifying which
transfer function would suit the best with the kind of available resistors and capacitors in the lab.

Taking the readings for plotting the bode plot was very cumbersome. The DSO was oscillating all the
time, not allowing us to get accurate readings.

Building up the open-loop circuit was slightly hard as the circuit became clumsy with too many components.

Page 2
Noise cancellation in headphones

4 | Results
Could achieve the standards mentioned.Achieved an attenuation of 20 dB, when a noise of 100 Hz frequency
is applied.

Figure 4.1: Theoritical circuit for open loop gain circuit

Figure 4.2: Theoritical circuit for open loop gain circuit

Figure 4.3: phase vs frequency uncompensated system

Page 3
Noise cancellation in headphones

Figure 4.4: gain vs freq for compensated open loop

Figure 4.5: phase vs frequency compensated open loop system.png

Figure 4.6: gain vs freq for uncompensated

Page 4
Noise cancellation in headphones

Figure 4.7: phase vs frequency compensated closed loop system

Figure 4.8: gain vs freq for compensated close loop

5 | Observations and Inferences


C1 = 3000pF
r/R3 = 100
C = 8.7815 × 10−8
R = 296.1481 × 103
R2 = 7816.684
QR = 143.372 08 × 103
R1 = 2.948 × 103

Page 5
Noise cancellation in headphones

6 | References

Page 6

You might also like