0% found this document useful (0 votes)
110 views42 pages

Noise Cancellation Iitb PDF

This document describes the design of an analog active noise cancellation system for headphones. It explores both feed-forward and feedback noise cancellation techniques. The project focuses on designing an analog feedback control system using cascade compensation to achieve up to 20dB of noise cancellation at 100Hz. Circuits for the microphone preamp, compensator, and overall closed-loop system are designed, characterized, and tested. The final system achieves 17dB of noise cancellation at 100Hz and improves the low frequency response of the headphones.

Uploaded by

Tarun S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views42 pages

Noise Cancellation Iitb PDF

This document describes the design of an analog active noise cancellation system for headphones. It explores both feed-forward and feedback noise cancellation techniques. The project focuses on designing an analog feedback control system using cascade compensation to achieve up to 20dB of noise cancellation at 100Hz. Circuits for the microphone preamp, compensator, and overall closed-loop system are designed, characterized, and tested. The final system achieves 17dB of noise cancellation at 100Hz and improves the low frequency response of the headphones.

Uploaded by

Tarun S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Analog Active Noise Canceling Headset

Electronic Design Lab - EE 318


Skand Hurkat, 08007013
Indrasen Bhattacharya, 08007032
Srujan Meesala, 08007036
Department of Electrical Engineering, IIT Bombay

May 3, 2011

Abstract
Analog systems to achieve active noise cancellation in headphones were designed and imple-
mented. Our project addresses two distinct technqiues - feed forward and feedback systems. The
work up to mid-semester, which was focused mainly on a feed-forward system with the motivation of
developing a clip-on platform for generic earphones, is presented briefly. Limitations of this approach
that lead to a poor noise cancellation figure (5-10 dB) are identified. Subsequently, feedback-based
noise cancellation methods based on analog circuits as well as DSP are studied. As the central
goal of this project, we focus on the design of an analog feedback control system based on cascade
compensation. After identifying the plant frequency response, a suitable compensation network com-
prising lag and lead circuits was designed. In theory, the design aims to achieve a maximum noise
cancellation of 20 dB at 100 Hz while simultaneously maintaining good stability margins, which are
essential due to high plant variability. Circuits for implementing the compensator were designed
and characterized. The performance of the entire closed loop system is then evaluated in terms of
noise cancellation figures and frequency response of the music input. We achieved a maximum noise
cancellation of 17 dB at 100 Hz and an improvement in the headphone response for bass inputs.

1
Contents
1 Introduction 3

2 Feed-forward active noise cancellation 4

3 Feedback active noise cancellation 6


3.1 Motivation for analog feedback system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.2 Block Diagram for Analog Noise Control System . . . . . . . . . . . . . . . . . . . . . . 9
3.2.1 Transfer Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2.2 Requirements in final system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4 Plant characterization 11

5 Primary compensation network 13


5.1 Design requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
5.2 Lag and lead compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2.1 Basic theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2.2 Inadequacy of simple lag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Second order damped lag design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.1 Basic theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.3.2 Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.4 First order lag design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

6 Circuit Design for Primary Compensation and System Testing 20


6.1 Design of Mic Preamp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.2 Design of Active Second Order Lag System . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.2.1 Sallen-Key Topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.2.2 Kerwin-Huelsman-Newcomb (KHN) Biquad Filter . . . . . . . . . . . . . . . . . 21
6.2.3 Single Amplifier Biquad (SAB) Filter . . . . . . . . . . . . . . . . . . . . . . . . 22
6.2.4 Tow-Thomas Biquad Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2.5 Characterisation of the Tow-Thomas Biquad . . . . . . . . . . . . . . . . . . . . 24
6.3 Design of Active First Order Lag/Lead Networks . . . . . . . . . . . . . . . . . . . . . . 24
6.4 System testing and issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

7 Modified Compensation Network and System Testing 25


7.1 Inclusion of LF lead and new HF lag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
7.2 The cascaded compensator and its characterization . . . . . . . . . . . . . . . . . . . . . 27
7.3 Evaluation of closed loop frequency responses . . . . . . . . . . . . . . . . . . . . . . . . 29
7.4 Compensator for the right channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

8 Results and Discussion 31


8.1 Noise Cancellation Response Measurements . . . . . . . . . . . . . . . . . . . . . . . . . 31
8.2 Music Response Characterisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

9 Conclusion 35

A Right channel frequency response characteristics 38

B SPICE simulation results 39

C Complete circuit schematic 41

2
1 Introduction
A noise-canceling headset and associated circuitry is aimed at reducing ambient noise and improving
the musical experience of the user. Ambient noise is an external sound that impinges on the ears of
the listener using heaphones and masks the music. Typical noises include the noise of a bus in which
the user is riding, or an AC machine running in a room. Many such continuous noise sources are at
low mains-like frequencies of 50-100 Hz.

Often, headsets are built with padding/foam which passively reduce noise by mechanical damping.
This is specially effective at high frequency external noise due to the mechanical low pass filtering
action of such padding. Indeed, at high frequencies, we may have 10-20 dB of noise cancellation. But,
passive noise cancellation may be insufficient at low frequencies - which are the frequencies of interest
for external motor/locomotive/engine noise. A technique to deal with such low frequencies of external
noise is active noise cancellation.

Figure 1: From L to R: Typical circumaural (full-ear covering) headphones, which provide substantial
ambient noise cancellation at high frequencies (Fig. from [1]). A pictorial view of the passive attenuation
of external noise provided by circumaural headphones (Fig. from [2]). A Bode magnitude plot of the
simulated passive noise attenuation provided by such a headphone (Fig. from [2]). Note the low
cancellation below 200 Hz.

Active noise cancellation involves the detection of external noise by suitable means and generating
an equal and opposite signal to cancel out this external noise via acoustic domain interference.
Several schemes are available for the generation of an antinoise signal. An external microphone may be
placed for detecting the external noise, at a position close to the ear. An error-detecting microphone
may be placed inside the setup, so as to detect the final signal entering the ear canal. The outputs from
these transducers may be used in a systematic way to implement DSP-based algorithms such as the
LMS algorithm. Another possibility is to implement a tracking control system which treats the music as
an input to be followed and the external noise as a disturbance to the system. We are then interested in
implementing a high disturbance rejection, which would effectively lead to noise attenuation. Some
of the simplest active noise cancelation techniques depend on a direct feed-forward of the noise signal
for generating an anti-noise signal. More complicated, but robust and better methods involve the use
of feedback control systems implemented in the analog or digital domain, and even adaptive digital
algorithms which lead to high active noise cancellation.

3
Figure 2: Left: Schematic illustrating the basics of active noise cancellation, with associated circuitry
(Ref. [2]); Right: Three different time-domain noise cancellation graphs for analog, digital and hybrid
noise cancellation systems - illustrating some of the most common issues with each of these. Analog
noise cancellation is often not effective enough, whereas DSP-based noise canceling systems are slow.
Hybrid systems combine the advantages of both (Ref. [3])
.

In this project, we implement two analog systems for active noise cancellation. The first system is
a clip-on system based on feedforward active noise cancellation - which is supposed to be independent
of the headphone setup to be used. We investigate the efficacy of this system and the dB level of noise
cancellation obtained. Based upon our understanding of this feedforward system, and the nature of the
noise, we later proceed to implement an analog feedback active noise cancellation system, based upon
the system implemented in [4]. We shall first briefly discuss the feedforward system, and then proceed
to a full description of the feedback system.

2 Feed-forward active noise cancellation


The basic idea of feed-forward active noise cancellation is just that of the detection of the external
noise and feeding the inverted form of this in addition to the music to the headphone actuator. The
basic idea is that of acoustic domain noise cancellation, and the expectation is that this will work out
if the noise signal that is measured by the external microphone is close to the noise signal reaching
the ear canal of the user. In the process, we make several simplifications which we shall detail further on.

