Sunteți pe pagina 1din 6

DEVELOPMENT OF AN ACTIVE NOISE CONTROLLER USING TMS320VC5510 STARTER KIT Mahdi Ghazaei, Alireza Etemadfar mghazaei@gmail.com, etemadfar@yahoo.

com Iran University of Science and Technology, Tehran, Iran Imperial College London, UK

Abstract: Active noise control is dealing with noise cancellation using an anti noise that has been applied to acoustic noise problems and led to satisfactory results. Because of the high processing demand of the ANC algorithms, digital signal processors are good candidates for running them. DSP starter kits have facilitated running and evaluation of such algorithms using DSP chips. In this paper, an experimental model constructed for such systems is described and some practical problems usually occur during hardware and software implementations are also considered. At the end achieved results from the experiments are presented. Copyright 2002 USTARTH Keywords: Active Noise Control (ANC), Adaptive Filters, Control Applications, System Identification, LMS Algorithm.

1. INTRODUCTION Nowadays Acoustic Noise has become a serious problem in our living environment which may expose the humans healthy lifestyle into danger. There are two major approaches for reducing the volume of acoustic noise in the environment: 1. Using passive noise controllers which usually appear as Mufflers in exhaust pipes or sound absorbers in large halls and rooms. 2. Using active noise controllers which produce an anti-noise sound that neutralises the primary noise according to the superposition law. Passive elements are usually bulky, heavy expensive and only efficient for low frequency noise. Therefore, an active controller is much more useful in this frequency range (Kuo and Morgan, 1996). Different types of ANC systems have been developed such as broadband feed-forward, narrowband feed-forward, feedback and multichannel ANC systems (Kuo, et al., 1996). Heating, ventilating, and air conditioning (HVAC) systems are prevalent noise sources around us which

can be conveniently modelled as a single channel broadband noise source. In this paper we have tried to describe a singlechannel broadband feed-forward active noise controller system, implemented on a TMS320VC5510 DSK using FXLMS with feedback neutralisation algorithm. The rest of our paper is organised as follows: Section 2 introduces the theory of noise cancellation by the use of FXLMS with feedback neutralisation algorithm from a new viewpoint. The components and the physical setup of our experimental system are described in section 3. In section 4, the software implementation and its problems are reviewed. In section 5, the experiments and the results are discussed. Conclusions are drawn in section 6. 2. THEORY OF THE SYSTEM AND ITS ALGORITHM A single-channel feed-forward ANC system is demonstrated in Fig. 1. There is a primary noise source at the main duct entry that produces the noise

which is intended to be cancelled at the end of the duct. A secondary loud speaker is placed in the duct to produce the corresponding anti-noise. The ANC controller is responsible of computing a secondary signal that has a 180 degree phase difference with the primary noise at the cancelling speaker junction. This results in a residual sound at the end of the duct that the error microphone can pick it up.

Where x(n) is the input signal, e(n) is the error signal, wi ( n) is the ith weight of the filter in time n and is the learning rate. To ensure the convergence of the algorithm, should be selected such that (Haykin, 1995)
2 (4) LPx Where L is the number of the filters coefficients and Px is the power of signal x(n). 0< <

Fig. 1. Single Channel Broadband Feed-forward ANC System In feed-forward ANC systems, the error microphones signal and a signal which has a high correlation with the primary noise are used to adjust the controller which is usually implemented by an adaptive filter. The error signal has no direct contribution in the control process and it is only used to update the adaptive filter. An adaptive filter is capable of adjusting its weights using a specific algorithm to adapt its performance based on the input signal.

In a practical system there are some additional transfer functions between the digital adaptive filter and the acoustic junction such as the ones corresponding to the power amplifier, the cancelling loudspeaker, a fraction of the duct, the error microphone and the pre-amplifier. Therefore, the effect of these transfer functions can not be ignored during the system identification process. In Fig. 3, these functions are represented by S(z).

