You are on page 1of 6

FxLMS algorithm for active noise control

García, Mauricio
Pontificia Universidad Javeriana
Electronic Engineering Department
Optimization Course
Bogotá, Colombia
mauricio_garcia@javeriana.edu.co

Abstract — In this work it is presented a DSP card applications [14], aircraft cabins [17], multi-channel ANC for
implementation method of the FxLMS single channel algorithm automobiles [18], 3d reverberant enclosures multi-channel
for active noise control (ANC). The ANC technique uses the ANC [15], but single channel ANC in 3d reverberant
superposition principle to attenuate acoustical noise. It is
enclosure for single channel, has been little documented,
presented some simulating and experimental results of the LMS
and FxLMS algorithms. The signals used in the ANC are several
always is used multichannel setups (multiple control sources
low frequency tones and a broadband sound signal (air and error sensors) to achieved considerable attenuation of
compressor), which is a machine widely used in industrial approximately 20 dB [16-17]
applications. The experiments are carried out in an enclosure
(control room of approximately 36 cubic meters of volume). This article is divided as follows: Section II, System
description, Section III, Simulation results. Section IV,
Keywords—component; system identification, LMS algorithm, Implementation of the FxLMS algorithm for active noise
FxLMS algorithm, active noise control, Matlab, Simulink, adaptive control in the DSP Texas TSM320C6713DSK, Section V,
filtering, FIR filters, secondary path estimation, transfer function, Conclusions, and Section VI, Future work.
adaptive algorithm, impulse response, FIT, white noise.
II. SYSTEM DESCRIPTION
I. INTRODUCTION (HEADING 1)
For ANC is commonly used two different configurations of
Acoustic noise affects the life quality of the society, causing the FxLMS algorithm, one is a feedback ANC approach
stress and issues related to ear. In most of industries, it exists proposed by Olson and May in 1953 [10], in this scheme, a
machines, which generate high sound pressure levels and can
microphone is used as error sensor and also as reference
be considerate like acoustic noise sources. In order to minimize
the negative effects on employees, generally it is used passive sensor. This control setup is commonly used for control
methods, like acoustic isolation with acoustic barriers (walls), narrow band or predictable noises, one of the applications of
and hearing protectors. These passive techniques are widely this approach is controlling the sound field in headphones and
used, but its performance in low frequencies is poor [1]. hearing protectors [11]. The second is a feed-forward ANC
approach, which uses two sensors, an error sensor and a
Active noise control refers to attenuate acoustic noise at reference sensor. This setup is used for narrow band noise
specific space points, without using passive methods (physical control using a non-acoustic reference sensor “accelerometer”,
barriers or hearing protection), between the noise source and and for broad band noise control using an acoustic reference
the receptor. This technique is based on the wave sensor ”microphone” [7]. In this case, it will be used a
superposition principle, which tells how waves may interfere microphone as the reference sensor. In the figure 1, we can
on a constructive or destructive way, and just adding to the observe the FxLMS block diagram algorithm for feed-forward
existing acoustic field, another wave with the same frequency active noise control.
and amplitude, but opposite phase, then they interfere
destructively and cancel each other out. For ANC algorithm
design purposes, it is used the LMS algorithm invented by the
Standford University Professor, Bernard Widrow and his first
PhD Student, Ted Hoff. In this article it is presented eighteen
(18) offline results for LMS system identification algorithm,
also it is presented twenty one (21) simulation results of the
FxLMS ANC algorithm, and finally the single channel
FxLMS algorithm it is implemented in Simulink to download
it then to the DSP card, in order to obtain experimental real
time results. The simulations are important, because it can be
test if the algorithm is working well and also to compare the Figure 1. FxLMS Algorithm for Feed forward Active Noise
performance of the algorithms between simulations and real Control. [2]
time results. ANC has been widely investigated for
applications like, noise control in air ducts [13], headphones The Primary noise is the undesirable signal, which is tried
to be attenuate, and this is measured by the input microphone
(reference signal). The secondary source (cancelling speaker) h ( n+1 ) =h ( n )−μ ∇ J ( n ) (2)
generates the control signal and finally the primary noise is
attenuated at the physical error microphone position. h ( n+1 ) =h ( n ) +2 μe ( n ) x ( n ) (3)
It is important to know the software elements that are part Where h(n+1) is the coefficient at instant (n+1), μ is the
of the ANC controller, these are: the LMS adaptive algorithm step size which controls the convergence and the stability of the
which update the coefficients of the W(z) adaptive filter, which algorithm, e(n) is the error signal and x(n) is the input signal.
is this case is represented as a FIR filter [8]. The C(z) filter
represented the secondary path estimation or the transfer B. Analitical solution (Least Mean Square) algorithm for
function between the secondary source (control source) and the system identification
error microphone [2].
A. LMS (Least Mean Square) algorithm for system Let us consider de output filter as a FIR filter
identification N−1