The basic block diagram and the circuit schematic for this system is presented in Fig. 3 and Fig. 4.
It essentially involves an inverted version of pre-amp output as anti-noise signal. The advantage of such
a system is that there are no constraints really on the kind of headphone used, except that the distance
between the external mic and the ear canal must not be too large, else we incur a delay which degrades
performance. In order to obtain an understanding of active noise cancellation, we also tried out a few
different configurations of the setup with a thermocol box to mimic the human head. Readings were
taken to compare two cases of noise cancellation and noise amplification, with zero music. The readings
are presented in the following pages.

4
Figure 3: A functional description of the system, with the final output to the human ear being the
output of the acoustic domain summation. The model includes a delay between the signal reaching the
external mic, and the ear canal. Also, the mic-preamp gain could be adjusted by the user so as to allow
for a good amount of noise cancellation. The music is just added at the actuator input.

Figure 4: A circuit schematic of the feedforward system, showing the circuitry for each of the two
channels.

To obtain the noise cancellation figure, and emphasize the difference due to active noise cancellation,
we consider readings between two situations (Fig. 5). In the first situation, we play out the inverted
noise signal, and this would lead to noise attenuation. In the second situation, we switch to the signal
being directly fed, leading to acoustic domain addition, and thus amplification. The difference between
the amplified and attenuated cases is quite marked.

5
Figure 5: A tone of 440 Hz was played for this test. As can be seen, there is an attenuation of 10 dB
(3 times) from amplifying to noise cancelling modes. Thus, the amount of noise attenuation provided
is about 4-5 dB.

The amount of noise cancellation obtained turns out to be 4-5 dB for this direct feedforward system.
There are several reasons for this kind of a degraded performance. Some of these reasons are highlighted
below:

• Delay: There is a certain amount of delay introduced between the external sound reaching the
microphone placed externally and the ear canal. Thus, whatever anti-noise signal is played by
the headphone speakers is not exactly inverted, but is also out of phase. This phase difference
tends to increase with the frequency of the external sound, leading to a performance degradation.

• Direction of external noise: The external microphone is placed at a point external to the
headphone housing. It may happen that the external noise impinges on the setup in such a
way that the noise actually detected by the external mic, and that reaching the ear canal are
markedly different. This might happen if the source is not infinite (if it is close by), or if the
position of the source keeps changing. Also, the effect of the headphone housing would alter the
sound reaching the ear canal vis-a-vis the sound reaching the external mic. This issue would also
lead to a mismatch between the noise and anti-noise signals.

• Manual Control: The system depends upon the user changing the microphone pre-amp gain in
order to obtain just the right amount of cancellation. This is highly undesirable, as the user would
need to keep changing this gain if the loudness of the external source were to be varying even
gradually. Also, a mismatch in the mic pre-amp gain and the external noise level can actually lead
to a worsening of performance even over the normal case. This motivates us to look at methods
of automatic control which do not depend upon user feedback to correct for a mismatch in the
gain of the circuitry.

The feedforward paradigm does not explore the possibility of detecting the error signal impinging
at the ear canal and taking control actions to make sure that the external disturbance is rejected. One
major issue with having to detect the error signal is that a transducer would have to be placed inside the
housing of the headphone. There are a few difficulties with placing a microphone inside a headphone
setup so as to detect the error due to the external noise. We conclude that the mic would have to
be attached firmly with the body of the headphone amplifier so as to prevent mechanical variations -
which could lead to sudden variations in the system. We will see how we can implement a feedback
active noise cancellation system, and the major advantages provided by such a control philosophy in
the next section.

3 Feedback active noise cancellation


A passive cancellation of 20 dB is already provided at high frequencies by the housing of the circumaural
headphones. In order to achieve something of a similar level at the low-frequency range (100-500 Hz),

6
we require a noise cancellation level of 12-20 dB from the active noise cancellation setup, significantly
greater than the level provided by analog feedforward. Commercial headphones provide a stated noise
cancellation level of upto 12-32 dB (Ref. [5]).

3.1 Motivation for analog feedback system


One of the major problems that we encountered with the feedforward system was that the manual con-
trol was unreliable and led to difficulties in the use of the system. Also, the level of noise cancellation
provided is also quite low. There are several techniques to make things ‘automatic’ for the user. Such
techniques include the use of different microphone placements to obtain data about the external signal
and the error signal. The use of discrete time signal processing algorithms such as the Least-Means-
Square algorithm and other adaptive techniques for noise cancellation implemented on DSP chips are
quite prevalent.

There are three basic categories of noise cancellation systems as far as implementation goes. digital
systems are more versatile and often lead to better noise cancellation. They allow a greater degree of
freedom, and algorithms like LMS allow active noise cancellation which is optimal in a certain sense.
The problem with digital systems is that they are often quite slow and require training sequences to
find the ideal filter coefficients for the adaptive filter. If the system is to change, as is often the case
for the headphone/ear-cavity system, we need a new training sequence for adjusting the filter weights.
One way to circumnavigate this issue is to use the recursive least means square algorithm which
updates filter weights on the fly - thus negating the necessity for new training sequences. But, this is at
the cost of increased computational complexity for the adaptive filter, which leads to a greater delay.
Thus, we find that digital systems are often slow and sensitive to changes in the plant.

On the other hand, analog systems are often fast and less expensive. Analog systems are dealt
with in terms of automatic control theory, where the external noise is viewed as a disturbance to be
minimised. Ref. [4], a patent by Amar Bose, provides a classical example of a closed loop system
for active noise cancellation which manages to achieve a stated noise cancellation level of 20 dB. The
headphone/ear-cavity system is treated as a plant to be controlled, and the open loop gain is increased
as much as possible without compromising on the stability of the closed loop system. Bose’s circuit
consists of a lead-lag compensator which achieves this requirement. We shall have a detailed look at this
later. One major disadvantage of analog systems is that they do not allow us the freedom of designing
filters to achieve an optimality criterion - such as least means squares. We are limited in scope by the
practical issue of implementing analog domain transfer functions. Thus, the level of noise cancellation
possible from analog systems is often lower than what is possible from digital adaptive filters.

The third and most effective category of noise cancelling systems are hybrid - in that they combine
the robustness of analog systems and the optimality properties of digital systems. The analog system
is used to make the plant more robust to changes in physical conditions. The digital system may then
be used without sensitivity concerns because of the robust analog system built around the plant. A
detailed discussion of a robust hybrid control system is presented in Ref. 3.

For our project, we have decided to narrow down on an analog system implementation in order to
obtain a noise cancellation level between 12-20 dB. The reasons for our choice include the easy availabil-
ity and low cost of components, the strong design and circuits component involved, which emphasize
the suitability of this approach for an EDL project and the well established previous work in this field
by Bose and others (Ref: 2).

The figures below from Ref. 6 are functional block diagrams for some of the common techniques
used for active noise cancellation.

7
Figure 6: Left: A schematic of the feedforward system, with an externally placed mic. Right: An
analog feedback system, with an in-housing mic which is used to feedback the error signal.

Figure 7: A hybrid system, with an analog system built around the plant so as to reduce the plant
variations seen by the external digital system.

Figure 8: Left: An adaptive filter with fixed weights applied to the error mic output. Right: Schematic
for a recursive LMS system with adaptive weights.

As a part of our midsemester goals, we had made a simplistic feedforward system which could be
clipped on, and was essentially independent of the headphones used. But, the user would have to man-
ually adjust the pre-amp gain in order to obtain the best possible performance that could be obtained.
We were faced with several issues with the placement of the clip-on platform. The performance of any
such system would have to be robust enough to deal with variations in the position of the clip on mic.
Also, we would require the clipping to be extremely robust and resistant to mechanical wear and tear.
Even if we were to make sure that this is the case, the maximum amount of cancellation that we could
get would be limited to 5-6 dB, which is a constraint imposed on pure feedforward systems due to the
absence of error feedback.