Fig 3. Modified ANC Block Diagram Includes S(z) One solution for considering the effect of the secondary path is to use an alternative algorithm named FXLMS (Kuo and Morgan, 1999). In this method x(n) is firstly filtered by S(z) and then used to update the weights. The derivation of this algorithm can be found in (Kuo and Morgan, 1996). However, as it will be illustrated, FXLMS setup is equivalent to a simple adaptive filter configuration. Fig. 2. Noise Cancellation as a System Identification Task (Kuo, et al., 1996). According to the context of the adaptive filter theory, the task of an ANC controller is described as a system identification module or a noise cancellation system that does not contain any signal sources (Kuo and Morgan, 1996). Fig. 2 shows that the digital adaptive filter W(z) should identify the unknown plant P(z) in order to minimise the residual noise i.e. if W(z)=P(z) then e(n) = 0. There are various algorithms can be used for this purpose, however LMS type algorithms are the most efficient ones in terms of implementation due to their simple structure. According to LMS algorithm, new weights are calculated as follows:

Fig. 4. A Demonstrative Configuration. According to Fig. 4, in order to obtain optimum weights which minimise E[e2 (n)] , the conventional LMS algorithm can be used. Its due to the fact that the LMS algorithm only requires information about its input and the error which should be minimised so it is independent from any prior filtering that might affect the filter input. The block S(z) in Fig. 4, can be moved to its front branches without changing the overall transfer function, resulting in FXLMS as illustrated in Fig. 5. Therefore, the weights which will be obtained according to this new configuration are also optimum in terms of the minimum squared error.

w ( n + 1) = w ( n ) x ( n ) e ( n ) e ( n) = d ( n) y ( n)
y (n) =
N 1 i =0

(1) (2) (3)

wi ( n ) x ( n i )

2. Grabbing samples from the reference and the error microphones. 3. Calculating e1 ( n) and e2 ( n)
M 1

e1 (n) = d (n)
e2 (n) = u (n)

f j (n)w(n j 1)
j =0

i =0 L 1

si (n)w(n i 1)

(5)

(6)

Fig. 5. FXLMS Algorithm Block Diagram. Another problem in a practical system is the existence of a feedback path between the cancelling speaker and the input microphone which may cause instability. One solution is to neutralise the feedback by subtracting the effect of the cancelling speaker on the input microphone from the reference signal as illustrated in Fig. 6.

( z ) and F ( z ) , the adaptive filters 4. Updating S weights, using LMS algorithm.


i ( n + 1) = s i ( n) + 1e1 ( n) w( n 1) , i = 0,1,...., M 1 (7) s (n + 1) = f (n) + e (n) w(n 1) , j = 0,1,...., L 1 (8) f
j j 2 2

5. Repeating the above mentioned steps for a few ( z ) and F ( z ) to seconds and saving the weights of S be used during the online cancellation procedure.

Fig. 6. FXLMS w/ Feedback Algorithm Block Diagram.

Neutralisation

Fig. 8. Online Cancellation of Noise.

Online Mode:
1. Grabbing samples from reference and error microphones. 2. Calculating the feedback free reference signal.

Since the transfer functions of the secondary and feedback paths are unknown, they should firstly be estimated before the cancellation process starts. This task is done during an offline session by the use of another adaptive filter as demonstrated in Fig. 7.

x ( n) = u ( n)

fi y(n j)
j =0

L 1

(9)

3. Calculating the anti-noise and driving the cancelling speaker using the corresponding signal.
N 1

y ( n) =

wi (n) x(n i)
i =0 M 1 i =0

(10)

4. Calculating the filtered-X version of the reference signal and updating the weights of adaptive filter W(z)
Fig. 7. Offline Modelling of Secondary and Feedback Paths. To excite all frequencies in the identification process, a white noise source drives the secondary loud speaker. The summary of the steps involved in identification and cancellation procedures is as follows:
x(n) =

si x(n i)

(11)

wi (n + 1) = wi (n) + 3e(n) x(n 1) , i = 0,1,...., N 1 (12)

