Filtering_Through_Digital_Signal_Processing_for_Active_Noise_Cancellation
Filtering_Through_Digital_Signal_Processing_for_Active_Noise_Cancellation
Adaptive Filtering Through Digital Signal Processing for Active Noise Cancellation
A thesis
submitted in partial fulfillment
of the requirements
for a baccalaureate degree
in Electrical Engineering
with honors in Electrical Engineering
James K. Breakall
Professor of Electrical Engineering
Thesis Supervisor
Julio V. Urbina
Associate Professor of Electrical Engineering
Honors Adviser and Thesis Reader
ABSTRACT
In environments with ambient noise such as air-conditioning systems and engines, exposure to
high decibels of sound for an extended period of time can prove distracting during
communication and damaging to humans both physically and psychologically. Active noise
cancellation (ANC) is a method used to reduce undesired noise. This thesis details the
programming of digital signal processing (DSP) techniques used to filter out unwanted sound.
The purpose of the explanation and simulation of the Filtered-X LMS FIR adaptive filter in
algorithms and code development will be used for the eventual integration with a DSP processor
or microcontroller that allows for the augmentation of a standard pair of Sennheiser PX100-II
headphones, that do not provide noise isolation or cancellation, into headphones that can cancel
unwanted noise. The headphones will then be used with an Amateur “Ham Radio” in an
environment with unwanted, high decibel sound. This thesis supports the proof of concept
through software simulation and a report of different methods of hardware integration. The
research and development of digital signal processing techniques and hardware integration will
environment.
ii
TABLE OF CONTENTS
ACKNOWLEDGEMENTS ......................................................................................... v
Chapter 3 Adaptive Filter Algorithms and ANC through Software Simulation .......... 17
Chapter 5 Conclusion................................................................................................... 36
BIBLIOGRAPHY ........................................................................................................ 43
iii
LIST OF FIGURES
Figure 5: Block diagram of adaptive feedback for an Active Noise Control System [10] ...... 13
Figure 6: Filtered-X LMS algorithm versus the broadband ANC algorithm [8] ..................... 14
Figure 7: Optimization Level versus Effort Required for the TI TMS320C6000 DSP [12] ... 19
Figure 8: Flow chart of the direction search LMS algorithm for ANC applications [9].......... 24
Figure 10: Normalized LMS algorithm estimating the secondary propagation path ............... 28
Figure 11: Plot showing the accuracy of the secondary path estimate of the true path ........... 29
Figure 13: Spectrum analyzer showing filtered-X LMS algorithm cancelling noise .............. 32
iv
LIST OF TABLES
Table 1: High-level block diagram for this thesis and the supporting project ......................... 42
Table 2: Gantt chart for a 14-week design plan for this thesis and supporting project ............ 42
v
ACKNOWLEDGEMENTS
First, I would like to thank my thesis supervisor, Dr. Jim Breakall, for allowing me the
opportunity to further my education in Electrical Engineering concepts with a focus on audio and
sound. His guidance and feedback throughout this process has allowed me to learn and grow as a
student. Many thanks are extended to the faculty of the School of Electrical Engineering and
Computer Science for their guidance on work related to this thesis and the education they have
State. I would like to thank Associate Professors Mark Ballora and Curtis Craig of the Music
Technology program at Penn State for fostering an interest and providing an education in the
relationship between Electrical Engineering and Music Technology. I would also like to thank
the Schreyer Honors College faculty for providing me with the many opportunities and guidance
I have received as an undergraduate student in the college. Finally, my parents, Mike and Susan
Rocci, for supporting me through all of my years of education. They have provided me with
numerous opportunities, guidance, motivation, and the determination to work hard to achieve my
goals and strive to do my best in all situations. I will always be grateful for their love and
support.
1
Chapter 1
Introduction
“To answer a popular question, if we define sound as traveling fluctuations in air pressure, then
yes, a tree falling in the woods with no one nearby does indeed make a sound. If we define sound
to be the electrical signal transmitted by the mechanisms of our inner ears to our brains, then no,
that tree falling in the woods makes no sound.”- Richard G. Lyons, The Essential Guide to
1.1 Motivation
Active noise cancellation is used to reduce the volume of unwanted noise propagating through
air using measurement sensors such as microphones and output actuators such as loud speakers
[1]. The traditional approach to acoustic noise control uses passive techniques that include
enclosures, barriers, and silencers to attenuated undesired ambient sound. Active noise
ineffective or expensive when seeking to achieve the same level of results [4]. Noise levels in
human settings often come under scrutiny for physical health and psychological concerns. Thus
research of active noise cancellation, particularly for intense low frequency ambient noise,
There are individuals who are not overly conscientious about the impact the intensity of sound
has on hearing. Understanding the difference between noise cancellation techniques such as
active noise cancellation can have an impact on the future of ones hearing ability. The effects of
low-frequency noise are of particular concern because of its pervasiveness due to numerous
sources, efficient propagation, and reduced efficacy of many structures in attenuating low-
frequency noise compared with other noise. Low-frequency noise of a high intensity can even
Using active noise cancellation, noise-cancelling headphones can be created to allow for an
improved environment for communication such as Ham Radio operations in environments with
ambient low frequency noise. This project aims to research active noise cancellation techniques,
and how it can be used to improve Ham Radio communication. Although active noise control
can be obtained through the use of analog circuitry, using a digital signal processor allows for
more advanced processing and potential for future development as new advancements in noise-
canceling technology are discovered. The motivation behind the research presented in this thesis
is to help contribute to the understanding of active noise cancellation techniques and integration
with hardware.
3
The scope of this thesis is to provide information on active noise cancellation techniques,
and how it can be used to improve acoustic spaces such as a noisy environment in which a Ham
Radio is being used for communication. In order to accomplish this task, background
information on noise cancellation and its applications is discussed in detail. The main output of
this work is the research of different techniques of active noise cancellation from scholarly
sources and an explanation and simulation of the filtered-x LMS FIR adaptive filter in
MATLAB. The Filtered-X LMS FIR adaptive filter is currently the most efficient and popular
method of providing active noise control. A software simulation in MATLAB is used to realize
this filter to provide a visual representation of active noise control. Along with a software
simulation, different techniques of hardware integration of active noise control using a digital
The following chapters provide an overview of noise cancellation, specific techniques of active
noise cancellation, applications in which active noise cancellation is used, a software simulation
example of active noise cancellation in MATLAB, and the integration of active noise
cancellation with hardware. Chapter 2 focuses on a general background and overview of noise
cancellation. This chapter discusses different types of noise cancellation, different techniques of
4
realizing active noise cancellation in software, and applications and limitations of active noise
cancellation. Chapter 3 focuses on active noise control in MATLAB and Simulink. This chapter
discusses various programming environments for realizing active noise cancellation in software,
filtered-x LMS FIR adaptive filtering, RLS adaptive filtering, and a software simulation model in
MATLAB with supporting figures. Chapter 4 focuses on the integration of ANC algorithms with
hardware. This chapter discuses different hardware solutions for realizing active noise
cancelation using digital signal processing for multiple applications such as noise canceling
Chapter 2
Background
The concept of active noise cancellation has existed since the beginning of the 20th century.
According to a patent issued in 1933, Paul Leug was the first to realize the possibility of
attenuating background noise by superimposing a phase flipped wave. In the 1950s, a successful
demonstration of Lueg’s concept in rooms, ducts, and headsets took place [2]. Research into
active noise cancellation truly began to grow in 1978 after Dr. Amar Bose felt the need to
develop headphones that masked the low rumbling of plane engines and other cabin noises [6].
The invention of integrated circuits, operational amplifier circuits, and miniature microphones
allowed for the existence of active noise cancellation headsets to become possible. As time
progressed, optimal cancellation of unwanted acoustic noise became achievable through the use
of adaptive control algorithms implemented on digital signal processors. This chapter provides a
general background and overview of noise cancellation with a discussion of various methods,
different techniques of realizing active noise cancellation, and some applications and limitations
Noise cancellation technology is used to reduce undesired noise or ambient sound. Two methods
are used to achieve noise cancellation in systems. The first method is passive noise cancellation.
Passive noise cancellation focuses on preventing sound waves from reaching the receiver, the
eardrum in most cases, and is achieved through different noise isolation techniques. Passive
noise reduction does not require power and is very cheap to implement. The ear is insulated from
external noise through the use of an ear cup fitting snugly around the ears to block out ambient
noise. This method can offer up to seventy percent noise reduction if implemented correctly.
The second method of noise cancellation is active noise cancelation or control. It is achieved by
introducing a canceling waveform through secondary sources. These secondary sources are
for the particular cancellation scheme. This method yields better results than passive noise
cancellation, but it requires power to achieve and is more costly. Some headsets provide both
active and passive noise cancellation techniques to yield the best results in reducing ambient
compared to passive noise cancellation through noise isolation [2]. The SI unit of audio
7
frequency is the hertz (Hz). The generally accepted standard human range of audible frequencies
is 20 to 20,000 Hz. This range however is greatly influenced by environmental factors and the
ability of ones own hearing. Active noise cancellation is most effective for ambient noise of a
consistent low frequency within the aforementioned range of audible frequencies. This makes
active noise cancellation the ideal method of noise cancellation to cancel out sound such as a
Through the use of active noise control, noise-cancelling headphones can be created to allow for
an improved environment for Ham Radio operations. Active noise cancelling headphones cancel
the primary noise by summing a secondary anti-noise signal of equal magnitude and opposite
phase with the primary noise as shown in Figure 1. This attenuates the undesired acoustic noises
inside of the ear-cups of the headphones through destructive interference of the primary noise. In
a feed-forward active noise control system, a reference microphone is placed outside the ear-cup
of the headphones to pick up the primary noise of the environment. This reference signal is then
processed by the active noise control system to generate a control signal that drives a secondary
loudspeaker within the ear-cup to produce the anti-noise signal. The error microphone monitors
the performance of the system by measuring the residual noise. The adaptive algorithm then
An adaptive feedback active noise control model is designed by using the estimated secondary
path to synthesize the reference signal rather than using a reference microphone. This allows for
the use of only one error microphone per ear-cup to be necessary. In most active noise control
8
systems, the secondary path includes a digital-to-analog converter, reconstruction filter, power
and an analog-to-digital converter [10]. The acoustic path from the loudspeaker to the error
microphone greatly affects the results achieved by an adaptive filter algorithm at providing noise
cancellation.
Figure 1: Destructive interference inside of noise cancelling headphones [2]. Sound waves created by the
speaker within the headphones cancel noise created by an external source.
Destructive interference provides the physical foundation for active noise cancellation to be
possible. An interference pattern is formed when sinusoidal waves encounter each other and their
amplitudes combine. If the waves are both at the same polarity, constructive interference occurs
9
creating a wave that looks identical to the two waves, but with a larger amplitude. In the case of
destructive interference, the waves are at different polarities and in turn cancel each other out as
shown in Figure 2.
Figure 2: A graphical representation of destructive interference through superposition [5]. The amplitudes
of each waveform match at opposite polarities and cancel each other out.
noise cancellation. If one can deliberately generate a sound wave to oppose the pressure
fluctuations of an unwanted sound wave, then the net result is lowered sound pressure
fluctuation. Active noise control is used to realize this concept for real-world applications.
10
Active noise cancellation was first achieved using analog circuitry. This circuit can be
configuration, and a signal-summing amplifier. These three components lead into one another to
modify an input signal. The circuit schematic contained in Figure 3 was constructed at facilities
through analog circuitry, I will discuss different features of this circuit schematic.
Figure 3: Active Noise Cancellation through analog circuitry [7]. This circuit is made up of three sections.
The first section of the circuit acts as a pre-amplifier that differs the amplitude of the audio signal. The
second section consists of an inverting operational amplifier. The final section consists of a summing
amplifier.
11
The circuit in the schematic contains two separate channels that are identical and run parallel to
provide stereo sound. As discussed above, active noise cancellation is realized by passing an
analog audio signal through three aforementioned sections of circuitry. The non-inverting
operational amplifier in the first section of the circuit acts as a pre-amplifier with an output that
can differ in amplitude from the input audio signal by altering the values of resistors R6 and R8
as shown in Figure 3 [7]. The input signal picked up by the microphone is amplified in this
The next section of the circuit consists of an inverting operational amplifier that inverts the phase
of the input signal by changing the polarity of the signal’s voltage [7]. The output of this
operational amplifier goes into a potentiometer that is used to adjust the gain of the entire circuits
signal up to this point to adhere to different situations. This potentiometer can adjust the
amplitude of the inverted signal to match the amplitude of the unwanted noise that is to be
canceled. The output from the potentiometer is then sent to a summing amplifier.
The final section of the circuit consists of a summing amplifier that combines the inverted noise
signal with an auxiliary input such as speech from a radio or music. The final signal is then
outputted to a device such as headphones. Active noise cancellation is achieved through this
method by matching the inverted signal with the input signal to allow for destructive interference
2.3 Adaptive Filtering Techniques through DSP for Active Noise Cancellation
Digital signal processing can be used to achieve active noise cancellation in place of analog
circuitry. Adaptive filters are used to cope with variations in frequency content, amplitude,
phase, and sound velocity of an undesired noise source in a time varying environment. Adaptive
filters adjust their coefficients to minimize an error signal that can be realized as a transversal
finite impulse response (FIR), recursive infinite impulse response (IIR), lattice, and transform-
domain filters. The most common adaptive filtering techniques are achieved through the least
mean-square (LMS) and recursive least squares (RLS) algorithms. Both of these algorithms will
An adaptive filter consists of an adjustable filter with input X and output Y. The objective is to
minimize the difference between the desired signal and the reference signal after it passes
through the adjustable filter. The difference between these two signals is computed and the
adaptive algorithm adjusts the filter coefficients with the difference [4]. Figure 4 demonstrates
this concept below while a more detailed block diagram of adaptive feedback of an active noise
Figure 5: Block diagram of adaptive feedback for an active noise control system [10].
Adaptive filters in active noise cancellation systems differ from other common adaptive filters in
the existence of cancellation paths, or transfer functions between the outputs of adaptive control
filters and error sensors. Therefore, adaptive algorithms require the cancellation path response
for updating the control filters. This is taken into account by the filtered-x LMS algorithm in
particular by filtering the reference signal with an estimate of the cancellation path transfer
14
functions. These functions are modeled online or at regular intervals in order to maintain the
uncorrelated signal into the cancellation path with a system identification approach. There are
also active control algorithms that exist that do not require an explicit model of the cancellation
path. One such algorithm is the direction search LMS algorithm that takes the standard LMS
algorithm and updates the adaptive filter coefficients directly with the reference signal by
automatically choosing a proper update direction based on the excess noise power of the system
being monitored. The direction search LMS algorithm can converge under all terminal
conditions, however the convergence speed is slower than the filtered-x LMS algorithm [8]. The
experimental results of a broadband active noise cancellation algorithm without cancellation path
modeling compared to the standard filtered-x LMS algorithm is shown in Figure 6. This update
of the standard filtered-x LMS algorithm and online cancellation path modeling is discussed in
Figure 6: The filtered-X LMS algorithm versus the broadband ANC algorithm [8]. The blue plot
represents the filtered-x LMS algorithm, and the red line represents the broadband active noise
cancellation algorithm with online cancellation path modeling applied.
15
Just as previously stated, Figure 6 shows that the direction search LMS algorithm can converge
under all terminal conditions, but the convergence speed is slower than the filtered-x LMS
algorithm. Similar levels of noise cancellation are however achieved by both algorithms.
The adaptive filter algorithms that have been discussed are realized using digital signal
processers to allow for their use with hardware. It is through this method that active noise
cancellation can be achieved using adaptive filtering techniques through digital signal
processing. The rest of this paper will focus on this particular method of achieving active noise
Active noise cancellation has mainly been integrated in headphones and headsets throughout the
past 30 years. Noise cancellation almost requires sound to be cancelled at a source to prevent
phase shifts when combining anti-noise signals with the original signal to cause destructive
interference. This effect works well with headphones and headsets because the original signal
and the cancelling signal are contained within a small area near your ear. This application is ideal
for factory work with ambient low frequency noise. Part of the focus of this research is to turn a
standard pair of Sennheiser PX100-II headphones that provide little to no noise isolation into a
pair of active noise cancelling headphones that can be used for Ham Radio communication. The
objective of these headphones would be to eliminate low frequency noise coming from an air
16
conditioning duct or running engines in the environment where the Ham Radio would be
operated.
With a greater number of companies recently investigating applications of noise control in their
products, new uses of active noise cancellation have begun to be developed. One particular
example is the application of Active Noise Cancellation on Apple’s IPhone 5 to increase speech
quality in cellular communication by cancelling ambient noise. Other applications include active
noise control of transformer noise, natural ventilation windows, and within a communication
chassis [8].
Active noise cancellation does have limitations and disadvantages compared to passive noise
cancellation techniques through noise isolation. It requires a complex system that is often costly
to build and integrate with existing hardware, and requires a power source to operate. The analog
circuitry or hardware that carries out the active noise cancellation algorithms may introduce a
high frequency noise into the desired signal. Active noise cancellation can also not account for
sudden loud noises that occur in the surrounding environment, although a mix of active and
passive technologies may reduce this noise. Phase mismatch can also occur due to the acoustic
superposition in the space from the canceling loudspeaker to the error microphone where the
primary noise is combined with the output of the adaptive filter. This will cause noise to not be
canceled out thoroughly because the input signal and the anti-noise signal will not be exactly 180
degrees out of phase. Minimizing the space between the loudspeaker and the microphone will
Chapter 3
Characteristics of an acoustic noise source are time varying. The frequency content, amplitude,
phase, and sound velocity of the undesired noise are not perfectly constant for a noise in a real
world environment. Therefore, active noise cancellation must be adaptive due to this variation.
An adaptive filter adjusts its coefficient to minimize an error signal. Both finite impulse response
(FIR) and infinite impulse response (IIR) filters are able to achieve active noise cancellation. The
poles of an IIR filter make it possible to obtain well-matched characteristics of lower order
structure, allowing for fewer computations, but IIR filters are not unconditionally stable.
Therefore, the algorithm for an IIR filter may converge to a local minimum rather than the
absolute minimum [4]. It is for this reason, along with a slower convergence rate, that FIR filters
tend to be used for Active Noise Cancelling applications rather than IIR filters. Cancellation
paths play a critical role in active noise control systems, and adaptive algorithms typically
require the information of the cancellation paths to update coefficients. The cancellation path is
the transfer function between the outputs of the adaptive filters and the error sensors. Online
cancellation path modeling can be used to eliminate the need of an explicit model of a
cancellation path within an adaptive filter algorithm [9]. This chapter seeks to provide
information regarding programming environments and languages used for digital signal
processors that carry out Active Noise Cancellation in hardware, an explanation of various
18
adaptive filters and their functionality, and a discussion of a MATLAB simulation that models
MATLAB and Simulink are great environments to test adaptive filter algorithms used for Active
Noise Control, but if the code is to be realized in hardware such as headphones, algorithms are
typically performed on a DSP chip of some kind. These single and floating point DSP chips
support code generation tools that often times support a number of programming languages that
include but are not limited to ANSI C, ISO C++, C6000 DSP assembly, and C6000 linear
assembly. C/C++ programming is most commonly used to program many DSP chips. Texas
Instruments offers a compiler that comes with a set of code generation tools that is capable of
generating the assembly code needed to allow the DSP chip to function. For most applications,
requirements. MATLAB offers a MATLAB Coder that can generate C and C++ code from
MATLAB code. Algorithms can therefore be developed in MATLAB and converted to C and
Figure 7: Optimization Level versus Effort Required for the TI TMS320C6000 DSP for various
programming languages [12].
Looking at a particular digital signal processor as an example, the Texas Instruments C6000 DSP
chip, minimal effort is required to port existing C/C++ code to the processor as shown in Figure
7. Texas Instruments recommends programming most applications for their digital signal
processors in C/C++. Source [12] found in the Bibliography of this thesis elaborates on C code
Although uncommon and mainly used for “Do It Yourself” (DIY) projects, it is possible to create
an active noise cancellation system using nearly any microcontroller. Therefore, an Arduino,
Raspberry Pi, and pic microcontroller could even be used for active noise cancellation projects.
Each of these platforms is coded slightly differently and within different environments.
LabVIEW can also be used in conjunction with National Instrument Compact DAQ and
LabVIEW into hardware. The remainder of this thesis will explain various adaptive filter
20
algorithms and model the standard X-LMS FIR Adaptive Filter in MATLAB to show a software
The most common design used for Active Noise Cancellation makes use of the least-mean-
square (LMS) algorithm. The LMS algorithm is computationally faster than the Recursive Least
Squares (RLS) algorithm, which is vital for active noise cancellation. The filtered-x LMS
algorithm (FxLMS) takes into account the cancellation paths by filtering the reference signal
with an estimate of the cancellation path transfer functions [9]. Conventional least mean squares
algorithms cannot compensate for the effect of the secondary path so the filtered-x LMS
algorithm is used. The algorithm places the secondary-path estimate in the reference signal path
to the weight update of the algorithm. The secondary-path model is usually estimated by
adaptive system identification using white noise as an excitation signal, but replacements to
white noise have been found to work as excitation signals. The secondary signal is generated as
where w(n)[w0(n) w1(n) … wL-I(n)]T and x(n) = [x(n)x(n-1)…x(n-L+1)]T are the coefficient and
signal vectors of respectively [10]. L is the filter order being used. The instantaneous squared
error is minimized by the adaptive filter making use of the filtered-x LMS algorithm by
is the filtered signal vector where the impulse response of the secondary-path estimation filter is
convolved with x(n). The primary noise d(n) can be estimated and used as the reference signal
x(n) for the active noise cancellation filter W(z). The secondary path estimate synthesizes the
reference signal as
The required model can be estimated using white noise. To allow for perfect cancellation in
theory, the adaptive filter must converge to the optimum transfer function expressed as
The filtered-x LMS algorithm works properly for all frequencies when the magnitude response
The Recursive Least Squares (RLS) algorithm uses the method of least squares. Through this
approach, the difference between a desired and estimated signal is squared and summed in order
to find a best fit. RLS uses a deterministic approach to adaptively find a best-fit filter for an
In the above equation, C(n) is to be minimized. ß(n,i) is a weighting factor that prevents the RLS
algorithm from having infinite memory. Having infinite memory would cause the algorithm to
adapt poorly to changes in the system. The initial filter taps in the algorithm are set to zero and
P(0) is defined. The RLS algorithm uses a priori error to update the filter equation. This is the
error that would be produced if the filter coefficients were not updated. This is opposed to the
LMS algorithm that uses a posteriori error. The initialization of the algorithm and its iterations
The convergence rate of the RLS algorithm is typically faster than convergence rates of the LMS
algorithms. This faster convergence rate is achieved by recursively using the inverse of the
correlation matrix of the input signal in order to update the filter. This is done by calculating the
least square solution for the filter coefficient vector in each iteration [13].
23
In comparison to an LMS algorithm, the RLS algorithm typically has an order of magnitude
faster convergence rate and does not depend on the eigenvalue spread of the input signal. The
RLS algorithm operates using matrices and the LMS algorithm uses vectors. A filtered-x LMS
algorithm has been tested and proven to be superior to the RLS algorithm for Active Noise
Cancellation methods. The RLS algorithm may be preferable for lower order filters in the system
being designed [13]. The filtered-x LMS algorithm is more widely used and easier to implement
for Active Noise Cancellation, but an RLS algorithm may outperform the filtered-x LMS
algorithm if using a floating-point digital signal processor rather than a fixed-point digital signal
processor [11].
3.4 Direction Search LMS Algorithm and Online Cancellation Path Modeling
Unlike the standard filtered-x LMS algorithm, online cancellation path modeling used in
conjunction with the direction search LMS algorithm does not need an explicit model of the
cancellation path. By embedding the filtered-x LMS algorithm with online cancellation modeling
and the direction search LMS algorithm, the standard LMS algorithm is adapted to update the
adaptive filter coefficients directly with the reference signal by automatically choosing a proper
update direction based on the monitoring of the excess noise power. The adaptive filter
coefficients converge to optimal values if the phase angle of the modeled cancellation path is
within 90 degrees of the true cancellation path. If the phase angle is outside of the 90 degree
range, the adaptive filter will automatically change the sign in front of the step size. The update
where µc is the convergence coefficient for the cancellation path modeling, and
where µs is the convergence coefficient for the control filter and x(k) is the reference signal [9].
The reference signal in this case is used to update the control filter coefficients without a model
of the cancellation path. The direction search module shown in Figure 8 is used to find the
correct direction for the update of the LMS algorithm. The sign of the convergence coefficient is
changed within this module by observing the amplitude change of the residual error signal [9].
Figure 8: A flow chart of the direction search LMS algorithm for ANC applications [9].
25
As shown in the flow chart above, the direction search LMS algorithm is accomplished in a
2) Freeze the control filter coefficient update for N samples and calculate the mean residual
error power during the N sample period. Then calculate the maximum residual error
3) Update the control filter coefficient and calculate the mean residual error power and the
mean reference signal power for N samples. The amplitude of the residual error signal is
6) Initialize variables.
7) Calculate the mean residual error power and the reference signal power using the moving
average.
8) Redo the direction search if necessary. Otherwise, update the filter coefficients and
This algorithm has a simpler configuration and lower computation load than the standard
filtered-x LMS algorithm. This results in a simple and compact implementation that is suitable
Active noise cancellation using a filtered-x LMS FIR adaptive filter can be simulated in
MATLAB. This simulation shows the attenuation of acoustic noise through the use of active
noise control. The following simulation can be found on the MathWorks website and was
originally developed by MathWorks [1]. In order to showcase how this filter can be used to
cancel out an air conditioning unit in a classroom, adjustment of some of the characteristics was
done, specifically the frequency range of the impulse response of the input-to-error microphone
of the propagation path of the noise to be cancelled. This allows for a synthetic generation of
noise that could come from an air conditioning unit in a lab, office, or classroom setting. The
code for the MATLAB simulation discussed in this section can be found in Appendix A.
To design the simulation, the secondary propagation path must first be simulated. The secondary
propagation path is the path the anti-noise takes from the output loudspeaker to the error
microphone within the quiet zone. For a pair of headphones, the quiet zone exists between the
microphone receiving the error signal on the exterior of the headphones and the speaker built
into the ear-cup of the headphone. For other active noise cancelling applications, this distance
can be larger depending on the area under which ambient noise is to be cancelled. The following
limited to the range of 160 – 2000 Hz with a filter length of 0.1 seconds. A sampling frequency
of 8000 Hz is chosen for the purpose of sampling at a rate appropriate for human speech.
27
Figure 9: The secondary path impulse response of the anti-noise signal. As seen on the chart, the
coefficient value varies between -0.3 and 0.2 at the initialization of the impulse response and quickly
converges to zero within 0.06 seconds.
When designing a system for active noise cancellation, the first task is estimating the impulse
response of the secondary propagation path. This step is performed before the active noise
cancellation takes place and is accomplished by playing a random signal through the output
speaker while the unwanted noise is not present. The MATLAB code in this section generates a
28
random signal that is played for 3.75 seconds and measures the signal present at the error
microphone.
In the next step of simulating active noise cancellation, a secondary propagation path estimate is
developed. The length of the secondary path filter estimate is usually chosen to be shorter than
the actual secondary path. Adequate noise cancellation is still achieved by doing this. A
secondary path filter length of 250 taps was chosen to correspond to an impulse response length
of 31 milliseconds. The normalized LMS algorithm is often used to design the secondary
propagation path estimate [1]. The following plot of the output signal and the error signal shows
Figure 10: The normalized LMS algorithm estimating the secondary propagation path. After 10000
iterations, the algorithm begins to converge. This is shown by the overlap of the desired signal with the
output signal.
29
The following plot shows the accuracy of the secondary path impulse response estimate. The
coefficients of the true and estimated path are shown on the plot. By looking at the plot, it can be
seen that the tail end of the true impulse response is not estimated with perfect accuracy. The
small residual error does not significantly effect the performance of the active noise cancellation
system.
Figure 11: The secondary path impulse response estimate is not perfectly accurate. The tail end of the
true impulse response is not estimated with perfect accuracy as shown by the coefficients of the true and
estimated response plotted together.
30
For this simulation, the propagation path of the noise to be cancelled is characterized by a linear
filter. The MATLAB code in this section generates an input-to-error microphone impulse
response that has a filter length of 0.1 seconds. The noise to be cancelled is modeled in this
section. Active noise cancellation is typically used to cancel noise of a low frequency in nature.
An air-conditioning system is to be modeled in this section, and a bandwidth for the impulse
response is set between 80 Hz and 400 Hz in order to model this type of noise. Approximately 80
to 160 Hz is considered to be in the “bass range” of audio. This is the range for low-end
instruments such as a bass guitar or kick drum. Approximately 160 Hz to 500 Hz is the range
that exhibits a “boxy” sound such as the sound made by hitting a hollow box. From
approximately 500 Hz to 1.6 kHz is considered mid-range and upper mid-range frequencies. The
highest frets on a guitar are around 900 Hz in frequency. This frequency range sounds like the
“wonky” sound made by the teacher from the Charlie Brown cartoons. Using this information
about audio, a bandwidth of approximately 80 Hz to 400 Hz makes sense for the modeling of a
standard air-conditioning unit in an office setting. The following plot shows the primary path
impulse response with the coefficient value on the y-axis and a time scale in seconds on the x-
axis.
Figure 12: This impulse response represents the ambient noise that is to be cancelled in this environment.
This noise has a frequency of between 80 Hz and 400 Hz, making it low in frequency.
31
Now that the noise to be cancelled has been modeled, initialization of active noise cancellation
can occur through the use of the filtered-X LMS algorithm. The secondary path estimate is used
to calculate an output signal that destructively interferes with the external noise at the error
microphone. The reference signal acts as the undesired sound measured near the source of the
sound. A control filter with a length of 44 milliseconds and a step size of 0.0001 is used in the
algorithm.
To create the simulation, MATLAB’s spectrum analyzer is used. The spectrum analyzer shows
the original noisy signal and the attenuated noise. The noise is played initially through the
speakers of the computer and then active noise cancellation takes place and cancels out the noise
as shown by the final image of the spectrum analyzer. No active noise cancellation is used for the
first 200 iterations. Therefore, the only sound heard is the noise at the error microphone before
cancellation. The noise mimics that of an air-conditioning unit. Once the adaptive filter is used,
the resulting algorithm converges after around five seconds. Most of the periodic components
have been attenuated as shown in Figure 13 below. The “whine” created by the simulated air-
Figure 13: This is a spectrum analyzer that is developed by the final section of the MATLAB code. It
shows the filtered-X LMS algorithm cancelling noise after approximately 200 iterations. The original
noisy signal is the white noise being used to cancel the attenuated noise as shown by the high overlap of
the original noisy signal over the attenuated noise, which is diminished to nearly -10 dBm.
33
Chapter 4
In order to integrate an adaptive filter algorithm with hardware for active noise cancellation for
headphones, a digital signal processor, A/D converter, D/A converter, and two miniature
condenser microphones to pick up the noise at each ear-cup will be needed. The hardware that
will be focused on in this section will be the selection of digital signal processors and other
hardware used to run the adaptive filter algorithm developed for active noise cancellation
applications. A digital signal processor (DSP) is a specialized microprocessor designed for fast
speech, audio, and video. In the case of active noise cancellation, the DSP generates the anti-
noise signal to negate the noise signal that is to be canceled. This cancellation occurs in real, or
near-real time. The following hardware solutions provide the processing power to run the
applications. This facet makes them perfect for active noise cancellation applications. The
questions that must be asked when selecting hardware for active noise cancelling applications
are:
34
This series of digital signal processors supports designs involving parallel processing and high
throughput. The digital signal processors are programmed in C/C++ making them very easy to
program as many applications are already developed in C/C++. Code optimization for this series
of digital signal processors can be found in [12]. This source provides architecture and
optimization of C6000 digital signal processors, and the five most effective code optimization
techniques that span over a wide range of applications including active noise cancellation. This
hardware solution would be for a final active noise cancelling product development. The digital
signal processor can be integrated into an integrated circuit board for the development of
sophisticated systems such as a compact design for active noise cancelling headphones.
In order to gain the experience of coding digital signal processor for active noise cancelling
applications and to easily develop and test adaptive filter algorithms integrated with hardware, a
DSP prototype board is the ideal solution. The TMS320C5510 DSP Starter Kit is a low-cost
($295.00) development platform that provides the speed and power-efficiency required for active
noise cancelling applications. This starter kit provides plug-and-play functionality to allow for
The prototype board can be programmed and optimized in the same manner as a standard Texas
Instruments digital signal processor. Through integration with the prototype board, an output
signal produced by the DSP is sent to an external speaker for noise cancellation. All of the
previously mentioned hardware for active noise cancellation can be integrated with the prototype
board. An application report for a similar prototype board used for the development of an active
It is worth mentioning that active noise cancellation can be achieved using National Instrument’s
(NI) LabVIEW and National Instrument’s hardware. Through the use of the NI CompactDAQ
chassis, CompactRIO modules, and a computer running LabVIEW, a portable solution for
experiments involving active noise cancelation can be created. The LabVIEW code can be easily
modified to test multiple adaptive filter algorithms for different active noise cancellation
projects. Looking at a specific case study, error microphones are connected to an NI PCI-4472
signal acquisition board that converts acoustic noises acquired from the PCB-130D20
microphones to digital signals. After LabVIEW performs the processing, the control signal is
generated and sent to an NI Compact DAQ chassis that contains an NI 9263 CompactRIO analog
output module. The module converts the control signal to anti-noise through digital-to-analog
conversion and sends this signal to a loud speaker [14]. This method allows for the creation of a
low-cost, high-performance active noise control system that can easily be adapted to make use of
multiple algorithms. LabVIEW code to be integrated with this setup can be found in [14].
36
Chapter 5
Conclusion
The information, simulation, and resources presented in this thesis will be used to support the
eventual development of a testing interface for adaptive filters used for various active noise
Sennheiser PX100-II headphones, that do not provide noise isolation or cancellation, into
headphones that can cancel unwanted noise. The headphones will then be used with a Ham
which the Ham Radio will be used in may include external noise such as a running air
conditioner unit or fan motor for cooling a power amplifier. The primary path impulse response
of the MATLAB simulation models this type of low-frequency ambient noise. The simulation
shows the effectiveness of the filtered-x LMS adaptive filter algorithm at cancelling a low
frequency signal that models an air-conditioning unit or running motor. Hardware development
incorporating this algorithm will eventually be tested using real world noise and incorporation
Active noise cancellation research in the future will involve its practical use with applications
outside of headphones. One can think of a scenario where an entire city park is isolated from the
37
noise of the surrounding city. Mobile telephones are also beginning to make use of active noise
cancellation technology to allow for better mobile phone communication. As digital signal
processors become cheaper and more powerful on the market, more applications will arise that
5.2 Recommendations
For future work related to hardware development utilizing adaptive filter algorithms discussed in
this thesis, reference sets of the related hardware for integration with external hardware such as
A/D converters, D/A converters, and microphones should be used. As noted within the thesis,
there are programming guides available for multiple digital signal processors that make use of a
variety of programming languages, the primary being C/C++. Through study of the adaptive
filter algorithms presented in Chapter 3 of the thesis, a better understanding of how active noise
cancellation works in theory can be developed. A project such as the design of hardware utilizing
active noise cancellation provides vital experience in digital signal processing in hardware and
environments.
5.3 Conclusions
Audio technology and acoustics are fascinating realms that will be researched for years to come.
Through the manipulation of audio, systems and solutions can be developed that transform our
38
way of life. Active noise cancellation is a fascinating research area with room to grow. This
thesis provides essential background information of adaptive algorithms that provide the
backhaul of active noise cancellation and the methods through which these algorithms can be
integrated with hardware for practical applications. For anyone interested in noise cancellation or
the integration of electrical engineering concepts with audio and acoustics, this thesis can serve
as a bridge into a world that mixes the art of sound and the science of engineering.
39
Appendix A
Appendix B
Supporting Tables
Table 1: High-level block diagram for this thesis and the supporting project
Table 2: Gantt chart for a 14-week design plan for this thesis and supporting project
43
BIBLIOGRAPHY
[1] "Active Noise Control Using a Filtered-X LMS FIR Adaptive Filter", Mathworks.com,
(n.d.). [Online]. Available: https://www.mathworks.com/help/audio/examples/active-noise-
control-using-a-filtered-x-lms-fir-adaptive-filter.html. [Accessed: 06- April- 2017].
[2] Harris, Bill. "How Noise-canceling Headphones Work." Howstuffworks. 16 July 2007
<http://electronics.howstuffworks.com/noise-canceling-headphone.htm>.
[3] Institute of Environmental Medicine, Karolinska Institute, Stockholm, Sweden. "Sources and
effects of low-frequency noise." US National Library of Medicine National Institutes of
Health. May 1996 <https://www.ncbi.nlm.nih.gov/pubmed/8642114>.
[4] Kuang-Hung liu, Liang-Chieh Chen, Timothy Ma, Gowtham Bellala, Kifung Chu. "Active
Noise Cancellation Project" 17 April 2008 <http://www-
personal.umich.edu/~gowtham/bellala_EECS452report.pdf>.
[6] "History of Acoustic Noise Cancelling® Headphones." BOSE. 17 July 2007 <
http://www.bose.com/controller?event=VIEW_STATIC_PAGE_EVENT&url=/
home_entertainment/anch_family/index.jsp&ck=0&pageName=/cgi- bin/htsearch>.
[7] Michael Benoit, Christopher Camastra, Melissa Kenny, Kimberly Li, Richard Romanowski,
Kevin Shannon. "Engineering Silence: Active Noise Cancellation."
<http://www4.ncsu.edu/~rsmith/MA574_S15/silence.pdf>.
[8] Qiu X, Lu J, Pan J (2014) A new era for applications of active noise control. In: Proceedings
of the 43rd international congress & exhibition on noise control engineering. Melbourne,
Australia
<https://www.acoustics.asn.au/conference_proceedings/INTERNOISE2014/papers/p173.pdf
>.
[9] Qiu X, Gao M, Burnett I. A comparison between adaptive ANC algorithms with and without
cancellation path modeling. The 21st International Congress on Sound and Vibration
(ICSV21), Beijing, China, 13-17 July 2014.
<http://www.iiav.org/icsv21/content/papers/papers/full_paper_21_20140310121458493.pdf
>.
44
[10] S. M. Kuo, S. Mitra and Woon-Seng Gan, "Active noise control system for headphone
applications," in IEEE Transactions on Control Systems Technology, vol. 14, no. 2, pp. 331-
335, March 2006.
[11] B. Siravara, M. Mansour, R. Cole and N. Magotra, "Comparative study of wideband single
reference active noise cancellation algorithms on a fixed-point DSP," Acoustics, Speech, and
Signal Processing, 2003. Proceedings. (ICASSP '03). 2003 IEEE International Conference
on, 2003, pp. II-473-6 vol.2.
[12] Paul Yin, “Introduction to TMS320C6000 DSP Optimization,” Texas Instruments, October
2011. <http://www.ti.com/lit/an/sprabf2/sprabf2.pdf>
[13] Jonas Ekelund, Carl-Johan Waldeck, “On Performance and Limitations of Active Noise
Control in Mobile Telephony,” Department of Electrical and Information Technology LTH,
21 June 2012. <http://www.eit.lth.se/sprapport.php?uid=666>
[14] Wang Liang, Gan Woon Seng, Chua Chong Hua, “Creating an Active Noise Control
System Using NI LabVIEW, CompactRIO, and NI CompactDAQ,” Nanyang Technology
University. (n.d.). <http://sine.ni.com/cs/app/doc/p/id/cs-14031#>
Academic Vita of
Michael J. Rocci III
EDUCATION
The Pennsylvania State University, University Park, PA May 2017
• B.S. Electrical Engineering; Minors: Spanish and Music Technology
• Honors in Electrical Engineering with research in Active Noise Cancellation
• Thesis Title: Digital Signal Processing (DSP) for Active Noise Cancellation
• Thesis Supervisor: James K. Breakall Professor of Electrical Engineering
• Reading Writing and Conversational Spanish Language Proficiency
INTERNATIONAL EDUCATION
Engineering Design Study Abroad, San Sebastian, Spain May 2014 – June 2014
• Experience in the engineering design process with international industry partners
• Cross-cultural engineering design teams with students from the U.S. and Spain
• Identification of engineering design problems and evaluation of designs with global parameters
WORK EXPERIENCE
Textron Weapon and Sensor Systems, Wilmington, MA June 2016 – August 2016
• Direct work with a Technical Director and Sr. Electrical Engineer on product development
• Use of lab equipment to obtain data for analysis of hardware both in the lab and in the field
• Wiring layouts and design of analog circuitry using OrCAD software and selecting components
• Performed data analysis using digital signal processing techniques through the use of Matlab
• Participated in weekly meetings with engineers and management related to ongoing projects
Applied Research Lab at Penn State, University Park, PA May 2015 – October 2015
• Research and Implementation of an open protocol communication network
• Worked with PLCs, DAQ devices, real-time communication, and produced technical reports
• Worked with NI Support Engineers to implement a real-time communication network
• Worked with a P.H.D. Engineer to develop and discuss aspects of network implementation