Thus, we finalized on a non clip-on system which would have the microphone placement integrated
with the headset. In our new feedback setup, the headphones are an integral part of the system and

8
may be used to obtain a good system. We ensured that the headphones are circumaural so that the
passive attenuation of higher frequencies is quite high. This would then match very well with the
attenuation introduced by the active noise cancellation system at low frequencies - leading to an over-
all quieting effect. We chose “i-ball rocky” circumaural headphones with an impedance of 32 Ω, and
with a frequency range of 20 − 20000 kHz in order to implement our noise cancelling headset. This was
quite cheap (lesser than Rs. 500) and was giving a perceptible passive attenuation.

3.2 Block Diagram for Analog Noise Control System


In the implementation of a noise canceling system through analog circuits, we view our system in terms
of the convention of automatic control theory. Our goal is to ensure that the sound reaching the ear
canal continuously tracks the music that is input to the system, irrespective of the presence of an
external disturbing noise. Thus, our objective is to build a tracking control system which follows
the music and rejects disturbances of external noise. We may achieve this via the negative feedback
of the output signal via a transducing microphone placed inside the housing of the headphones. A
schematic block diagram is presented below:

Figure 9: A schematic diagram of the complete control system. Key: blue - electrical domain, orange
- transducers between the electrical and acoustic domains, green - acoustic domain. We see that this
is a classical negative feedback system with cascade compensation. This topology is based upon the
system implemented in Ref. 2.

The input is the voltage signal fed from the portable media player. This is what needs to be tracked.
For our purposes, the output is the acoustic signal fed to the ear canal. A brief explanation of the
various blocks (some of which are commonly used in controls parlance) is:

• Error detector: This is the block that subtracts the mic pre-amp output from the music to be
tracked.

• Compensator(C): This is the linear system, with some transfer function, which ensures that the
system has the desired closed loop characteristics. This may be implemented via various control
techniques, which we shall soon examine.

• Headphone driver(D): The transducer that converts the electrical signal to mechanical vibra-
tions.

• Cavity Resonances(H1 ,H2 ): This models the behaviour of the headphone/ear-cavity res-
onators, with respect to different positions inside the ear cavity (entrance of the ear canal, mic
pre-amp position).

• Microphone(M): This is the output transducer, which converts the mechanical vibrations in
the acoustic domain, to a low voltage electrical signal.

• Mic Pre-Amp (A): This is the amplifier which magnifies the voltage output of the mic to a
level suitable for processing.

9
• Plant (P): The part of the system which is not explicitly under our control, which is characterised
suitably and the compensator designed on the basis of that. For our design, we would choose to
club together several of the blocks and characterize this combined block as the plant.

3.2.1 Transfer Function


Let the input from the portable media player be Vi (s) and the external noise(disturbance) be N (s).
Let the output pressure signal at the ear canal be denoted as L(s). The transfer functions are denoted
using their corresponding symbols as defined above. Then, the equation around the loop is:

L(s) = (Vi (s) − AM H2 L(s))DH1 C + N (s) (1)


Thus, the closed loop transfer function for the music is:

L(s) DH1 C
GCL (s) = = (2)
Vi (s) 1 + AM H1 H2 CD

and for the noise:


L(s) 1
RCL (s) = = (3)
N (s) 1 + AM H1 H2 CD
It turns out that the plants of H1 , H2 are present together in the final expressions as the ‘plant’:

P (s) = AM H1 H2 D (4)

which consists of the part of the open loop system between the headphone driver and the mic pre-amp.
Later on, we shall see that it turns out to be quite convenient to completely ignore the acoustic domain
behaviour, and look at the entire system between the driver and the mic pre-amp as a plant to be
cobtrolled. In terms of this plant transfer function, our various transfer functions turn out to be:

Music Open Loop Transfer Fn. = GOL (s) = DH1 C (5)

DH1 C
Music Closed Loop Transfer Fn. = GCL (s) = (6)
1 + PC
1
Noise Closed Loop Transfer Fn. = RCL (s) = (7)
1 + PC

Open Loop Gain = CDH1 H2 M A = CP (8)


It is now quite clear why we define and work with the system P (s). Also, another advantage is that
this system has electrical input as well as output, thus negating the requirement for sensitive acoustic
domain instruments to measure sound levels. Thus, we may proceed with an electrical interface in
order to characterise what we call the ‘plant’ and then design a compensation network around that.
But, in the process, we are sacrificing on our ability to change the mechanical setup so as to obtain
advantages in the system design.

3.2.2 Requirements in final system


We shall now briefly recap our final goals in the control system design so as to keep things in perspective.
The requirements of the final closed loop system can be expressed in terms of the following:

• High Open loop gain: If we have a high gain value in the frequency range of interest, we
see that the noise closed loop transfer function goes lower, leading to a better amount of noise
cancellation. Also, we would require the closed loop transfer function with respect to the music
signal to be almost constant, in order that the system faithfully tracks the input music. This
would also happen if the open loop gain |P C(jΩ)| is high, leading to a good music tracking. Thus
we have incentives for maintaining a high controller gain.

10
• Closed loop stability: By the Barkhausen criterion, if we have that the round-loop gain is
greater than 1 where round-loop phase is 180o , then we have closed loop instability. This would
be highly undesirable as the user would get to hear a very high magnitude tone-like sound. This
phenomenon is known as howling - and we would clearly like to keep gain low enough around
the round-loop phase inversion points so as to avoid such instabilities.

Thus, we see that we have two fundamentally contradictory criteria - one of high open loop gain so as
to promote high noise cancellation - another of limited open loop gain so as to maintain robust gain
and phase margins. We shall see how this can be done and how this affects our bandwidth of noise
cancellation.

4 Plant characterization
In the previous sections, we had a brief look at some common implementations of noise cancelling
headsets, and narrowed down towards analog feedback noise canceling systems. We then had a look
at a particular topology implemented by Bose (Ref. 2), and examined the goals of a possible control
system design including a cascade compensator. The design process begins with identifying the plant
in terms of its frequency response. The characterization results are presented only for the left channel.
Right channel frequency response data can be found in Appendix A.
As in the previous section, we would like to treat the plant in purely electrical terms - looking be-
tween the headphone driver and the mic pre-amp output, so that we may conveniently obtain frequency
characteristics. In the characterisation process, we include:

• Headphone driver(D) - which is simply an appropriate audio op-amp feeding a voltage to the
headphone actuator

• Cavity resonances(H1 ,H2 ) - the acoustic domain resonances that arise at certain frequencies
due to the cavity formed between the pinna and the headphone

• Microphone(M) - an electret microphone with a certain polarity, which detects pressure vari-
ations inside the housing of the headphones and transduces them to voltages of the order of
10µV

• Mic pre-amp(A) - An op-amp based amplifier and DC blocker from Ref. 2. It amplifies by
6.6 times and is sufficient to provide a detectable output which can be measured by conventional
DSO’s accurately.

In order to obtain a correct estimate of the effect of cavity resonances, we ensure that the plant
characterisation conditions match as closely as possible with the conditions of usage. Thus, during the
characterisation process, the headphones were placed on the head of a person in the normal hearing
condition. Tones of different frequencies and sufficient intensity to mask over background noises were
fed to the headphone driver - and the final output was recorded on a computer via the mic pre-amp
output. This was recorded as the final output - and the gains and phases of this were combined to yield
a complete result. This was done for both left and right channnels of the headphones. Note that the
mic pre-amp just provides a gain, which can be adjusted for later. Thus, we fix on the mic pre-amp
gain for a particular experimental characterisation and use that data later with the final pre-amp we
design for by adjusting the gain of the plant.