5. Repeating the online mode algorithm 3. DESCRIPTION OF THE CONSTRUCTED MODEL AND ITS PHYSICAL SETUP The overall block diagram of the system is depicted in Fig. 9. This configuration can be used to model HVAC systems in which there is a single noise source usually located outside of buildings, and it is

Offline mode:
1. Generating white noise samples to drive the secondary loudspeaker.

possible to mount a speaker in the duct to produce the anti noise. For running FXLMS w/ feedback neutralisation algorithm, a TMS320VC5510 DSK board is used as well as some other hardware as follows: 1. Two woofers, one for producing the noise and the other one for producing anti noise. 2. Two electret microphones for producing the input and the error signals. 3. Two preamplifiers. 4. Two 20 Watt power amplifiers for driving the speakers. 5. Four 8th order Bessel filters with f 9 dB = 500 Hz for constraining input and output signals to the noise frequency band. 6. PVC pipes of 6 inch diameter.

ignored during the experiment. The effects of this ignorance will be studied in section 5. Also with the selection of L = 512 and f s = 4KHz the upper limit is calculated as Dmax = 512 343 4000 43.9m . 4. SOFTWARE IMPLEMENTATION The program is developed such that to meet real time requirements based on Texas Instruments guidelines (Texas Instruments, 1990; Spectrum Digital, 2002). Some features such as ping pong buffering, automatic channel sorting with DMA controller and DMA auto initialisation are employed. In ping-pong buffering technique, two separate buffers are used. One of them is named Ping and the other one is named Pong. Always one of these buffers serves the DSP and the other one is used for data transfer. While data is being transferred into Ping (Pong) buffer, the DSP is capable of processing Pong (Ping) buffer without the risk of Pong (Ping) buffer being overwritten. If only one buffer is used, all the process should be performed between arrivals of samples. By this technique, DSP can process data before the receiver buffer becomes full and therefore, it meets the real-time constraints more easily (Spectrum Digital, 2002). In addition to the primary purpose of ping-pong buffering, this method can be exploited in two other beneficial ways: a. Batch updating: Instead of updating filters weights sample by sample so called pattern mode, another strategy can be employed in which weights are updated in a batch (Haykin, 1995). Since DSP receives a batch of data during ping-pong buffering, it can calculate the cumulative change of weights for all the received buffered data and then applies it to the adaptive filter. b. ANC applications usually do not need high sampling rates; however the codec installed on TMS320VC5510 DSK board has a minimum sampling rate of 4 KHz which is probably high for the process required for the modelling of a long duct. The increase in the size of ping-pong buffer as well as processing only the first data sample in the buffer, allows up-sampling and down-sampling operations to be performed easily in order to reduce the processing load. However, the buffer length is limited by the cut off frequency of output and input filters. Since in the developed program the selected sampling rate is 4000 Hz, Nyquist frequency is calculated as 4000/2=2000 Hz. In addition, frequencies higher than 500 Hz are negligible, therefore the down-sampling rate is calculated as L 2000/500=4 (Oppenheim, 1989) which results in a maximum buffer size of 4. Since values of the adaptive filters weights may be unsuitable to be represented by DSP chips registers, they should be normalised. One approach is to scale input signals. The scheme proposed by Kuo, et al. (1996) can be used to reduce W(z) weights and to avoid overflow, while for increasing these weights and avoiding the excessive round-off error, the scheme presented in Fig. 10 is appropriate.

Fig. 9. Overall Block Diagram of Constructed Model.

To design an ANC system some limitations should be considered. The distance between the input microphone and the cancelling speaker can be calculated from the following equations (Kuo and Morgan, 1996): LC0 D = LS = (13) fS
Dmin C0 E (14) Where L is the number of filer taps, C0 the sounds speed in the air, fs the sampling rate and E is the total electrical delay in the circuit. Combination of equations 13 and 14 yields: LC0 C0 E < D < (15) fs Since the electrical delay is dominated by the speaker delay, E can be approximated by the group delay of the speaker. The measurements shows that woofers used in the performed experiment have a large group delay, E 29 ms , in the desired range of frequency.

