Simple Secondary Path Modeling for Active Noise Control Using Waveform Synthesis Dubravko Miljković Hrvatska elektroprivreda, Zagreb, Croatia
[email protected] Abstract - Active noise control algorithms for real world applications regularly use some kind of digital filtering and adaptation to compensate for the influence of the secondary path. Such is the FxLMS algorithm with techniques for offline and on-line estimation of the secondary path, suitable both for broadband and narrowband noise. When silencing periodic noise using waveform synthesis, much simplified solution can be used. Instead of a long adaptive filter, a simple delay can be used. After initial off-line calibration, delay values are stored in a lookup table. These values are used later instead of adaptive filter and may change with the frequency of repeating waveform. It is a simple and intuitive solution that poses some restriction on phase response of used secondary source. Due to the low computational requirements it is suitable for implementation using simple and low cost microcontroller.
II.
ANC USING WAVEFORM SYNTHESIS
ANC using waveform synthesis is based on a concept that electronic device resembles waveform of a periodic noise that is later fed with the opposite phase to a source of canceling acoustic signal, speaker, [2-4]. As the noise is considered to be periodic, its waveforms are repetitive. The goal is to generate an accurate waveform for counteracting original noise. This is achieved by playing stored waveform (either loaded initially or learned during the adaptation process). With this method noise cancellation occurs only at the fundamental frequency and frequencies of its harmonics, Fig. 1. The noise in frequency bands between the harmonics is not affected, [4].
Keywords - active noise control, secondary path, modeling, waveform synthesis, periodic noise
I.
INTRODUCTION
Active Noise Control (ANC) is the reduction of unwanted noise by generating canceling acoustic signal that interferes with the original noise [1,2]. The noise encountered in a real world could be narrowband or wideband. It can be random, periodic or a combination of the previous two types. Noise can be stationary, with a spectrum not changing over the time or nonstationary. It can also be nonstationary, but with a slowly changing spectrum. Periodic noise is almost always narrowband noise, as periodicity constraint is much easier to satisfy in a narrow frequency bands for a limited number of frequency components. There exist various methods for ANC that can be classified as feedforward, feedback and hybrid, [1-3]. This paper deals with narrow band periodic noise. Such a kind of noise can be found in rotating machinery, like engines, turbines, propellers and cooling fans. One approach, particularly suitable for cancellation of periodic noise is the application of waveform synthesis, [2-4]. However, a secondary path, consisting of a power amplifier, microphone preamplifier, anti-aliasing filter, reconstruction filter, A/D and D/A converters and the acoustic path from the speaker to the error-microphone, has its own amplitude and phase frequency characteristics that further complicate, otherwise quite a simple concept. A secondary source does not convert an electric signal to a sound with the same efficiency at various frequencies. Also, even more important, phase of generated sound generally differs from the phase of electric signal driving the speaker, and is frequency dependent.
MIPRO 2018/CTS
Figure 1. Frequency spectrum of the noise suitable for ANC using the synchronized waveform generator
A. Block Diagram of Waveform Synthesis ANC System Block diagram of the idealized ANC system using a synchronized waveform generator, suitable for various analysis purposes, is shown in Fig. 2, [2].
Figure 2. Block diagram
1083
Two types of reference signals that are commonly used in such systems for analysis:
traditional provides faster convergence and lower steady state error.
Impulse train (Dirac delta, δ) separated by a time period equal to the inverse of the fundamental frequency of the offending periodic noise Sinusoidal waveform with the same frequency as the corresponding noise intended to be canceled
As no reference microphone is used, there is no hallowing and no need for feedback path neutralization. B. Adaptation Algorithms Adaptation process can be performed using the LMS algorithm or its variants.
L
y k wlk x k l
(1)
l 0
The error signal ɛk is the difference between the desired output dk and FIR filter output, yk (2): (2)
k d k yk
or written in matrix notation, (3), (4) and (5): (3)
k d k X TkWk
yk
k L
f t S t N t
(9)
Coherent averaging, [6-8], can extract a periodic component of the noise and such reconstructed waveform can be used as a canceling signal, Fig. 3.
Figure 3. Noise reduction during coherent averaging process
Let the noise signal, f(t), be sampled at time instants separated by one signal period of T seconds. Each sample at such instants is the sum of deterministic signal component and noise signal component, (i=1, 2, … , n) (10): (10) f iT S iT N iT Averaging over N periods can be described by (11) - (13), x is the input signal and L is the period length in samples:
X k x k
x k 1
...
x k L T
(4)
Wk w 0k
w1k
...
w Lk T
(5)
using the following convention:
Wk
Noise signal expressed by f(t) can be decomposed into two components: deterministic signal component, S(t) and noise signal component N(t), (9):
Traditional LMS Algorithm
The output signal from the filter of the length L is determined by (1), where wlk are filter weights and xk-l input signal at the moment k-l:
Xk
Coherent Averaging
1 N x1 kT N k 1 1 N xˆ 2 x2 kT N k 1
(11)
xˆ 1
(12)
…
input signal in matrix (vector) form at the moment k weight factors in matrix (vector) form at the moment k desired value at the moment k error signal at the moment k length of digital filter
An adaptation of adaptive filter weights using the LMS algorithm expressed in matrix notation using a gradient estimate, [5], is given by (6) and (7): ^ (6)
1 N xˆ L x L kT N k 1
(13)
Over the time noise component, N(t), averages out and only periodic signal component, S(t), remains. Exponential averaging can be used instead of arithmetic averaging, [8], giving more emphasis on the new input signal sample. A variant of waveform synthesis ANC system closer to the real world implementation, with low pass filters, preamplifier and amplifier, is shown in Fig. 4.
Wk 1 Wk k
Wk 1 Wk 2 k Xk
(7)
Sign-Error LMS Algorithm
Alternative to the traditional LMS algorithm is signerror LMS algorithm, [4]. It is based on the criterion to minimize the absolute value of the instantaneous error signal, (8). (8) Wk 1 Wk sign X k ek Sign-error LMS algorithm is numerically less intensive than traditional, but traditional LMS, but
1084
Figure 4. Waveform synthesis ANC system
MIPRO 2018/CTS
C. Influence of the Secondary Path Frequency and phase characteristic, [9], of one typical speaker is shown in Fig. 5. a b c Figure 7. Noise cancellation for various phase errors between the noise and canceling acoustic signal: a) 45º (some cancellation), b) 60º(neutral), c) 90º (increase), blue - noise, red - canceling acoustic signal, green - sum
Figure 5. Frequency and phase response of typical uncorrected speaker
Frequency response is fairly stable, while phase response is approximately monotonic decreasing and deviates somewhat from linearity.
Figure 6. Typical microphone phase characteristics
Phase characteristic of a typical microphone is shown in Fig. 6. As can be seen, the phase response is mostly flat and adds no significant influence to the phase deviations of the secondary path. Filters, amplifier, and preamplifier should also have as much flat phase response as possible. III.
IV.
COMMON SECONDARY PATH MODELING
The influence of the secondary path has motivated the development of the Filtered-x LMS (FxLMS) algorithm, [5]. Instead of reference signal x, it uses its filtered version x’ by the filter that approximates the transfer function of the secondary path. Block diagram of FxLMS algorithm is shown in Fig. 8, and its variant applied to ANC method employing synchronized waveform generator in Fig. 9. Implementations of ANC using waveform synthesis may not be suitable for application of the FxLMS algorithm (missing reference noise signal, it has just synchro signal). Modeling of the secondary path can be accomplished offline or even on-line (the latter is more complicated). Offline modeling of the secondary path is illustrated in Fig. 10, [4]. It involves system identification of S(z), driven by the source of white noise. The secondary path is approximated by Ŝ(z) using the LMS algorithm. Use of the long adaptive filter and injection of white noise is somewhat complicated, both in adaptation and operation.
CONVERGENCE CRITERION
Canceling acoustic signal should attenuate original acoustic noise. That means that canceling acoustic signal should have equal amplitude, but the opposite phase (180º) of the offending noise signal. Such precision is often difficult to achieve. However, frequency components in the canceling acoustic signal should not deviate in phase more than 60º from its ideal variant, Fig. 7. Hence, phase shift introduced by the secondary path, S(z), must be within the interval around the desired phase for all frequency components of the canceling signal, (14). 60,60
Figure 8. FxLMS algorithm
(14)
If outside this phase tolerance, the canceling acoustic signal would increase the noise level, instead of diminishing it. It is important for the main frequency and its harmonics to satisfy this criterion. To assure that no frequencies outside the desired frequency range are used, high-pass (not needed for a waveform synthesis) and the low-pass filter can be applied to cut frequencies outside the range. Such filters are common elements within various systems with A/D and/or D/A converters anyway. For destructive interference to take place, some tolerances in amplitudes of the canceling acoustic signal are allowed
MIPRO 2018/CTS
(e.g., up to 6 dB overshoot for 0º phase error, 3 dB at 45º and 0 dB at 60º). Amplitude undershoots just slows down the convergence process (dynamic reserve is needed to compensate it for full cancellation). Over the time, resulting cancellation will be much better than in Fig. 7 (just the beginning), as the cancellation process continues on and on with the already partially canceled noise.
Figure 9. FxLMS applied to synchronized waveform generator
1085
TABLE I PHASE SHIFTS AT SAMPLING RATES OF 8000 HZ AND 22050 HZ Frequency 100 200 300 400 500 600 700 800 900 1000
Period (samples) fs = 8000 fs = 22050 Hz Hz 80 4.5 40 9 26.7 13.5 20 18 16 22.5 13.3 27 11.4 31.6 10 36 8.9 40.5 8 45
One sample equals degrees fs = 8000 fs = 22050 Hz Hz 4.5 1.6 9 3.3 13.5 4.9 18 6.5 22.5 8.2 27 9.8 31.6 11.5 36 13.1 40.5 14.7 45 16.3
A. Calibration Process
Figure 10. Off-line modeling of the secondary path
V.
SIMPLE SECONDARY PATH MODELING
Figure 11. Sound propagation path between the secondary source and the error microphone with the corresponding distance
The synchronized waveform generator produces a signal that consists of main frequency and its harmonics. Secondary path modeling must satisfy convergence requirements for these frequency components. Instead of a rather complicated determination of the secondary path, under some restrictions (frequency range of the noise, absence of significant reflections), simple method can be used. There is a delay t of r samples caused by the sound traveling from the speaker to the error microphone, consisting of two delays, first that depends only on the distance s and is not dependent on frequency and a second one that is caused by phase shift of the secondary path and is dependent on the frequency, Fig. 11, [8]. Amplitude deviations across the frequency range of interest are usually relatively small and are not included in this approach (additional multiplication is not justified for a small gain). It is necessary to introduce a delay between the output signal and the signal from the error microphone. Waveform memory with pointers separated by r samples (delay) is shown in Fig. 12, [8]. Phase shifts at sampling rates of 8000 Hz and 22050 Hz are shown in Table I. Better phase resolution per sample can be achieved by using a higher sample rate.
Figure 12. Waveform memory with pointers separated by r samples
1086
Before the system is ready for use, it has to undergo a calibration process where time delays corresponding to phase shifts caused by the secondary path for various frequencies are determined. The calibration is performed using the sinusoidal pilot tone. It is achieved by calculating a correlation between the pilot tone x1 and the signal from the error microphone x2 for various time delays and picking the delay r for which the value of correlation between these two signals is maximal, (15) and (16), [8], s is the distance between the speaker and error microphone, v speed of sound, fs sampling rate, fp pilot tone frequency, τΔ is a delay and γ phase angle for search space (e.g, 90°). r12
0.8
1 N
N
x n x n
n
1
2
sf s sf s 60 f s 60 f s , , 1.2 v 360 f p v 360 f p
r arg maxr12
(15) (16)
Let fmin denotes the lowest frequency to be canceled (sync frequency fm) and fmax, the highest frequency to be canceled. The calibration is performed for all frequencies between fmin and fmax. Signal period T (in samples) is related to frequency by (17): f (17) T s f
Frequency sweep is performed decreasing in steps of one sample between the time periods Tmax and Tmin, corresponding to the frequencies fmin and fmax. Time delays τΔ used in calculation of correlation in each step of the frequency sweep must be from the proximity of the delay used in the previous step (e.g., a small fraction of the period) providing the approximate monotonic function and numerical efficiency. Values of ri determined by (15) and (16) for each frequency fm (i.e., for the corresponding period) are stored in a lookup table of phase delays. There are two phase angles, α and β that are taken into consideration in simple secondary path modeling: α is the maximal acceptable phase shift at the lowest frequency, fmin. β is the maximal acceptable phase shift at the highest frequency, fmax. From the frequency and phase response of the speaker (the main contributor to the frequency dependent phase delay), one can get an idea what frequency range is suitable for ANC operation. It should be a range with the
MIPRO 2018/CTS
flat frequency response, where the phase response is approximately monotonic function (some deviations may be allowed), with the phase preferably close to the linear and with the corresponding phase range of α+β. B. Variants of Simple Secondary Path Modeling Three variants for simple secondary path modeling are considered, one with a fixed and two with a variable delay. Phase delays in samples for angles α and β are: r
f s T max 360 f min 360
(18)
r
f s T min 360 f max 360
(19)
The phase interval [-α,+α] has the corresponding interval in samples [-rα,+rα], and the phase interval [-β, +β] has the corresponding interval in samples [-rβ,+rβ]. Sensitivity to the phase expressed in samples is higher for high frequencies where one sample means a lot for the phase of the signal (period at a high frequency consists of a small number of samples compared to a low frequency), see Table I. The higher sample rate may help (e.g., 720/β or more samples per period of the highest frequency). It is assumed that the values of α and β are lower than 60º. The value of α should be much lower than 45º, as small as possible, ideally close to zero. The goal is to set the smallest phase for one frequency, and provide still satisfactory phases for other frequencies. Lower frequencies are more prominent in a noise and it is beneficial to achieve a lower phase shift for them, providing a faster convergence, hence α < β. Tolerances on phase response, as an approximate monotonic and close to linear function, must assure that phase shift for all frequency components in canceling acoustic signal is less than 60º. Phase shifts θ for values of ri and r0 at frequency f are related by (20), fs is the sampling rate:
360ri r0 f fs
(20)
Fixed Value Delay Phase compensation delay is determined just for one frequency. Delay r0, determined for the lowest frequency, fmin is used for all frequencies, regardless of fm. The algorithm is as follows (all integers): 1. Get the stored delay r0 and calculate rα for the lowest frequency fmin, (18) 2. Get the stored delay ri and calculate rβ for the highest frequency fmax, (19) /* fmax could be lowered in step 4 */ 3. /* Check if the phase for the fmax is within [-β,+β] */ if ri r0 4. if ri r0
≤ rβ
then go to step 5
≤ ( r
r )
/* Phase OK */ /*
ri r0 > rβ */
then /* Modify r0 to get the correct phase for fmax */ if ri > r0 then r0 := ri-rβ else r0 := ri+rβ else /* If not possible to get correct phase for fmax */ It is not possible to determine the acceptable delay r0 for the fmax within an acceptable phase shift for
MIPRO 2018/CTS
the fmin., [-α,+α].Goto step 2 with the next lower frequency fmax (higher Tmin) from the lookup table. 5. Set the low pass filter cutoff frequency to the highest possible frequency fmax. 6. Store the value (r0 mod Tmax) /* mod is used for period limits protection */ Frequency Dependent Value of Delay A variable delay ri is used, depending on the main (fundamental) frequency fm of the noise. During the operation of the system, appropriate delay is selected from the lookup table according to the main frequency, Fig. 13, for adaptation (using the coherent averaging). As the main frequency is changing, it is selecting the most appropriate delay.
Figure 13. Waveform synthesis ANC system with lookup table containing frequency dependent delays (phase delay corrections)
The main frequency is equal to the frequency of sync signal fm. Minimal and maximal values for the main (fundamental) frequency fm are fm,min and fm,max. (e.g., related to the machine rotation speed). The algorithm is as follows (all integers): 1. Get the stored delay r0 and calculate rα for the lowest frequency fmin, (18) 2. Get the stored delay ri and calculate rβ for the highest frequency fmax, (19) /* fmax could be lowered in step 4 */ 3. /* Check if the phase for the fmax is within [-β,+β] */ if ri r0 4. if ri r0
≤ rβ
then go to step 5
> ( r
r )
/* Phase OK */ /*
ri r0 > rβ */
then /* If not possible to get correct phase for fmax */ It is not possible to determine the acceptable delay r0 for the fmax within an acceptable phase shift for the fmin, [-α,+α]. Go to step 2 with the next lower frequency fmax (higher Tmin) from the lookup table. 5. Set the low pass filter cutoff frequency to the highest possible frequency fmax.
1087
6. Loop: (for each period Tm from Tm,max down to Tm,min) do steps 7-9. /* Tm is corresponding to the main frequency fm = fs / Tm changing from fm,min up to fm,max */ 7. Get the stored delay rm and calculate rβ for the frequency fm /*similar to (19), just use fm instead fmax*/
This method considers harmonics in the cancellation signal. It modifies delays ri for the main frequencies fm considering the highest harmonic fhar ≤ fmax instead of fmax.
8. if ri rm > rβ
Numerical complexity (during the ANC operation, per each signal sample) is listed in a Table II below. Simple secondary path modeling methods in comparison with the FxLMS algorithm don’t use additions or multiplications.
then /* Modify rm to get the correct phase for fm */ if ri > rm then rm := ri-rβ else rm := ri+rβ 9. Store the value (rm mod Tm) in the lookup table.
VI.
TABLE II NUMERICAL COMPLEXITY OF SECONDARY PATH MODELING Complexity Additions Multiplications FxLMS L 1) L Fixed delay 0 2) 0 Variable delay 0 0 Variable delay (harmonics) 0 0 1) L is the filter length 2) 0 means no operation
Frequency Dependent Value of Delay for the Harmonic Content Only
Method
Considering that only main frequency and its harmonics (due to the repeating waveform) are present in a canceling acoustic signal, procedure from steps 7-9 can be further elaborated in the new variant (steps 7-12): 1. Get the stored delay r0 and calculate rα for the lowest frequency fmin, (18) 2. Get the stored delay ri and calculate rβ for the highest frequency fmax, (19) /* fmax could be lowered in step 4 */ 3. /* Check if the phase for the fmax is within [-β,+β] */ if ri r0 4. if ri r0
5. 6. 7. 8. 9.
≤ rβ
then go to step 5
> ( r
r )
/* Phase OK */ /*
ri r0 > rβ */
then /* If not possible to get correct phase for fmax */ It is not possible to determine the acceptable delay r0 for the fmax within an acceptable phase shift for the fmin, [-α,+α]. Go to step 2 with the next lower frequency fmax (higher Tmin) from the lookup table. Set the low pass filter cutoff frequency to the highest frequency possible fmax. Loop: (for each period Tm from Tm,max down to Tm,min) do steps 7-12. /* Tm is corresponding to the main frequency fm = fs / Tm changing from fm,min up to fm,max */ If Tm < 2Tmin then exit /* no more harmonics ≤ fmax */ Get the stored delay rm for the frequency fm For each main frequency fm determine the highest harmonic fhar : k = 2, 3, … (21) fhar = k fm (or for the period)
Thar
T m k
k = 2, 3, …
(or for the period)
fhar ≤ fmax Thar ≥ Tmin
(23) (24)
10. Get the stored delay rhar and calculate rβ for the highest harmonic fhar : f s (25) r ,har
(or for the period) r , har
360 f har T har 360
Active noise control using waveform synthesis is an attractive method for cancellation of periodic noise that is easy to understand and implement, even on a low cost hardware. The influence of the secondary path makes this method a little more complicated. A simple method for the secondary path modeling is presented. Three variants have been proposed, one with a fixed delay and two with a variable delay. Variants with variable delay that changes with the main frequency of the noise are presented without and with considering the harmonic content of the canceling signal. During the ANC operation, main frequency selects a delay stored in a lookup table. Variable delay enables better phase accuracy of the canceling acoustic signal, providing a faster convergence over the wider frequency range. The method is suitable for the ANC using waveform synthesis that lacks the benefit of the available reference noise signal needed for the FxLMS method. REFERENCES [1] [2] [3] [4]
[5] [6] [7]
(26)
11. if rhar rm > rβ,har then /* Modify rm to get the correct phase for fhar */ if rhar > rm then rm := rhar -rβ,har else rm := rhar +rβ,har 12. Store the value (rm mod Tm) in the lookup table.
1088
VII. CONCLUSION
(22)
that is not higher than the highest possible frequency fmax
NUMERICAL COMPLEXITY COMPARISON
[8] [9]
H. G. Leventhall and L. Wong, “A Review of Active Attenuation And Development of an Active Attenuator 'Open Refuge’”, HSE Contract Res. Rpt. No. 4/1988, W S Atkins Engin. Sciences, 1988 S. M. Kuo and D. R. Morgan, “Active noise control: a tutorial review”, Proceedings of the IEEE, Vol. 87, No. 6, June 1999. G. B. B. Chaplin and R. A. Smith, “Waveform synthesis - the Essex solution to repetitive noise and vibration”, Proc. Inter-Noise 83, 1983, pp. 399–402 S. M. Kuo, I. Panahi, K. M. Chung, T. Horner, M. Nadeski and J. Chyan, “Design of active noise control systems with the TMS320 Family”. TI Digital Signal Processing Products - Semiconductor Group, SPRA042, June 1996 B. Widrow and S. D. Stearns, Adaptive Signal Processing, Prentice Hall, 1985 O. Rompelman, and H. H. Ros, “The coherent averaging technique, a tutorial review: Part 1: Noise reduction and the equivalent filter ” J. Biomed. Eng., Vol. 8, pp. 24-29, Jan. 1986. O. Rompelman, and H. H. Ros, “The coherent averaging technique, a tutorial review: Part 2: Trigger jitter overlapping responses and non-periodic stimulation” J. Biomed. Eng., Vol. 8, pp. 30-35, Jan. 1986. D. Miljković, “Active noise control in light aircraft cabin using multichannel coherent method”, Automatika, Vol. 57, No. 4, pp. 1056-1069, 2016. H. Sumoro, A Meaningfull Loudspeaker Phase Response, Understanding Different Views and Thoughts on Phase Response Curves, HX Audio Lab, http://www.hxaudiolab.com/uploads/2/5/5/3/25532092/a_meaning ful_loudspeaker_phase_response.pdf [9 March 2018]
MIPRO 2018/CTS