11
Figure 10: A schematic diagram for the connection of the blocks during the plant characterisation. We
feed a pure tone from the signal generator to the cascade, measure the output from the mic pre-amp.
Someone must be wearing the headset for an accurate simulation of the plant cavity resonances.

We carried out two characterisation runs of the plant, each time with a different person wearing
the headset. We observe that there are marked variations in the frequency response of the plant with
the different runs of the experiment. This is an important aspect of the system - it depends sensitively
on the headphone cavity which is affected by the position of the headphones on the user’s ears. The
conclusion is that we must make sure that our compensation design is robust enough to meet even the
worst case variations in the plant. This would be done by maintaining some gain and phase margins
in the design.

Figure 11: Figures corresponding to two different characterisations of the plant. top: The magnitude
plots show variations in gain as well as the resonant cavity peaks; bottom: the phase response. We
observe that their are marked changes in the plant being characterised due to changes in the ear cavity.

Having seen the phase and magnitude plots for the plant, it might be helpful to understand some
of the components of the plant - so that we may design a compensator based upon this qualitative
understanding. So, the salient frequency characteristics are summarised below:

12
• Time Delay: Between the actuator signal being played out and the microphone detecting the
same, there is expected to be a roughly constant time delay due to the physical separation between
the mic and the actuator. This leads to phase falling linearly without constraints as frequency
is increased further - and contributes to the signal reaching −180o rather fast. The presence of
delays leads to special difficulties in control systems.

• Low pass filtering: Though the response of the headphones is stated to be 20 Hz to 20 kHz,
we note that the gain of the headphones would start rolling off at a certain frequency due to the
nature of the physical actuator. Also, a number of resonances are observed at certain frequencies
above 3-4 kHz. These may possibly due to the diaphragm of the speaker being excited at these
frequencies.

• Cavity Resonances: There are pronounced resonances above 4 kHz which may possibly arise
due to these frequencies being resonant in the cavity. Also, at these resonances, we have rapid
changes in phase which would lead to phase crossover points being reached in relatively small
frequency intervals. Thus, we would wish to keep open loop gain to be lesser than 1 at the
frequencies where the resonances occur.

Keeping all these considerations in mind, we shall now focus on the systematic design of a control
system to achieve our stated requirements.

5 Primary compensation network


5.1 Design requirements
The basic purpose of the cascade compensator is to shape the transfer function of the system in the
forward path so as to achieve a stable closed loop system at a large open loop gain, which is required to
achieve disturbance rejection and input following. A broad outline of the compensator design process
is as follows -

1. Fix a certain desired noise cancellation level as an initial design specification, and calculate the
forward path gain required to achieve the same.

2. From the Bode plot of the plant with increased gain, identify the gain and phase crossover points.
Using these points as a starting guideline for potential howling frequencies, design a compensator
to achieve suitable stability margins. In our case, we aim to achieve gain margins greater than 5
dB and phase margins greater than 30o .

3. With the compensator thus designed, compute the resultant closed loop responses for music and
noise. Verify if the noise cancellation specification is met and the music response is better than
that of the uncompensated plant.

In the part of the report that follows on compensation design, we consider the left channel plant.
The right channel compensation design is dealt with in a subsequent section, and as we shall see, we
can retain the design made for the left channel almost entirely. From the plant characteristics (Fig. 4),
we observe that the magnitude response is maximum and reasonably flat over the 100 Hz - 1 KHz range
(between -5 dB and -10 dB). At frequencies above and below this range, the plant gain rolls off and
poses a fundamental limitation to the amount of noise cancellation that can be achieved. We therefore
set our target cancellation bandwidth to the 100 Hz - 1 KHz range.

For the purpose of plant characterization, the mic pre-amp gain was chosen arbitrarily so as to allow
us to obtain a reasonably large voltage output (100s of mV). We now adjust this gain so as to achieve
approximately 0 dB gain over the cancellation bandwidth. This is done in order to normalize the open
loop plant response so as to facilitate easy design. So the mic-preamp gain is increased by a 2× (6 dB)
factor to add to the existing -5 dB. We now design our compensator around this yanked plant, which
we shall refer to as the plant hereafter.

13
Figure 12: Bode magnitude and phase response of plant with a gain of 20 dB. The circled points
indicate the gain and phase crossover frequencies.

1. The noise cancellation figure is defined by the closed loop transfer function (RCL (s)) for the noise
signal. We fix a noise cancellation level of 20 dB at 100 Hz frequency as an initial
design target. From (Eqn 7), assuming zero phase, this would require that at 100 Hz

1 + P C = 10 (9)

Since the plant P has nearly 0 dB gain at 100 Hz, we get |C| ≈ 9. The compensator must
therefore provide a gain of 25 dB at 100 Hz.

2. We now consider the stability of the closed loop system with an added gain of 10× (20 dB). Fig.
12 shows the Bode plot of the plant with a gain of 20 dB. It can be seen that the 180o phase and
0 dB crossover frequencies all lie beyond 1 KHz (Fig. 13). We identify the region beyond 1
KHz as a potential instability region for the closed loop system.

3. From the phase crossover frequencies, we observe that the maximum (and lowest) gain instability
is at 1 KHz with a gain of 10 dB. In order to achieve a stable closed loop system, with a minimum
gain margin of 5 dB, the compensator gain must be at least as low as -25 dB at 1 KHz
with 100 Hz gain as a reference.

4. From the gain crossover frequencies, we observe that the plant already has good phase margins
within 30o . The compensator must therefore continue to maintain phase margins within the 30o
limit by ensuring that its phase beyond 1 KHz is preferably zero or positive.

5. While designing the compensator, we must always bear in mind the tradeoff between cancel-
lation bandwidth and stability margins. Cutting down on gain at 1 KHz and beyond would
inevitably reduce the gain in the cancellation bandwidth as well. We must ensure that the 20 dB
cancellation spec at 100 Hz is not violated in the process of compensator design.

14
Figure 13: Bode magnitude and phase plots of plant zoomed in over potential instability region (beyond
1 KHz).

5.2 Lag and lead compensation


5.2.1 Basic theory
The design requirements arrived at above demand that we achieve a rise/fall in gain over certain
prescribed frequency regions with a corresponding local variation in phase. This is different from the
responses of filters, which typically roll off continually in gain and add permanent phase changes. Lag
and lead networks are commonly used to shape open loop frequency response characteristics to achieve
stable feedback systems. The basic (first order) lag/lead transfer function structure is
 
s + ωz
H(s) = K (10)
s + ωp
For a lag system, the denominator frequency ωp lags the numerator frequency ωz (ωp <ωz ). While
for the lead system, ωp >ωz . Considering the lag system as an example, we observe that we can achieve

1. A stepped attenuation of ωz /ωp achieved gradually over the range (ωp , ωz )

2. A negative phase over a range defined roughly by (0.1ωp , 10ωz ), which dips in between and levels
off to zero outside this range.

Similarly, the lead system achieves a stepped increase in gain and a positive phase over the range
(ωz , ωp ).

5.2.2 Inadequacy of simple lag


Our compensation design problem requires effectively a lag for the frequencies beyond 1 KHz in
order to reduce the gain. However, the phase dip must not be so large that phase margins are reduced.
Further, the transition range for the magnitude response must not be too broad or the cancellation

15
Figure 14: Bode plot of lag 1 achieved with the transfer function H(s) = 0.4(s + 2π1000)/(s + 2π400).
This compensator does not stabilize the closed loop system.

bandwidth would have to be compromised. Figs. 14, 15 show possible designs of a lag compensator for
our plant, which illustrate extremes of these two cases.

1. In Fig. 14, the gain at 100 Hz is not compromised (kept close to 0 dB) so as to maintain the initial
noise cancellation spec. However, the gain achieved at 1 KHz is about -6 dB and is insufficient.