With this value, the minimum length of the main duct is calculated as Dmin = 0.029 343 = 9.947m which is impractical. Therefore, this constraint was

Fig. 10. Use of Scaling Factor to Increase W(Z) Weights. Considering the fact that 0 < s 1 , x(n) power is reduced by scaling factor which increases the gain demand on the W(z) filter, therefore the magnitude of tap values will be increased. The effect of this scaling factor can be easily demonstrated using Wiener-Hopf equations solution. Wiener-Hopf equation in its compact form is as follows (Haykin, 1995):
Rw o = p (16) Where R is the auto-correlation of the input signal and p is the cross-correlation between the desired value and the input signal.

In the performed experiment, the parameter setting has been fulfilled as follows. In the first step, simple models of offline and online modes were designed separately in Matlab Simulink. Since the real characteristics of primary and secondary paths were not available, they were approximated by the use of low-pass filters and delay lines. Then according to the stability criterion equation (4), the proper value of was selected and tested in the Simulink model. Then effects of changing filters length and scale factors were considered. Finally, based on the achieved values, the final tuning was performed on the real model. Optimum values for the offline sessions parameters were obtained as follows: length of the S(z) filter 1 for the offline mode=1000/32768 ( z ) =1/16 Scaling Factor before S Gain of the secondary path for the 240 Hz frequency = 1 LF=410 length of the F(z) filter MUF=10000 2 for the offline mode=1000/32768 ( z ) =1/16 Scaling Factor before F
MUS=1000

LS= 410

Since the input signal is scaled, x ( n ) = s.x ( n )


R = s 2 R , p = s.p

(17)

1 R 1s.p = w o (18) s s Therefore, to achieve the optimum solution for the new system, weights should be scaled by 1 . s w o = ( R )
1

p =

Gain of the secondary path for the 120 Hz frequency = 0.331

5. EXPERIMENTS AND RESULTS The most important factor that may frustrate results of such a project is the false setting of parameters. Important parameters are: amplifiers gains, scaling factors, value, filters lengths and leaky value. The following points were considered in order to cancel the maximum possible noise power in the designed system: 1. Using maximum ranges of input and output channels of the codec to maximise the signal to quantisation noise ratio 2. Scaling the weights to avoid excessive round off errors 3. Using loud speakers in the linear region of their performance for the desired range of frequencies. 4. For noise cancellation, the received power from each speaker at the error microphone, when they are working individually, must be almost equal. Since the output power of the cancelling speaker propagates upward and downward and it is not received completely by the error microphone, it should be greater than the noise speaker output power. Therefore the main limit is caused by the secondary speaker. 5. In order to avoid overflow of W(z) weights, the output power of the noise speaker received by the error microphone should be less than the received power from the cancelling speaker.

The program written for the offline session was used to identify the primary, the secondary and the feedback paths. Then their coefficients were transferred to MATLAB environment. Frequency responses of mentioned paths are illustrated in Fig. 11. In the next step, by the use of more accurate models of channels, the simulation was performed and proper values for other parameters were selected and confirmed for the constructed model. An important point which was revealed by the simulations is that the system is only able to cancel narrowband and periodic noises. It is clearly because of the ignorance of the causality criterion discussed in section 3. Optimum values for the online sessions parameters were obtained as follows:

LW=512 Length of the W(z) filter MUW=-256 for the online mode= 256/32768 Scaling factor before W(z) = 1/64 ( z ) = 1/16 Scaling factor before S Leaky value = 1 Gain of the preamplifier=3.8 dB

The error signal at some frequencies in the cancellation mode is demonstrated in Fig. 12. Table 1 Attenuation Results for Some Frequencies
Frequency 240 Hz 144 Hz 62 Hz 80+240 Hz Attenuation (dB) 55.96 50.27 42.22 37.38