In this part it is described the implementation procedure of the y ( n )= ∑ h (k ) x (n−k )= X (n)T h


LMS algorithm for system identification, which will be useful k=0

in active noise control to estimate the secondary path transfer


function. The figure 2, describes the LMS block diagram
Where:
algorithm, for system identification.
T
x ( n )=[ x ( n ) , x ( n−1 ) , x ( n−2 ) ,… .. , x ( n−N +1 ) ]
.
h ( n ) =[ h ( 0 ) , h ( 1 ) , h ( 2 ) ,… .. , h ( N −1 ) ]
Then we can formulate the cost function:
J=E [(d(n)−x(n)T h )2 ]
J=E [(d 2 (n)]−2 E[ d(n) x(n)T h]+E [(x(n)T h)2 ]
(4)
R=E [ x(n)x(n)T ]
Figure 2. LMS algorithm block diagram, for system
(5)
identification
Where x(n) is the input to the system identification
P=E [ x(n )d (n )]
algorithm, which generally is a signal with equal energy in all (6)
the frequencies, in this case it is used white noise as the input Replacing (5) and (6) in (4)
of the system. P(z) is the system to identify, which is the
electro acoustic system (enclosure and transductors). W(z) is J=E [d 2 (n)]−2E [d(n) x(n)T h]+E[ hT Rh ]
the adaptive filter, whose coefficients are updated by the LMS
adaptive algorithm, until the error signal converges to zero. J=E [d 2 (n)]−E[ P T h]−E [ PhT ]+E[ hT Rh ]
For the secondary path estimation, it is necessary an input
and an output, which are the white noise and the signal J =σ 2 −P T h−PhT +hT Rh
d
recorded by the error microphone. Then, it is possible to put (7)
these audio signals (input-output) into the algorithm to identify
the coefficients of the impulse response. Then we find the gradient of (7)
The adaptive algorithm depends of an optimization criterion ∂J (h )
=−P−P+2 Rh
or cost function, which for LMS, is based in minimize the ∂(h)
mean square error, as it is shown in equation 1. Where d(n) is
the desired signal (observed output), and y(n) is the predicted (8)
output. Then we replace (8) in (2)
J=E ¿ h(n+1 )=h (n)−μ (−2 P+2 Rh)
In order to minimize the MSE, it’s used the descendent
gradient method, shown in the equation 2. The equation 3 is the h(n+1 )=h (n)+2 μ( P−Rh)
solution to the descendent gradient method which minimizes (9)
the cost function, and it is obtained assuming that the input and
To make the LMS adaptive filter more practical, our next step
output signals are jointly wide sense stationary processes [12].
is to eliminate, by an approximation, the need to know R and P.
We can form a very rough approximation of R and P, simply
by throwing away the expectation. Thus we use one of the the position which the sound pressure will be attenuate by the
sample values as an estimate of expected value. ANC algorithm. Second, a loudspeaker (control source, M-
^ x(n )x (n )
¿=
T audio Active Subwoofer 10 inches), which will reproduce the
R ¿ (10) input signal, in this case “white noise”. Finally it is reproduce
^ x( n ) d ( n )
¿= the white noise through the loudspeaker for a minute, while
P ¿ the microphone is recording the signal that comes from the
(11) speaker, then, both signals are used (reproduced and
recorded), as the input and output of the LMS identification
Then we replace (10) and (11) in (9) system, respectively. To measure the quality of the
T identification, it is necessary to compare the estimated and the
h(n+1)=h(n)+2 μ( x(n)d (n )−x(n) x(n) h( n)) real outputs; in this case it was used FIT equation 12, which
h(n+1 )=h (n)+2 μx( n)(d (n )−x(n )T h (n)) shows a percentage of similarity. Table 1 shows the test results
with white noise as input (sample rate 8 Khz), for the
h(n+1 )=h (n)+2 μx( n)e( n) secondary path identification.

So we have the same equation (3) which find the coefficients ‖ y−^y‖
that minimizes the mean square error J. FIT =100(1− )
‖ y−mean( y )‖
C. FxLMS (Filtered x Least Mean Square) feedforward (12)
algorithm for active noise control
The FxLMS algorithm it’s a variation of the LMS, it has been Where y is the real output and ^y is the estimated output.
widely used for active noise control, an important
characteristic is that it is required an estimation of the System order FIT Step size Error convergence
secondary path C(z) [7], in the figure 3 it is shown the block μ time
diagram of the algorithm FxLMS, which has four important 100 NA 0.3 Not converge
differences in comparison to LMS. First, the error signal is the 100 NA 0.03 15ms
sum of the desired signal and the control signal, because the 100 51% 0.003 25 ms
100 51% 0.0003 2s
total acoustic field is equivalent to the sum of the sound 100 43% 0.00003 12.5 s
pressure levels that comes from the primary noise and the 100 NA 0.000003 Not converge
secondary source (cancelling speaker). Second, because of
this, the step size μ must be negative. Third, the input to the 400 NA 0.3 Not converge
LMS block must be filtered by the secondary path estimation 400 NA 0.03 Not converge
400 58% 0.003 20ms
C(z), and fourth, for simulation effects, must be included the 400 76% 0.0003 1s
secondary path transfer function H(z). 400 72% 0.00003 9s
400 44% 0.000003 60 s

700 NA 0.3 Not converge


700 NA 0.03 Not converge
700 NA 0.003 Not converge
700 87% 0.0003 0.8 s
700 82% 0.00003 6.7 s
700 58% 0.000003 60 s

Table 1. Testing results for secondary path identification


Figure 3. FxLMS algorithm block diagram, for active noise Some points deserved to be remarked from table 1, if the filter
control (ANC) order is higher: first, to stabilize the algorithm it is necessary
III. SIMULATION RESULTS to decrease the step size. Second, the FIT is higher and the
identification is more accurate, and three, the error signal
In this section will be shown some results for off line converges quickly. Also if the step size is lower, the error
identification with LMS algorithm and simulation results for signal converges slowly.
FxLMS ANC algorithm, in order to evidence the algorithms
behavior before their implementation in the DSP card. B. FxLMS (Filtered x Least Mean Square) ANC results
A. Offine LMS (Least Mean Square) identification results In order to obtain simulating results, it was used the secondary
path estimation (Impulse Response) obtained in the
For LMS algorithm implementation it was used the software preliminary identification stage. In the table 2, it is shown the
Matlab. To obtain results of the algorithm behavior, it was results for error convergence times, using several step sizes μ
used the following elements: first, an electroacoustic sensor
and several orders for secondary path estimation.
(dbx RTA omnidirectional condenser microphone), located at
A. FxLMS Simulink Model
Secondary path estimation Step size Error convergence First of all, it is necessary to make a Simulink model, which
order μ time
will be downloaded to the DSP card, through the compilation
100 -0.0003 Not converge software “Code Composer Studio.” Then it is important to
100 -0.00003 Unstable design the following blocks (algorithms): LMS, Real Time
100 -0.000003 Unstable
100 -0.0000003 120 ms
Convolution and an adaptive FIR Filter. In the figure 4, it is
100 -0.00000003 170 ms shown the block diagram of the Simulink model, for a
100 -0.000000003 1.2 s secondary path estimation of 400 coefficients. Where P(z) is
the plant (primary path transfer function), C(z) is the secondary
400 -0.0003 Unstable path estimation, W(z) is the adaptive filter, C(z)1 is the real
400 -0.00003 Unstable secondary path transfer function, and LMS the adaptive
400 -0.000003 Unstable algortihm. The blocks called “W” are the memory algorithms,
400 -0.0000003 Unstable
which store the update coefficients of the iterative process.
400 -0.00000003 82 ms
400 -0.000000003 346 ms

700 -0.0003 Unstable


700 -0.00003 Unstable
700 -0.000003 Unstable
700 -0.0000003 Unstable
700 -0.00000003 Unstable
700 -0.000000003 Unstable
700 -0.0000000003 Unstable
700 -0.00000000003 Unstable
700 -0.000000000003 375 ms

Table 2.FxLMS simulation results

Some points deserved to be remarked from table 2, if the filter


order is higher: first, to stabilize the algorithm it is necessary
to increase the step size. Second, the error signal converges
Figure 5. Block diagram of the FxLMS algorithm, for
quickly. Also, if the step size is higher, the error signal
active noise control in simulink (400 coefficients)
converges slowly.
B. FxLMS Results in simulink
IV. IMPLEMENTATION OF THE FXLMS ALGORITHM IN THE DSP
To obtained simulation results in Simulink, several audible
TEXAS INSTRUMENTS TSM320C6713DSK
low frequencies were used (60, 80, 100. 120, 140, 160 and 190
For real time processing purposes, it is necessary the Hz). In the table 3 it is shown the results.
FxLMS implementation in a DSP card. To reach the target the
following elements were used: Matlab (Simulink), DSP Texas Frequency (Hz) Error convergence Atenuation
Instruments, Code Composer studio V3.1, USB Sound Card time (dB)
(M-box2), Active subwoofer 10 inches (Control Source), 60 1s 31 dB
Active Tannoy Speaker 6 inches (Primary Source), Senheiser 80 1.3 s 27.4 dB
e614 condenser Microphone (reference microphone), dBx RTA 100 2.3 s 27 dB
condenser microphone (error microphone) and wiring need. In 120 0.6 s 31.4 dB
the figure 4, it is shown the ANC setup. 140 2.5 s 34 dB
160 1.5 s 33.9 dB
190 15 s 30.5 dB

Table 3.FxLMS simulation results in Simulink

Also it was used the compressor noise as input to the Simulink


model, in the figure 6, it is shown the error signal for 400
coefficients and step size μ = -0.0003, using the noise of the
machine (compressor), as input to the control system. This
configuration was used, because it was the only setup which
works well, with 74% of FIT. The other configuration tested
offers no satisfactory results, because the error signal does not
converge or it becomes unstable.
Figure 4. ANC setup (reference microphone at left and
error microphone at right)
Frequency (Hz) Error convergence Atenuation
time (dB)
60 2s 27.6 dB
80 2s 26.4 dB
100 2.4 s 27.3 dB
120 5s 23. 1 dB
140 27 s 21.7 dB
160 45 s 21.3 dB
190 130 s 20.5 dB

Table 5. FxLMS results in DSP

For monitoring purposes, the output of the error signal was


Figure 6. Error Signal using an audio recording of the recorded to a digital audio workstation. In the figures 8 (time)
compressor noise and 9 (frequency), it is shown the error signal for 400
coefficients and step size μ = -0.003, using a frequency of 100
The error signal obtained for simulation in Simulink, for the HZ as input to the control system.
compressor noise (figure 6), gives an attenuation of 6 dB.
C. FxLMS Error convergence time Results in the DSP card
In the same way like in simulink, the low frequencie
signals and the compressor noise were used as input to the
active noise control system. To download the algorithm to the
DSP, it was performed the setup described in the figure 7. As
it can be seen, it is just necessary to used the adaptive filter
W(z), the LMS algorithm and the secondary path estimation
C(z), since the secondary and primary paths are the real
transfer functions of the electro-acoustic system. The block
DAC is the digital-analog converter which sends the control
signal to the control speaker, and the ADC block is the analog-
digital converter which capture the signals from the reference
and error microphone.

Figure 8. Control results in the DSP (100 Hz)

Figure 7 FxLMS Simulink model for implementation in the


DSP card

In the table 5. It is shown the results, for the FxLMS DSP


implementation.

Figure 9. Control results in the DSP (100 Hz)

In the figures 10 (time) and 11 (frequency), it is shown the


error signal for 400 coefficients, μ = -0.0003, using the noise
of the machine (compressor), as input to the control system.
identification systems. Also it can experiment the use of other
digital realizations of FIR or IIR filters direct form II,
transpose, cascade or lattice, etc.

It is important to evaluate the active noise control for smaller


sample rates, since the sample rate used were 8 KHz, and also
evaluate the ANC behavior in the DSP with a control source
which can play higher frequencies, like 500 Hz or higher.
REFERENCES

[1] D. A. Harris, Noise Control Manual: Guidelines for problem solving in


the industrial/commercial acoustical environment, 1st ed. Van Nostrand
Reinhold, 1991, p. 172.
Figure 10. Control results in the DSP (compressor) [2] P.B. Pathak and M.P.P. Hirave “FxLMS Algorithm for active noise
cancellation”, pp. 978-981, 2012.
[3] E. N. Rivas and P. Lischinsky “HERRAMIENTA DE SOFTWARE
LIBRE CON ACCESO”, 2008.
[4] R. A. Quintana-Soler and D.A. Patiño Guevara “Identificación de
sistemas aplicado a un recinto reverberante” pp. 1-10. 2014
[5] LJUNG, Lennart. System identification. Birkhäuser Boston, 1998.
[6] B. Widrow and S.D. Stearns, Adaptive Signal Proccesing, Prentice-Hall.
1985.
[7] S. Kuo, Gan, W, Kalluri, Active Noise Control Systems, Algorithms and
DSP Implementation. New York, 1996.
[8] J. Proakis and D. Manolakis, Digital Signal Proccesing, principles,
algorithms and applications. Prentice Hall. 1996.
[9] S.Y. Radiocomunicaciones, TESIS DOCTORAL Ingeniería avanzada
para sistemas de control de ruido acústico mediante técnicas adaptativas.
Figure 11. Control results in the DSP (compressor) 1998.
[10] Olson, H.F, and E. G. May, “Electronic Sound Absorber,” J. Acoust.
We can observe that the principal attenuation were in the Soc. Am., Vol 25, No. 6, Nov. 1953, pp. 1130-1136
range of 0 Hz to 60 Hz. [11] Gan, W.S.; Mitra, S.; Kuo, S.M.: Adaptive feedback activenoise control
headset: implementation, evaluation an its extensions. IEEE Trans.
V. CONCLUSIONS Consum. Electron., 51 (3) (2005), 975–982.
[12] Diniz, P. S. (1997). Adaptive filtering. Boston, MA: Kluwer.
It is important to consider that the control in the DSP it
[13] Kostek, T. M., & Franchek, M. A. (2000). Hybrid noise control in ducts.
worked only to 190 Hz, since the control source used was Journal of Sound and Vibration, 237(1), 81-100.
limited to play higher frequencies, because the subwoofer has [14] Kuo, S. M., Mitra, S., & Gan, W. S. (2006). Active noise control system
a High-pass/low-pass linked filter from 50 Hz to 200 Hz. for headphone applications. Control Systems Technology, IEEE
Transactions on, 14(2), 331-335.
The low frequency tones used for ANC in the DSP card were [15] Bao, C., Sas, P., & Van Brussel, H. (1993). Adaptive active control of
noise in 3-D reverberant enclosures. Journal of sound and vibration,
attenuated around 20 and 26 decibels. DSP control tests 161(3), 501-514.
carried out with the compressor noise were unsatisfactory, [16] S. M. Kuo and D. Vijayan, “Adaptive algorithms and experi-mental
since no significant attenuation of the signal was achieved. verification of feedback active noise control systems,”Noise Control
The largest was 4 dB attenuation. Eng. J., vol. 42, pp. 37–46, Mar.–Apr. 1994
[17] S. J. Elliott, P. A. Nelson, I. M. Stothers, and C. C. Boucher, “In-flight
VI. FUTURE WORK experiments on the active control of propeller-inducedcabin noise,” J.
Sound Vibration, vol. 140, no. 2, pp. 219–238, 1990.
It is important to test the behavior of other identification
[18] De Diego, M., Gonzalez, A., Pinero, G., Garcia, C., & Ferrer, M. (2000).
algorithms, like the normalized LMS or the recursive LMS for Acoustic field conformation using multichannel active noise control
active noise control applications. It is possible to design LMS techniques. In Sensor Array and Multichannel Signal Processing
algorithm in frequency domain, in order to reduce processing Workshop. 2000. Proceedings of the 2000 IEEE (pp. 202-206). IEEE.
overloads in DSP. LMS could even be used for online [19] Moon, T. K., & Stirling, W. C. (2000). Mathematical methods and
algorithms for signal processing (Vol. 1). New York: Prentice hall.

You might also like