2. In Fig. 15, the desired gain of -25 dB is obtained at 1 KHz. But this is achieved at the expense
of a negative phase as large as −20o in the potential instability region. Also the gain at 100 Hz is
now reduced to -8 dB, thereby reducing the compensator+plant gain to 12 dB (4×). This would
mean a noise cancellation of 1/(1 + 4) → 14 dB, which is far from the initially desired spec of 20
dB.

Thus the simple first order lag is grossly inadequate as a compensator if we are to achieve the
desired amount of noise cancellation. The possibility of using a cascade of two first order lags to realize
a second order lag with a large gain dip is ruled out since this drastically affects the phase response by
allowing phase dips exceeding 90o .

5.3 Second order damped lag design


5.3.1 Basic theory
The inadequacy of simple and cascaded first order lag stages forces us to consider other options. The
compensation design used in the patent by Bose (Ref. 2) relies on second order damped systems to
realize lag and lead networks. On exploring the basic structure of the transfer function for such a
system, we see that it indeed offers significant advantages. A second order damped lag compensator
has a transfer function of the form
 2
s + 2ζz ωz s + ωz2

H(s) = K (11)
s2 + 2ζp ωp s + ωp2

16
Figure 15: Bode plot of lag 2 achieved with the transfer function H(s) = 0.04(s + 2π1040)/(s + 2π40).
This compensator achieves poorer noise cancellation than desired.

where the damping ratios ζz , ζp <1 and ωz >ωp .

The frequency response would therefore be


 2
(ωz − ω 2 ) + j2ζz ωz ω

H(jω) = K (12)
(ωp2 − ω 2 ) + j2ζp ωp ω
The overall low frequency to high frequency dB attenuation is determined by (ωz /ωp )2 and is twice
as large as that offered by a first order system with same frequencies. More importantly, the presence of
damped poles and zeros allows us to have a peak or a dip in the overall attenuating magnitude response
due to the lag behaviour. We may understand this intuitively by considering the magnitude response
of a system with just two damped poles and no zeros as shown in Fig. 16. It can be observed that
with a decrease in damping ratio (i.e. more heavily damped poles), the gain before the pole frequency
tends to peak even more.

For our system, we can therefore understand that we may expect a peak close to the pole frequency
(ωp ) or a dip close to the zero frequency (ωz ) according as ζp and ζz are varied. Since we desire the
latter for our compensator, we use a lower damping ratio for the zeros than for the poles in the design
that follows.

Another advantage of the damped second order system is that the phase response is not directly
determined by the square of the frequency, which is the case with a cascade of first order lags. Fur-
thermore, the damping ratios ζz , ζp also serve as tuning parameters for the phase response. In fact,
choosing ζz , ζp appropriately allows us to achieve a positive going phase at frequencies higher than ωz .
Again this maybe understood by considering the behaviour of the phase response of the simple second
order damped system in Fig. 16.

The second order damped lag system may therefore be used to achieve a dip in the magnitude

17
Figure 16: Normalized magnitude and phase responses of a second order damped system 1/(s2 +2ζωn s+
ωn2 ) for fixed ωn and varying values of damping ratio ζ. Figs. from [9]

18
Figure 17: Bode plot of second order damped lag compensator designed to sharply shape the frequency
response at 1 KHz.

response close to 1 KHz, which can be immediately followed by a sharply rising phase.

5.3.2 Design
1. Since we must design for a maximum gain dip at 1 KHz, we set the numerator frequency fz = 1
KHz

2. The denominator frequency is chosen at fp = 700Hz so as to achieve a 25 dB attenuation at 1


KHz compared to the gain at 100 Hz.

3. Tune ζn , ζp so as to achieve zero phase at 1 KHz. This ensures that we have only positive going
phase beyond this frequency, thereby boosting the phase in the potential instability region. With
ζn = 0.3 , ζp = 7, we achieve a peak phase dip of −70o around 300 Hz and a maximum phase
of 55o around 3 KHz. We note that reducing the phase below 1 KHz is not an issue since these
frequencies have a phase response significantly above −180o .

4. The transfer function of the system thus achieved is

s2 + 0.6(2π)(1000)s + ((2π)(1000))2
H(s) = (13)
s2 + 14(2π)(700)s + ((2π)(700))2

The Bode plot of the system thus designed is presented in Fig. 17.

5.4 First order lag design


With the second order damped lag designed above, we have achieved the desired -25 dB dip at 1 KHz,
which is the maximum gain instability frequency as seen earlier. The attenuation offered by this system
at higher frequencies (-10 dB at 3 KHz) is not sufficient to achieve gain margins of at least 10 dB. We
therefore consider placing a simple first order lag to achieve extra attenuation at these frequencies. The

19
Figure 18: Bode plot of first order lag designed to lower gain at frequencies beyond 1 KHz

positive phase added by the damped lag network designed above provides us with some advantage in
that we may design this new lag with a little less concern about its negative phase contribution.

The pole frequency for this network is chosen as fp =1 KHz. The zero frequency is then adjusted to
the extent that the phase margins are not compromised. With this approach, we arrive at fz =4 KHz.
This gives us an attenuation of around 7 dB at 3 KHz. The resulting transfer function is given below
and the Bode plot is shown in Fig. 18.
0.00078s + 20
H(s) = (14)
0.00015s + 1

6 Circuit Design for Primary Compensation and System Testing


6.1 Design of Mic Preamp
We use an electret mic in the project. An electret mic is a low-cost easily available solution, with a
good response. The electret mic provides a small signal riding on a DC offset. To get rid of the DC
offset, we need to add DC blocking capacitors at the input of the mic preamplifier. However, we do not
want phase to be affected greatly by the presence of the DC blocking capacitors, and want the gain of
the mic preamp to be uniformly flat over the frequency band of interest, namely 20Hz to 20kHz.
Hence, a high-pass filter with a low frequency was chosen. The cutoff frequency of the high pass
filter was chosen to be 0.338Hz. This ensures good DC blocking with a flat response over the frequency
band of interest. Further, the output of the passive filter was connected to a non-inverting amplifier
with a high gain.
The gain of the mic-preamplifier was chosen thus:
We put in an arbitrary gain of 6.6 in the mic preamp and characterized the plant. Then we saw how
much lower the plant magnitude was in comparison to the 0dB line, and the gain of the mic preamp
was adjusted accordingly so as to bring the gain of the uncompensated plant from 100Hz to 1kHz to

20
Figure 19: Sallen-Key Topology for a Second Order Filter

near 0dB. Hence, we found out that we needed a gain of 11 in the left channel and a gain of 17.5 in the
right channel.
Choosing gains in this manner ensured that we would have the response of the compensated head-
phones would be as close to that of the open-loop response, as in, we would have the same sound pressure
levels in the ears for the same input, and also that we would prevent over-driving the headphones.

6.2 Design of Active Second Order Lag System


2 2
The given second order lag function is s s+0.6×2π1000+(2π1000)
2 +14×2π700+(2π700)2 . What we immediately notice is that the

numerator has complex conjugate roots. This makes the design of the Lag system challenging, because
it cannot be made from cascade of familiar first order systems.
We considered many different topologies for the design of the second order lag system. The following
is a brief discussion about the options considered.

6.2.1 Sallen-Key Topology


Sallen-Key filters are extremely popular because of their simplicity. They are widely used to achieve
implementations of second order systems, and hence we decided to try and implement our system on a
Sallen-Key topology.
The Sallen-Key topology is shown in 19. The transfer function of this filter is

vout (s) Z3 Z4
T (s) = = (15)
vin (s) Z1 Z2 + Z4 (Z1 + Z2 ) + Z3 Z4

We shall use only capacitors and resistors in the design. Inductors shall not be used primarily
because of low reliability. We consider each Zi to be a composite, i.e. it contains either a series or a
1
parallel combination of resistors and capacitors, so that either Zi = Ri + sC i
or Zi = sCiRRii +1 .
What we notice with this topology is that complex roots are not possible, because the numerator
of the transfer function hence formed can always be decomposed into a product of linear polynomials
with real roots.
This discounts the possibility of using a Sallen-Key topology for implementing the second order lag
network, which is an essential part of the compensation.