6. CONCLUSION
Error of normailized 240Hz input signal
0.01

Considering physics of ANC is crucial for achieving the best result in these systems since without a correct physical setup, even the best ANC algorithms will fail. Selection of an appropriate cancelling speaker needs the deepest attention. A large group delay for cancelling speakers may make the system non-causal and therefore, it will be unable to cancel broadband noises. In addition, a non flat transfer function for the secondary path caused by a poor quality cancelling speaker makes it more difficult to attain a uniform attenuation over all frequencies. Optimisation of parameters is also vital for a better noise attenuation in ANC systems. Parameter setting is very time consuming and consists of many trial and error phases as proposed by Kuo, et al. (1996). In a practical system, other problems like overflow, round-off noise and quantisation error make this process even more difficult. A good solution is to firstly transfer a good estimate of actual transfer functions to a simulation environment such as Matlab and then tune the parameters. Using this approach, since signal values can be observed at each node, appropriate scaling factors are calculated much more easily. In the afore mentioned experiment the best attenuation value was 55.96 dB achieved for a single tone noise which shows a slight improvement in comparison with previous experiments (Kuo, et al., 1996).
Magnitude Response
1 0.9

0.008

0.006

0.004

0.002

E r r o r

-0.002

-0.004

-0.006

-0.008

-0.01

50

100

150

200

250 Samples

300

350

400

450

500

Error of normalized 144Hz input signal

0.01

0.008

0.006

0.004

0.002
E r r o r

-0.002

-0.004

-0.006

-0.008

-0.01

50

100

150

200

250 Samples

300

350

400

450

500

Error of normalized multi tone (80Hz+240Hz) 0.02

0.015

0.01

0.005

E r r o r

-0.005

-0.01

-0.015

-0.02

50

100

150

200

250 samples

300

350

400

450

500

Fig. 12. Error Signals for Normalised inputs (from up to down) (a) 240Hz (b) 144Hz (c) 240Hz + 80Hz ACKNOWLEDGMENTS

0.8

0.7

0.6

0.5

Authors thank Dr. Mahmoud Ahmadian for his support and guidance throughout the project and Mr. Alireza Mehrabi, without his kind help this paper would not be published. REFERENCES
0 0.1 0.2 0.3 0.4 0.5 Frequency (kH z) 0.6 0.7 0.8 0.9 1

M a g n i tu d e

0.4

0.3

0.2

0.1

Magnitude Response
1

0.9

0.8

0.7

0.6
M a g n it u d e

0.5

0.4

0.3

0.2

0.1

0.1

0.2

0.3

0.4

0.5 Frequency (kH z)

0.6

0.7

0.8

0.9

Magnitude Response
0.35

0.3

0.25

0.2

0.15

0.1

0.05

Haykin, S. (1995). Adaptive Filter Theory, 3rd Edition, Prentice Hall. Kuo, S.M. and D.R. Morgan (1999). Active noise control: A tutorial review. Proceedings of the IEEE, vol. 87, pp. 943-973, June . Kuo, S.M. and Morgan (1996). Active Noise Control Systems. Wiley, New York Kuo, S.M., Panahi I., Kai M. Chung, Tom Horner, Mark Nadeski, Jason Chyan (1996). Design of Active Noise Control Systems With the TMS320 Family. TI Application report SPRU042. Oppenheim, A.V. and R.W. Schafer (1989). Discrete-Time Signal Processing. Prentic Hall . Spectrum Digital (2002), TMS320VC5510 DSP Documentation. Texas Instruments (1990). Digital Signal processing application with the TMS320 Family theory, algorithm, and implementation. volume 3,Texas Instruments.

M a g n i tu d e

0.1

0.2

0.3

0.4

0.5 Frequency (kH z)

0.6

0.7

0.8

0.9

Fig. 11. (a) Primary Path Frequency Response. (b) Secondary Path Frequency Response. (c) Feedback Path Frequency Response

S-ar putea să vă placă și