6.2.2 Kerwin-Huelsman-Newcomb (KHN) Biquad Filter


A KHN filter is a wonderful state variable filter. Any LTI system can be represented in state space form,
and can be simulated using integrators, adders and gain blocks. A KHN filter uses this principle and can
simultaneously produce high-pass, band-pass and low-pass outputs using three op-amps. These may
be combined (added) using carefully chosen weights and hence we would obtain the required transfer
function. The topology of the KHN filter is shown in 20.
The term biquad means that the filter realizes a system which contains a quadratic in the numerator
as well as in a denominator. While a state variable filter seems a good and easy option for implementing

21
Figure 20: A KHN Biquad State Variable Filter

the desired transfer function, it requires a large number of op-amps for its implementation. While this
may seem tempting in a lab environment, it is not a good option for a product, as a large number of
amplifiers increase cost, power consumption and size.
In the KHN filter, it is intuitive to check that the output of the band-pass filter shall be inverted
with respect to the output of the low-pass and high-pass filters. This means that in addition to the
three op-amps required to implement the KHN filter, we shall need another op-amp for implementing
an inverter and yet another for implementing an adder. Moreover, the weights attached to the adder
are extremely sensitive to resistor values, and in general, would not give a stable design in the presence
of unfavourable resistor tolerances.

6.2.3 Single Amplifier Biquad (SAB) Filter


Looking up biquad filter designs on the internet led us to the design of the SAB filter presented in [7].
The topology of the SAB filter is shown in 21. The transfer function of the filter is given by

Vo (s) f s2 + Tg s + Tb2
T (s) = =− (16)
Vi (s) s2 + ad s + 1+a(2+b)
T 2 T

where

b+2 = g+e (17)


f +2 = d (18)
T = RC (19)

As always, we find issues with this filter topology too. Though it seems that this topology can
easily suit our needs, and can be used to make arbitrary biquad filters, that is not the case. We have
a total of 8 parameters1 to be chosen, and 8 constraints2 between the parameters, as such, we do not
have any degrees of freedom in being able to implement arbitrary biquad transfer functions.
On computing the required parameters for the given transfer function, we found out that f =
1.3 × 10−3 . f is directly related to the gain of the SAB filter. What this means is that the SAB filter
shall have very low gain. While this may not seem to be a major issue, considering that we may add an
amplifier after this filter to restore the gain; the issues is more serious than meets the eye. At low gains,
1
We need to be able to choose a, b, C, d, e, f , g and R
2
There are 5 constraints relating the ratio of the coefficients in both numerator and denominator of transfer function,
and another 3 constraints mentioned in 17 to 19

22
Figure 21: Single Amplifier Biquad Filter.

Figure 22: Tow Thomas Biquad Filter. Fig. from [8]

the inherent noise in the op-amp becomes comparable to the signal power at the output. This kills the
signal-to-noise ratio (SNR). In a high-fidelity audio application like headphones, this is unacceptable.
This means that we cannot use the SAB topology, but must look for alternatives.

6.2.4 Tow-Thomas Biquad Filter


The Tow-Thomas biquad topology is depicted in 22. It has a transfer function given by
 
C1 2 2 1 1 r 1

Vo (s) C s + C R1 − RR3 s + C 2 RR2
T (s) = = 1 (20)
Vi (s) s2 + QCR s + C 21R2

Finally, it seems as if we may achieve the circuit implementation of the desired transfer function.
We want the gain of the filter to be unity, so CC1 = 1, so C1 = C. Further, we have CR 1
= 2π700,
1
so we get RC. Further, we choose C = 33nF and R = 6800Ω. We also have Q = 14, so we have
 
QR = 485Ω ≈ 490Ω = (270 + 220)Ω. Further, we want C1 R11 − RR r
3
= 0.6 × 2π1000. If we wish
r
that the design be resistant to resistor tolerances, we choose R3  1. So, we choose r = 1kΩ and
R3 = 10kΩ. This allows us to choose R1 = 7188Ω ≈ 7190Ω = (6800 + 390)Ω.
Back-calculating the transfer function from the values of the components chosen, we observe that
the transfer functions match closely. This verifies the design.
The design was then simulated in SPICE (Refer Appendix B). What we observed was that the out-
put of the other two op-amps was around 22dB higher than the output of the system at low frequencies.
This is a limiting factor in the dynamic range of the circuit.

23
Figure 23: Experimentally measured magnitude and phase responses of second order damped lag
network implemented using Tow Thomas biquad topology.

Thankfully, this is not a concern here. We have around 26dB of gain at low frequencies in the H/F
lag compensator, and this ensures that the dynamic range of the system is limited only by the rail
voltages.
The preceding discussion also gives us some idea about the order of the compensation to be inserted
into the system. At the very beginning, we need the L/F lead and the H/F lag compensation to reduce
the signal power at low and high frequencies. Then we have the Tow-Thomas biquad with a limited
dynamic range at the output. After the Tow-Thomas, we have a lag filter with a large gain. This
restores the dynamic range of the signal to the rail voltages.

6.2.5 Characterisation of the Tow-Thomas Biquad


The Tow-Thomas biquad circuit thus designed to implement the second order lag was implemented and
tested by characterizing its frequency response. The resulting data is plotted in Fig. 23. We observe a
good match between this response and the design (17). Note that the phase response is inverted since
the circuit realized is an inverted lag network.

6.3 Design of Active First Order Lag/Lead Networks


Active first-order lag/lead networks use a standard topology. The topology is depicted in 24. It is easy
to check that the transfer function of the topology is
 
1
vo (s) C1 s + R 1 C1
T (s) = =−   (21)
vi (s) C2 s + 1
R 2 C2

To achieve the first order lag network with transfer function 5 s+2π4000
s+2π1000 , we choose R1 = 1.2kΩ,
R2 = 24kΩ, C1 = 33nF and C2 = 6.8nF.

SPICE simulation results for the Tow-Thomas biquad and the HF lag have been attached in Ap-
pendix B at the end of the report.

24
Figure 24: A Topology for an Inverting Active First Order Lag or Lead Network

6.4 System testing and issues


With the circuits for the two parts of the compensation network implemented, we tried to evaluate the
closed loop system for its noise cancellation and music following characteristics. Two major issues were
subsequently observed -

1. A high frequency howling was occurring at high volumes on the headphones. The output of
the mic pre-amplifier was measured and the frequency of howling was determined to be 5 KHz.
This was very likely due to insufficient gain margin at this frequency (5 dB from the design),
since the compensation was focused at stabilizing the system at 1 KHz and 3 KHz resonances.

2. The bass components of music input fed to the system were perceived to be heavily distorted.
It was realized that this was occurring due to overdriving of the headphone actuator at
these frequencies, thereby resulting in non-linear operation. The headphones were subsequently
tested for voltage levels at which overdriving occurs, i.e. a non-linearity appears in the plant
output. This was compared with the output of the compensator driving the headphones. It was
decided to reduce the compensator gain by 6 dB. One quick solution tried out was to reduce
the compensator (C) gain and proportionately increase the pre-amp (A) gain. Maintaining the
product CA constant ensures that the noise cancellation level is not compromised. However, as a
result, there is a uniform reduction in the sound pressure output of the headphones. Further, this
approach only scales down the magnitude response but does not shape it. As a result, overdriving
continues to occur at high volumes.

7 Modified Compensation Network and System Testing


The problems observed with the primary compensation motivate the need for modifications to the
compensation design. We make the following additions to the existing compensator -

1. A second high frequency lag to improve the gain margin around 5 KHz by at least 5 dB to
overcome the howling at this frequency.

2. A low frequency lead to reduce the gain for frequencies below 200 Hz. We decided to lower
open loop gain at 100 Hz by 6 dB. The reduction in gain at 100 Hz due to this part of the
compensator can be compensated for by increasing the gain of the pre-amp. This ensures that
the cancellation figure remains unchanged.

25
Figure 25: Bode plot of additional first order lag designed to lower gain at frequencies beyond 4 KHz

7.1 Inclusion of LF lead and new HF lag


The design procedure for the new HF lag is similar to that of the one designed for the 1-4 KHz. We
achieve a 5 dB reduction in gain at 5 KHz (and hence a corresponding improvement in gain margin)
and 8 dB reduction at higher frequencies. This was done with fz = 10 KHz and fp = 4 KHz. Fig. 25
shows the Bode plots for this network.
For the LF lead system, we keep the desired 6 dB reduction at 100 Hz as a tab, and we arrive at
the frequencies fz = 50 Hz and fp = 200 Hz. Fig. 26 shows the Bode plots for this lead system. We
can see that we achieve a 12 dB reduction at low frequencies. The phase response is not too significant
considering that the plant in this region is subsequently above −180o .
These circuits are realized with the standard topology for lag/lead networks discussed previously.
The design uses the following component values -
s+2π50
• LF lead s+2π200 , R1 = 100kΩ, R2 = 24kΩ, C1 = 33nF and C2 = 33nF

Figure 26: Bode magnitude plot of first order lead designed to lower gain at frequencies below 200 Hz

26
Figure 27: Block diagram of the entire compensation system showing various lag and lead networks

Figure 28: Bode plot of the entire compensation network

• HF lag 2 25 s+2π5000
s+2π2000 , R1 = 1.8kΩ, R2 = 1.8kΩ, C1 = 15nF and C2 = 47nF. This gives a lag
compensation between 1800Hz and 5800Hz, but we reverify from the simulation that this drift is
acceptable.

7.2 The cascaded compensator and its characterization


To summarize, Fig. 7.2 presents a block diagram of the entire compensation network. We now examine
the cascade compensation design and re-evaluate the stability margins for the forward path system.
Fig. 29 compares the compensated and uncompensated plants and shows stability margins for both
cases. We observe the following important features -

1. A general reduction in gain beyond the 1 KHz region, which was sought, and specifically, a 22
dB reduction at 1 KHz. We achieve stability margins of around 10 dB at the phase crossover
frequencies
2. The phase response is retained almost unchanged, thereby the existing phase margins which are
sufficiently robust are not compromised upon.

The schematic for the entire circuit including the complete compensation network, pre-amp and
adder is attached in Appendix C. SPICE simulations for individual circuits in the compensation
network and that of the entire cascade are also attached in Appendix B.
The entire compensation network was tested for its frequency response. We observe a good match
between the experimentally observed response (Fig. 30) and the design. Note that the phase response
is inverted due to inverting nature of the circuit realized.

27
Figure 29: Bode plots comparing the magnitude and phase responses of the uncompensated plant with
a gain of 20 dB and the compensated plant

28
Figure 30: Experimentally measured magnitude and phase responses for the entire compensation net-
work

7.3 Evaluation of closed loop frequency responses


Figs. and 31 and 32 show the closed loop frequency responses for the music and noise signals, i.e GCL
and RCL with the compensation design in place. Note that 1/|GCL | represents the noise cancellation
function. We observe the following important features -

1. GCL has a maximum dip of 22 dB at 100 Hz. This is the theoretically predicted noise cancellation
figure at 100 Hz. Subsequently, the cancellation rolls off and reaches 0 dB at 800 Hz.

2. The closed loop magnitude response for the music remains almost unchanged when compared to
the open loop plant over the cancellation band. In fact, we observe a flattening of the response
at frequencies below 100 Hz, which is actually an improvement over the plant characteristics. We
expect this to show in better rendering of bass.

3. It can be seen from the closed loop music phase response that the variation in phase over the
cancellation band has been reduced. Compared with that of the original plant (Fig. 4), we observe
a halving in the phase variation over 20 KHz - 1 KHz.

7.4 Compensator for the right channel


We retain the same compensation design for the right channel plant considering that responses of both
channels are not substantially different except for a constant gain factor. This factor is accounted for
by adjusting left and right channel pre-amp gains so that equal gains are achieved for both plants.

In addition, we see from the phase response data that the right channel (Ref. Appendix A) is
roughly inverted with respect to the left. In order to use the same compensation design, we require an
additional inversion. Since we have used up 8 op-amps, that is 2 quad op-amp packages per channel,
it would not be a good idea to add an inverter. So, we decided to invert one of the compensation
networks.
In theory, any of the compensation networks could be changed to non-inverting, however, we decided
to change the low frequency lead network to non-inverting. The topology of of a passive low frequency

29
Figure 31: Bode magnitude response plot showing closed loop transfer function for the noise signal

Figure 32: Bode magnitude and phase plots for the closed loop transfer function for music

30
Figure 33: Passive Lag Network Topology

lead network is shown in Figure 33. The transfer function of the lead network is given as
1
vo (s) s + R1 C
T (s) = = (22)
vi (s) s + R11C + R21C

The output of this network is then fed to a unity gain buffer. In this way, the lead network on the right
channel differs from the left channel.

8 Results and Discussion


In this section, we shall highlight some of the tests we carried out on the complete closed-loop system
in order to evaluate its efficacy in terms of input following and amount of noise attenuation. In the first
experiment we shall evaluate the amount of noise cancellation obtained vs. frequency by using external
speakers to generate an ambient noise tone. Through the second experiment, we wish to identify the
response of the music input to the closed loop system and see if this tallies well with the original plant.

8.1 Noise Cancellation Response Measurements


In this experiment, we play out a tone of 100Hz - 1000 Hz, in steps of 100 Hz, from a speaker connected
to the computer and observe the level of noise cancellation that is obtained for the closed-loop system.
We compare against the case in which the line to the speaker is disconnected and the only attenuation
that is received is passive attenuation. Thus, our control experiment consists of just passive attenuation,
and taking the ratio of the two should give us the effect of just the active noise canceling system.
One run of the experiment is undertaken for each frequency of the ambient tone source. Each run
lasts for 10 seconds of sound recording. We conduct each run of the experiment in two parts. In the
first part (≈ 5 sec), we have the system in closed-loop with the output of the mic pre-amp being fed
via a line-in jack to to the computer for further analysis. Thus, the first part of the run corresponds
to the noise attenuating situation. The transfer function between the noise (N(s)) and the output
(L(s)) is:

0 M AH2
RCL (s) = (23)
1 + PC
In the second part, we disconnect the headphone jack from the rest of the circuit, so that the
feedforward is broken. In this situation, the only measured noise is whatever is reaching the mic
pre-amp and getting fed to the computer via the line-in jack:
0
R (s) = M AH2 (24)

31
Figure 34: A schematic diagram for the connection of the blocks during the noise cancellation exper-
iment. The input is set to zero, as we wish to qualitatively perceive the effect of noise cancellation -
and measure waveforms for the canceling and non-canceling periods.

Thus, we find that the ratio of the two transfer function directly gives us the closed loop noise
attenuation function RCL (s). We have made an assumption in this analysis that the transfer function
of the line-in jack to the computer is unity, or the same for both parts of the same run. This would be
a reasonable assumption to make. The upshot is that the ratio of the amplitudes for the attenuating
and non-attenuating parts directly gives us the noise attenuation ratio at that particular frequency,
thus enabling us to take a frequency characterization of the amount of noise cancellation provided.

Some time-domain graphs of this experiment are attached (measured using the software audacity),
around the 5 second switch-over time between attenuating and non-attenuating modes.
In the above graphs, there is a pronounced low frequency variation riding on the tone which can
be observed to be getting cancelled in the attenuating mode. This is a further indication of the fact
that the system is able to deal with low frequency variations quite well. Indeed, this is in agreement
with the predictions made regarding the noise cancelling behaviour from the plant bode plot and the
compensator transfer function. We repeated this experiment for several frequencies, and the data we
obtained are presented below.
In the analog circuit implementation of the system, we have been using standard tolerance(10%)
resistor and capacitor values and approximate values when exact values have not been possible. This
would induce an error of 10 − 20% in the filter parameters we made. Also, for the two plant charac-
terisations, we observed a marked variability in the plant gain due to the variation of the ear-cavity.
This is an issue often found in the literature on active noise cancellation headsets: the variability of
the plant is often an important problem, specially for adaptive systems. Also, the positioning of the
error-detecting microphone is an important issue, and could lead to different and changing ear cavity
responses depending on slight changes in orientation. (Ref. 3, Ref. 8)

8.2 Music Response Characterisation


In the final count, we are not only interested in the noise cancellation, but also in the response of the
closed loop system to the music. One of the goals in using a feedback control system was to ensure
that the high open loop gain also leads to a flat closed loop response of the plant with respect to the
music, since if the open loop gain is high, we do approach a constant gain for the overall closed loop
system. A comparison of the plant and the open loop system is required, in order to determine how
the net system has been improved with respect to the music.

In order to do this, a characterisation of the open loop system was set up. A tone was supplied at
the music input, and the entire system was connected in feedback. We recorded the output of the mic
pre-amp over a range of frequencies. Thus, what we desired to observe is the transfer function with
respect to the sound reaching the ear canal:

32
Figure 35: top to bottom: waveforms around the switchpoint for ambient tone frequencies of 100 Hz,
400 Hz and 800 Hz respectively; We compare the ratios of the attenuated and normal signals and see
that the noise attenuation transfer function that is measured also qualitatively goes down as frequencies
increase. At 100 Hz, there is a cancellation of almost 18 dB, which goes down to 10 dB at 400 Hz and
almost 0 dB at 800 Hz.

33
Figure 36: A bode plot of the level of noise cancellation expected from the system, and that actually
obtained. blue: expected noise cancellation level from the designed compensator and the plant, green:
experimentally measured noise cancellation obtained; we see that the peak noise cancellation at 100 Hz
has reduced by about 4-5 dB from the theoretically expected system. Reasons for this could include the
variability of the plant, as well as the variability induced due to the resistor and capacitor tolerances.

DH1 C
GOL (s) = (25)
1 + PC
But, we finally end up measuring:

0 PC
GOL (s) = (26)
1 + PC
which is the transfer function with respect to the output of the mic pre-amp. The results that
follow must be interpreted with the assumption that the feedback loop is essentially behaving as a gain
- which is not too far from the truth. Thus, what we observe at the output of the mic pre-amp is a
good indication of the music.
A comparison of the open loop plant (without compensator) and the closed loop system is presented
below:
As we observe, the response is very flat and leads to a very nice bass response as perceived by the
user - leading to a better musical experience over and above the noise cancellation observed. Indeed we
see that in implementing this system, we have not only achieved the major goal of noise cancellation -
but also an advantage in terms of improving the system over all.
Finally, we will conclude with a discussion of some of the issues with the system and possible
improvements that can be made to our project:

• Howling: If the closed loop is unstable, we would obtain a high intensity howling noise - in
essence the circuit would act like an oscillator, and totally fail in its functionality. One way to
prevent this is to keep the open loop gain low enough that the system behaves in a stable manner
- though this would not grant us a high amount of noise cancellation - this is a fundamental
trade-off to the system.

• Transient Response: The microphone pre-amplifier circuit we use is a high pass filter with a
pretty low frequency cut-off of around 0.33 Hz. This would lead to a high time constant of around
3 seconds. Thus, on adjusting the headphones, we observe a series of clicks, and a momentary
reduction in noise cancellation - after which the noise cancellation becomes perceptible. The high
pass filter at the mic pre-amp is for removing the DC offset at the mic output, so we have not
come across a way to rectify this issue.

34
Figure 37: A schematic showing the experiment used to measure the closed loop system characteristics.
We would expect the control system to try to maintain a gain of unity, by the basic nature of negative
feedback.

• Change in Plant: We characterized the left and right channels and found their frequency
responses to be quite similar - and thus decided to use the same basic topology of compensation
circuitry for both the channels. But it might happen that with time, both the plants may drift
in differing ways and lead to entirely different responses. One way to deal with this would be
to design a highly robust control system, with sufficient margins and gains so as to deal with
uncertainties in the plant. Such techniques are a focus of study in automatic control.

• Level of Noise attenuation: The highest level of noise attenuation perceived with this system
was around 17-18 dB at 100 Hz, in a very quiet environment. But, this figure keeps changing
under different testing conditions - going as low as 12 dB under some cases. This kind of a vari-
ability is again due to the changing plant. One possibility under such a condition would be to
go for a hybrid system which would bank upon the analog internal control loop to mitigate the
variations due to changes in the plant, and an external digital control loop, which would give a
high degree of noise cancellation.

9 Conclusion
During the course of this project, we have explored two distinct methods of achieving active noise
cancellation using analog circuits - feedback and feedforward. The feedforward system comes with
inherent limitations of being non-automatic and poor noise cancellation levels. This motivated the
shift towards a feedback approach. The feedback system was based on stabilization using a cascade
compensator - this idea was originally proposed in a patent by Bose. The work in this part of the
project essentially involved the aspects of designing a control system for input following and disturbance
rejection. Starting off with a characterization of the plant, we designed a suitable compensation network
to stabilize the plant and achieve a maximum noise cancellation level of 20 dB and operating in a
cancellation bandwidth of 100 Hz - 1 KHz. The feedback system thus designed was tested for its closed
loop frequency responses for music and noise, and we found the results to match theoretical design
predictions within the limits of plant variation. We recorded a maximum reduction in noise level of 17
dB at 100 Hz. The closed loop music response was found to be improved over the plant in terms of a
flatter response for bass inputs and a lesser phase variation.

35
Figure 38: top: The original plant, without any control setup - the blue and green curves correspond
to different observation data - but the irregular frequency response of both the curves is quite marked,
which is what needs to be emphasized here. middle: The compensated, closed-loop plant, showing
a much flatter magnitude response (blue: theoretical, green: obtained experimentally) bottom: The
phase response is quite flat too - and may be compared with the original phase response - which falls
off very sharply.

36
References
[1] Circumaural headphones, http://en.wikipedia.org/wiki/Circumaural_headphones

[2] S. Wu, Noise Canceling Headphones, Department of Electrical and Systems Engineering, Washing-
ton University in St. Louis, 2008

[3] Ying Song, Yu Gong, and Sen M. Kuo, A Robust Hybrid Feedback Active Noise Cancellation Headset,
IEEE Transactions on Speech and Audio Processing, Vol. 13, No. 4, July 2005

[4] Amar Bose, Headphoning, US Patent No 4,455,675, 1984

[5] http://noise-cancelling-headphones-review.toptenreviews.com/, Review of Active Noise


Canceling Headphones

[6] Sen M Kuo, Sohini Mitra, Woon-Seng Gan, Active Noise Control System for Headphone Applica-
tions, IEEE Transactions on Control Systems Technology, Vol. 14, No. 2, March 2006

[7] T. A. Hamilton, A. S. Sedra, A Single-Amplifier Biquad Active Filter, IEEE Transactions on Circuit
Theory, July 1972

[8] A. S. Sedra and Smith, Microelectronic Circuits, 5th Ed., Oxford University Press

[9] Norman S. Nise, Control Systems Engineering, 5th Ed., John Wiley & Sons, 2009

37
Appendices
A Right channel frequency response characteristics

38
B SPICE simulation results

39
40
C Complete circuit schematic

41
D Final circuit

42

You might also like