翻译[1]-主动噪声消除(ANC)算法研究
主动噪声消除(ANC)算法研究
- 原文地址: [https://github.com/iancraz/ANC-Implementation/blob/master/README.md]
- 许可: MIT license
- 原作者: Ian C. Díaz, Matías Fogg, Lisandro Alvarez, Manuel Dieguez
摘要
现在,主动消噪技术已经被广泛应用于各个领域,从工业到医疗和消费产品。这个研究工作讨论了不同类型的消噪系统以及可以用于实施这些系统的各种自适应算法。该论文重点阐述的是广带前向消噪系统,既是在实际方面,又是在实施方面。这其中包括了使用FxLMS算法和其递归变体FxRLS来实施的讨论。
I:引言
主动噪声消除是一种通过添加另一个波来消除一个波的方法。它通过利用破坏性干涉现象的电声或机电系统来实现。为了实现这一点,它使用一个与噪声波具有相同振幅但相位相反的波。因此,两个波的结合会导致两个噪声的消除。如后文将讨论的,噪声消除系统或其英文缩写ANC,在消除低频噪声方面非常有效。这导致了工业领域的大量发展,因为被动噪声消除系统通常无法消除低频范围内的噪声。
噪声可以在频率、振幅、相位、声速等方面变化,并且可以由多种来源引起。这种噪声的本质意味着ANC系统必须具有一个自适应滤波器,允许修改上述所有变量。自适应滤波器调整其系数,通常称为“权重”,以最小化误差信号。这些系数可以通过几种算法确定,最广泛使用的是最小均方算法或其英文缩写LMS。此外,还有其他算法,如NLMS、FxLMS、FxRLS等。这些将在后文讨论。这种滤波器可以用有限响应滤波器(FIR)和无限响应滤波器(IIR)来实现。由于通常使用FIR滤波器,因此在本工作中将使用这种滤波器。
在本研究中,噪声被定义为任何你想要消除的不受欢迎的声音,如机器产生的噪声、环境噪声、咖啡馆中的对话等。换句话说,噪声可以由任何方式产生。
ANC系统可以基于预反馈或前馈,其中参考噪声在传播到第二个源之前被采样,或者基于反馈,其中噪声在没有参考的情况下被消除。也就是说,信号在被注入消除波之后被采样,以纠正消除误差。
在前馈系统中,有1)窄带系统或Narrowband,将在第II部分介绍,以及2)宽带系统或Broadband,将在第II部分讨论。另一方面,在反馈系统中,有自适应窄带系统或Narrowband adaptive,将在第III部分介绍。
在第IV部分,将介绍Wiener自适应滤波器的概念以及必须考虑的正确实现它们的准则。
在第V部分,将开发用于实现自适应滤波器的几种算法的概念和应用,如LMS。在第VI部分,将开发宽带前馈系统的模拟系列。
II:前馈系统
A:窄带前馈系统
在许多主动噪声控制(ANC)应用中,噪声信号是周期性的。这些信号可以由电机、风扇、压缩机等机器产生。该系统利用这些信号的周期性来消除噪声。这种系统具有以下优点:
- 避免了从噪声消除扬声器到参考麦克风的反馈。
- 避免了从参考麦克风的校准。
- 由于是周期性噪声,因此消除了因果限制。
- 生成参考信号的可能性允许独立控制每个谐波。
- 只需要对接近谐波频率的传递函数进行建模。
图1. 窄带前馈系统的表示 |
---|
![]() |
- 窄带前馈系统的表示
这种系统的一个基本图示如图1所示。系统有一个传感器,它充当信号发生器的触发器。生成的参考信号可以是两种类型:1)周期等于周期性噪声基频倒数的一串脉冲;2)与周期性噪声谐波具有相同频率的正弦波。为了实现1)类型的信号,使用了称为波形合成的方法,而对于2)类型则使用了自适应陷波滤波器。无论生成哪种类型的参考信号,它都由自适应滤波器处理并发送到驱动器。通过误差信号,自适应滤波器会根据不同的算法进行修改,以最小化误差。
下面将更详细地解释合成方法。传感器捕捉周期性噪声信号,并将噪声样本存储起来。我们定义N为一个噪声周期内的样本数。这些样本代表了要生成的波形,以抑制噪声。样本依次发送到模拟数字转换器,以产生在噪声消除驱动器中再现的信号。在这个过程中,自适应FIR滤波器的长度等于噪声信号的一个周期或N个样本。剩余声音由误差麦克风拾取,该麦克风与参考信号的脉冲同步。随后,修改自适应滤波器以减小误差。可以证明,LMS递归关系如下获得:
其发展将在第五节中详细讨论。经过一系列数学步骤[1]之后,我们得到了系统的传递函数:
(1)是一个有趣的方程,因为它关联了原始噪声
然而,由于这项研究工作专注于宽带前馈主动噪声控制系统,因此不会展开涉及(2)的结果。
关于这种系统的最后一点评论是,必须考虑所需的时间。也就是说,信号由自适应滤波器处理并发送到扬声器的时间,以及信号到达误差麦克风所需的时间都必须考虑在内。考虑到这些时间,可以适当地调整修改自适应滤波器的算法,以便能够在实时实现中使用这种类型的系统。
B:宽带前馈系统
系统如图2所示。该系统有一个参考麦克风来接收输入信号,该信号由ANC系统处理,ANC系统在消噪扬声器中再现一个信号。系统还有一个误差麦克风,它修改自适应滤波器的行为以最小化ANC系统的误差。
图2. 宽带前馈系统的表示 |
---|
![]() |
主路径
为了澄清系统的工作原理,系统的块图如图3所示。误差麦克风被描绘为加法模块,其输入信号是
评估图3中的系统得到输入信号
图3. 宽带前馈的模块表示 |
---|
![]() |
由于需要完美的噪声消除,
如上所述,自适应滤波器可以用IIR滤波器实现,但其适应可能会有问题,因为接近单位圆的极点可能会移出单位圆,从而在适应过程中产生系统不稳定的条件。因此,人们可能会认为使用FIR滤波器是解决方案。然而,FIR滤波器作为替代方案在实践中也有困难。通常,误差麦克风和消噪扬声器与参考麦克风的距离相同。此外,误差麦克风通常放置在消噪扬声器附近。这种组件的布局导致主路径
为了解决这个缺点,可以估计
人们可能会认为,既然
图4. 使用 |
图5. 宽带前馈系统的方框图,包括在线和离线运行模式 | 图6. 无 |
---|---|---|
![]() |
![]() |
![]() |
如果不考虑
显然,(5)比(4)简单。像(4)一样,自适应滤波器可以由自适应算法驱动的FIR滤波器近似。
在结束对这类系统的学习时,提及处理时间的重要性并不多余。参考麦克风接收输入信号后,系统有一定的时间来生成消噪扬声器信号。如果生成这个信号所需的时间(电子延迟)比噪声从参考麦克风传到驱动器所需的时间(声学延迟)更长,系统的效率将严重受损。这是因为当电子延迟大于声学延迟时,系统响应是非因果的。当实现因果条件时,系统能够抑制随机噪声。相反,如果未实现因果条件,系统只能消除周期性噪声[4]。最后,请注意,该系统不限于周期性噪声,这使它在某种程度上优于前一个系统。这就是为什么这个系统比"窄带前馈"系统有更多的应用。
总之,可以说这类系统的难点在于实现自适应滤波器
III:窄带反馈系统
本节介绍窄带反馈系统。图7展示了一个反馈系统的一通道方块图。误差麦克风捕获的信号通过自适应滤波器处理,以在降噪扬声器处生成信号。这种系统仅基于自适应滤波器的输入和误差信号来合成其自身的参考信号。这就是为什么我们的想法是估计主要噪声并将其作为自适应滤波器的参考。
图7. 窄带反馈的基本系统表示 | 图8. 窄带反馈的系统表示 |
---|---|
![]() |
![]() |
如果将
然后,当
这种情况意味着
系统的传递函数
观察到,如果实现了一个良好的估计
此外,如果
图9展示了包括实现自适应算法模块的系统。
图9. 窄带反馈系统 |
---|
![]() |
IV:维纳自适应滤波器
在本节中,我们将介绍维纳滤波器的概念,正如前几节所见,维纳滤波器是噪声消除系统中最常使用的自适应滤波器。
维纳滤波器
图10. 过滤问题的方框表示 |
---|
![]() |
在详细解释这种类型的滤波器之前,我们引入均方误差准则。它源于确定哪些滤波器系数会产生最小误差的需求。其定义如下:
在这里提到这个概念,是因为它在后续内容中将非常有用。继续详细解释这种类型的滤波器,图11展示了一个横向滤波器。假设输入
图11. 横截面滤波器表示 |
---|
![]() |
输出
误差由以下公式给出:
使用(10)可以得出:
如果定义交叉相关向量和自相关矩阵为:
则可以得出:
为了得到最小化函数(18)的系数,必须解出使ε关于每个系数的偏导数等于零的方程组。可以证明,最终得到:
(19)被称为维纳-霍普方程,通过它可以获得最佳滤波器系数。将上述方程代入18中得到最小均方误差:
(20)允许选择最优系数,以最小化自适应滤波器的误差。这个结果将在第五节再次使用。
V:算法
在实现自适应信号滤波器时,为了最小化输出与期望结果之间的二次误差,区分了两种算法类别:一种是确定性估计滤波器参数的算法,另一种是通过统计方法进行估计的算法。
前者以高收敛速度为特点,但同时也意味着对计算能力的高要求:递归最小二乘法(以下简称RLS)就是这一类别的突出例子。后者基于随机方法,因此需要的资源较少:最小均方方法(LMS)及其变体(NMLS、FX-LMS等)就是这一类别的例子。
下面简要描述了各种相关算法,重点放在随机算法上,因为它们的计算复杂度相对较低。
A. 递归最小二乘法算法:RLS
RLS算法递归地找到滤波器系数,以最小化输入信号的加权线性回归的成本函数:它从操作开始就使用输入信号的信息,即它具有记忆。因此,它操作的是大的信息矩阵,这意味着具有很高的数学复杂性。尽管存在旨在提高计算效率的此类方法,但它们无法与仅处理当前输入的随机滤波器相比。最小二乘算法家族存在数值条件问题。在有限精度系统中,这一家族算法的实现非常容易受到舍入误差的影响[8]。
B. 最小均方算法:LMS
从维纳滤波器理论的基础出发,我们考虑具有非递归结构的滤波器。因此,滤波器输出的时间表达式将由(21)式确定。
其中:
如果定义一个代价函数为
其中
其中,
从这一点开始,可以假设使用从梯度得到的方程足以应用梯度下降算法并到达代价函数的极小值。然而,梯度对
因此,使用这些估计器并代入(29)式,我们得到:
最后,经过这些数学推导,并使用梯度下降算法推导中的相同逻辑,我们得到(33)式,这就是所谓的LMS算法方程。
- F-X LMS算法:如第二部分所解释的,滤波器传递函数为
,然后使用不同的算法将其近似为FIR滤波器。Filtered-X最小均方,更广为人知的FX-LMS,就是应用于FIR型传递函数的LMS算法版本。
因此,如果我们定义 为 的过滤版本,我们得到(34)式,这就是FX-LMS算法的方程[1]。
需要澄清的是,
图12. FXLMS算法的实现 |
---|
![]() |
- 收敛性:尽管不会详细分析如何评估和定义LMS算法收敛的参数,但可以预先判断算法收敛必须满足的条件由(35)式给出。
上限
3) F-X RLS算法:另一方面,对过滤信号实施RLS算法,我们有如图13所示的系统。与FX LMS一样,输入信号是
众所周知,使用这种算法将导致极高的收敛速度,但这是以计算复杂度为代价的。这在我们的系统中产生了问题,因为在紧凑设备(如耳机)中实施这种特性的算法成本过高。然而,如果我们有能力使用它,下面我们将看到它的优点。
图13. 用于FX RLS算法更新的ANC系统图示 |
---|
![]() |
C. 总结
本章简要介绍了自适应噪声控制(ANC)系统的基本原理,并详细讨论了两种常用的自适应算法:最小均方(LMS)算法和递推最小二乘(RLS)算法。LMS算法以其简单性和实用性而受到青睐,但RLS算法在收敛速度上具有优势。在实际应用中,选择哪种算法取决于系统要求、计算资源以及对收敛速度和稳定性的需求。此外,为了提高ANC系统的性能,可以采用Filtered-X LMS(FX-LMS)和Filtered-X RLS(FX-RLS)算法,这些算法通过考虑滤波后的信号来优化系数的更新。在设计ANC系统时,还需要考虑滤波器的设计、系统延迟以及误差麦克风的放置等因素,以确保系统的有效性和稳定性。
VI:宽带前馈主动噪声消除(ANC)仿真
为了进行宽带前馈系统的仿真,我们假设以下情况:1)不考虑路径
应该注意的是,所有仿真都是使用Python编程代码完成的。
A. 声学路径仿真
为了对上述所有内容进行仿真,我们首先必须拥有声学路径
另一方面,为了模拟声学路径
B. 使用FX LMS的仿真
首先,模拟
图15. 路径 |
图16. 路径 |
图17. 路径 |
图18. 估计 |
---|---|---|---|
![]() |
![]() |
![]() |
![]() |
估计过程的方块图如图18所示。估计过程如下:1)在系统输入处放置白高斯噪声
图19. |
---|
![]() |
有了估计
图22显示了使用随机噪声的仿真结果。要抑制的噪声是工厂风扇产生的噪声。请注意,尽管这个音频的长度比前一个案例短,但算法似乎需要更长的时间来适应。
最后,图24显示了自适应滤波器的前4个系数如何收敛到它们各自的值。
图20. 飞机驾驶舱内系统的仿真 | 图21. 对于飞机驾驶舱案例,期望的反向信号和我们的系统生成的信号之间的相关性样本 | 图22. 使用工厂风扇噪声的系统仿真 | 图23. 对于工厂风扇案例,期望的反向信号和我们的系统生成的信号之间的相关性样本 | 图24. 自适应滤波器的第一个4个系数的调整 |
---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
系统在不同性质的输入下表现适当。这表明它适用于例如降噪耳机等场合。
C. 使用FX RLS算法的仿真
与FXLMS一样,我们首先估计了
最后,我们模拟了LMS案例提出的相同环境,并得到了如图26和27所示的结果。
图25. |
图26. 使用FX RLS算法的工厂风扇仿真 | 图27. 使用FX RLS算法的飞机驾驶舱仿真 |
---|---|---|
![]() |
![]() |
![]() |
VII:总结
在这项研究工作中,我们发展了三种类型噪声消除系统的理论与实现。研究发现,宽带前馈系统具有最多的实际应用,并且细节最为详尽。同时,FX-LMS算法被证明是最适合实现自适应滤波器的。虽然系统已经成功进行了模拟,但建议进行物理实现以验证模拟中获得的结果。
参考文献
[1] B. Farhang and B. Wiley, Adaptive Filters: Theory and Applications (Book style), 2nd ed, pp. 555.
[2] Simon Hayking, Adaptative Filter Theory, 5th ed
[3] D.G.Manolakis,V.K.IngleandS.M.Kogon,StatsticalandAdaptive
Signal Processing.
[4] S.M.KuoandD.R.Morgan,“ReviewofDSPALgorithmsforActive
Noise Control (Presented Conference Paper style),” presented at the International Conference on Control Aplications, Anchorage, Alaska, September 25–27, 2000, Paper 90 SM 690-0 PWRS.
[5] A. Antoniou, Digital Signal Processing: Signals, Systems and Filters (Book style), 1st ed, pp 425
[6] SenM.Kuo,SohiniMitra,andWoon-SengGan“ActiveNoiseControl System for Headphone Applications“
[7] Reshma B and Kiran K A “Active Noise Control System for Head- phone Applications“
[8] On the Numerical Stability and Accuracy of the Conventional Recur- sive Least Squares Algorithm
原文
Study on active noise cancellation
Ian C. Díaz, Matías Fogg, Lisandro Alvarez, Manuel Dieguez
Abstract
Today, active noise cancellation is applied in the most diverse contexts, from industry to medicine and consumer products. This research work refers to the different noise cancellation systems commonly used. In addition, it analyzes the different adaptive algorithms that can be used for the implementation of these systems. The paper emphasizes on the Broadband Feedforward cancellation system both in its practical aspects and in its implementation. Its implementation is explored with the FxLMS algorithms and its recursive variant FxRLS.
I. INTRODUCTION
Active noise cancellation is a method for the elimination of one wave by the addition of another. It is implemented by means of an electroacoustic or electromechanical system that takes advantage of the destructive interference phenomenon. To achieve this, it uses a wave with equal amplitude but inverted phase with respect to the noise wave. Consequently, the combination of both waves results in the cancellation of both noises. As will be discussed later, noise cancellation systems or ANC for its acronym in English, are very effective in eliminating low frequency noise. This has caused a great deal of development in the industry since passive noise cancellation systems generally fail to eliminate noise in the low frequency range.
Noise can vary in frequency, amplitude, phase, speed of sound and can be caused by a myriad of sources. This very nature of noise implies that ANC systems must have an adaptive filter that allows modification to all the above mentioned variables. Adaptive filters adjust their coefficients, generally called "weights", to minimize the error signal. The coefficients can be determined by several algorithms, the most widely used is the least mean squares algorithm or LMS for its acronym in English. In addition, there are other algorithms such as NLMS, FxLMS, FxRLS, etc. These will be discussed later. This type of filters can be performed with finite response filters (FIR) and infinite response filters (IIR). As FIR filters are generally used, this is the type of filter that will be used in this work.
In this research work, noise is defined as any undesirable sound that you want to eliminate, noise generated by ma- chines, ambient noise, conversations in a cafe, etc.. In other words, noise can be generated by any means.
ANC systems can be based on pre-feedback or feed- forward, where the reference noise is sampled before it propagates to the second source, or on feedback where the noise is cancelled without a reference. That is, the signal is sampled after the injection of the canceling wave to correct the cancellation error.
Within the feedforward systems are 1) the narrowband systems or Narrowband that will be presented in the section II and 2) the broadband systems or Broadband that will be discussed in the section II. On the other hand, within the feedback systems is the adaptive narrowband system or Narrowband adaptive which will be introduced in section III.
In the IV section, the concept of Wiener adaptive filters and the criteria that must be taken into account to implement them correctly will be presented.
In the V section, the concepts and application of several algorithms to implement adaptive filters such as the LMS will be developed. In the VI section, a series of simulations of a Broadband Feedforward system are developed.
II. FEEDFORWARD SYSTEMS
A. Narrowband Feedforward System
In many ANC applications noise signals are periodic. These signals can be generated by machines such as motors, fans, compressors, etc. This system uses the periodicity of these signals to cancel the noise. This type of system has the following advantages:
- Feedback from the noise-canceling speaker to the reference microphone is avoided.
- Alignments from the reference microphone are avoided.
- As it is periodic noise, the causality limitation is eliminated.
- The possibility of generating reference signals allows to control each harmonic independently.
- It is only necessary to model the transfer function on frequencies close to that of the harmonics.
- Fig1 Representation of the system Narrowband Feedforward
Representation of the system Narrowband Feedforward
A basic diagram of such a system is shown in Fig. 1. The system has a sensor that acts as the trigger of the signal generator. The reference signal generated can be of two types: 1) a pulse train with period equal to the inverse
of the fundamental frequency of the periodic noise and 2) sine waves with the same frequencies as the harmonics of the periodic noise. To implement the 1) type the method called wave synthesis is used while for the 2) type an adaptive notch filter is used. No matter what type of reference signal is generated, it is processed by an adaptive filter and sent to the driver. By means of an error signal the adaptive filter is modified (thanks to different algorithms) to minimize the error.
The synthesis method is explained in more detail below. The sensor captures the periodic noise signal and the noise samples are stored. We define N as the number of samples in one cycle of the noise wave. The samples represent the waveform to be generated to suppress the noise. The samples are sequentially sent to an analog digital converter to produce the signal to be reproduced in the noise cancelling driver. In this process is the adaptive FIR filter that has a length equal to one period of the noise signal or N samples. The residual sound is picked up by the error microphone which is synchronized with the pulses of the reference signal. Subsequently, the adaptive filter is modified to decrease the error. It can be proved that the LMS recursion is obtained as:
Its development will be discussed in more detail in the section V. After a series of mathematical steps [1], the transfer function of the system is obtained:
(1) is an interesting equation as it relates the original noise,
stant amplitude of (
that attenuates at the fundamental and harmonic frequencies of the periodic noise. (1) shows that
However, the results involving (2) will not be developed since this research work focuses on the Broadband Feedforward ANC system.
As a final comment about this type of system, the time required must be considered. That is to say, the time it takes for the signal to be processed by the adaptive filter and then sent to the loudspeaker and also the time it takes for the signal to reach the error microphone must be taken into account. Taking these times into consideration, the algorithm that modifies the adaptive filter can be appropriately adapted to be able to use this type of systems in a real time implementation.
B. Broadband Feedforward System
The system is illustrated in Fig. 2. The system has a reference microphone that takes the input signal, the signal is processed by the ANC system that reproduces a signal in the cancellation speaker. It has an error microphone that modifies the behavior of the adaptive filter to minimize the error of the ANC system.
- Fig2 Representación del sistema Broadband Feedforward
The primary path
To clarify the operation of the system, a block diagram of the system is illustrated in Fig. 3. The error microphone is depicted as the adder module whose input signals are
Evaluating the system in Fig.3 yields the transfer function of the input signal between
- Fig. 3 Block representation of the Broadband Feedforward
Since perfect noise cancellation is desired,
As clarified above, the adaptive filter can be implemented with an IIR filter but its adaptation can be problematic because the poles close to the unit circle can move out of the unit circle generating the condition of instability to the system in the adaptation process. Ergo, one might think that the solution is to use a FIR filter. However, the use of a FIR filter as an alternative has difficulties in practice. Generally, the error microphone and the cancellation loudspeaker are placed at the same distance from the reference microphone. In addition, the error microphone is usually placed close to the cancellation speaker. This arrangement in the components results in high-order transfer functions for the primary path
To solve this drawback, one could estimate
One might think that since
- Fig. 4. Block representation of the Broadband Feedforward system using
- Fig. 5. Block diagram of the Broadband Feedforward System with online and offline modes of operation.
- Fig. 6. Block representation of the system Broadband Feedforward without
.
It is useful to analyze how the system would be without considering
Clearly (5) is simpler than (4). Like (4) the adaptive filter can be approximated by a FIR filter driven by an adaptive algorithm.
Finalizing the study of this type of systems it is not superfluous to mention the importance of the processing time. After the reference microphone takes the input signal, the system has a certain time to generate the cancellation speaker signal. If the time it takes to generate this signal (electronic delay) is longer than the time it takes for the noise to get from the reference microphone to the driver (acoustic delay), the efficiency of the system is severely impaired. This is because the system response is non-causal when the electronic delay is greater than the acoustic delay. When the causality condition is achieved the system is able to suppress random noises. On the contrary, if the causality condition is not achieved, the system can only eliminate periodic noises [4]. As a last clarification note that this system is not limited to periodic noises, this makes it somehow superior to the previous system. That is why this system has more applications than the Narrowband Feedforward system.
In conclusion, it can be said that the difficulty in this type of systems lies in the realization of the adaptive filter
III. NARROWBAND FEEDBACK SYSTEM
This section introduces the NarrowBand Feedback sys- tems. A one-channel block diagram of a Feedback system is illustrated in Fig. 7. The signal acquired by the error microphone is processed by the adaptive filter to generate a signal at the noise-cancelling driver. This type of system synthesizes its own reference signal based only on the input from the adaptive filter and the error signal. That is why the idea is to estimate the primary noise and use it as a reference for the adaptive filter.
- Fig. 7. Basic system representation Narrowband feedback
- Fig. 8. System representation Narrowband Feedback
If
Then, when
This scenario entails that
to an approximation
The transfer
It is observed that if a good estimate
Furthermore, if \(\frac{1}{S(z)\) is stable and causal,and
Fig 9 shows the system including the module implementing the adaptive algorithm.
- Fig. 9. Narrowband Feedback System
IV. WIENER ADAPTIVE FILTER
In this section the concept of the Wiener filter is developed since, as seen in the previous sections, it is the adaptive filter most commonly used in noise cancellation systems.
A block diagram of a Wiener filter
- Fig. 10. Block representation of a filtering problem
Before starting with a more detailed explanation of this type of filters, the mean square error criterion is introduced. It arises from the need to determine which filter coefficients produce the smallest error. It is defined as:
This concept is mentioned here because it will be very useful in the following.Continuing with a more detailed explanation of this type of filters, a transversal filter is illustrated in Fig. 11. Both the input
- Fig. 11. Cross-sectional filter representation
The output
The error is given by:
Using (10) it can be shown that:
If the cross-correlation vector and the autocorrelation
matrix are defined as:
It is obtained that:
To obtain the coefficients that minimize the function (18) one must solve the system of equations that result from making the partial derivatives of ε with respect to each coefficient equal to zero. It can be shown that one arrives at:
(19) is known as the equation wiener-Hopf where the optimal filter coefficients can be obtained.Replacing the latter equation in 18 gives the minimun mean-squared error:
(20) allows to choose the optimal coefficients that mini-mize the error of the adaptive filter. This result will be used again in the V section.
V. ALGORITHMS
For the implementation of adaptive signal filters, a dis-tinction is made between two categories of algorithms used to minimize the quadratic error between the output and the desired result: those that estimate the filter parameters deterministically and those that do so by means of statistical methods.
The former are characterized by high convergence speeds, but at the same time imply high computational capacity requirements: the recursive least squares method (hereafter RLS) is a prominent example of this category. The latter are based on stochastic methods and therefore require fewer resources: the least mean squares method (LMS) and its vari-ants (NMLS, FX-LMS, etc. are examples of this category).
A brief description of the various relevant algorithms is given below, with emphasis on the stochastic ones, since their computational complexity is relatively low.
A. Recursive Least Squares Algorithm: RLS
The RLS algorithm recursively finds the filter coefficients to minimize the cost function of a weighted linear regression of the input signals: it uses information from the input signals from the beginning of its operation, i.e. it has memory. Because of this, it operates with large information matri-ces, which implies great mathematical complexity. Although there are methods of this type designed to be more computa- tionally efficient, they fail to compare with stochastic filters, which only deal with the current input. The family of least squares algorithms is known to have numerical conditioning problems. The implementation of this family of algorithms is very sensitive to rounding errors in finite precision systems [8].
B. Least Mean Squares Algorithm: LMS
Starting from the basis of Wiener’s filter theory, we think of filters with a non-recursive structure. Therefore, the time expression of the filter output will be determined by (21).
Being:
If a cost function is defined as
Where
Where,
Being pn the cross-correlation and
From this point on, it could be assumed that it would be sufficient to use the equation obtained from the gradient to apply the gradient descent algorithm and arrive at a minimum of the cost function. However, the dependence of the gradient on
Therefore, using these estimators and replacing in (29), we obtain:
Finally, after this mathematical development, and using the same logic in the derivation of the gradient descent algorithm, we obtain (33), which is the so-called LMS algorithm equation.
- F-X LMS Algorithm: As explained in section II, the filter transfer is given by
and then this is approximated to a FIR filter using different algorithms.The Filtered-X Least-Mean-Square, better known as FX-LMS, is simply the version of the LMS algorithm applied to FIR-type transfers.
Therefore, if we define as the filtered version of we obtain (34) which is the equation of the FX-LMS algorithm [1].
It is important to clarify that
- Fig. 12. Implementation of an FXLMS algorithm
- Convergence: Although there will not be a very de- tailed analysis on how to evaluate and define the parameters for the LMS algorithm to converge, the condition that must be fulfilled to be able to say a priori that the algorithm converges is given by (35).
The upper bound
restrictive [1]. This may be due to the delay generated by the ANC filter to the input signal before reaching the error microphone, which may generate instability. Therefore, if the
3) F-X RLS algorithm: On the other hand, implementing the RLS algorithm for filtered signal, we have the system shown in Fig. 13. Like the FX LMS the input signal is the signal
As we know, using this algorithm will result in an ex-tremely high convergence speed, but at the cost of compu-tational complexity. This generates problems in our system, since implementing an algorithm of these characteristics in a compact device, such as a headset, would be insufficiently expensive. However, in case we have the capability to use it, we will see the advantages of it below.
- Fig. 13. Diagram of ANC system for FX RLS algorithm update
VI. BROADBAND FEEDFORWARD ANC SIMULATION
To carry out the simulation of a Broadband Feedforward system we assume the following: 1) the path
It should be noted that all simulations are performed using Python programming code.
A. Simulation of acoustic paths
In order to perform a simulation of everything discussed above, we must first have the acoustic paths
- Fig. 14. Physical diagram of the path
On the other hand, for the acoustic path
B. Simulation with FX LMS
First,
- Fig. 15. Impulse response of the path
- Fig. 16. Physical diagram of the path
- Fig. 17. Impulse response of the path
- Fig. 18. Block representation of the system to estimate
.
A block diagram of the estimation procedure is illustrated
in Fig. 18. The estimation is performed as follows: 1) place
- Fig. 19. Simulation of the estimation error of
. Gaussian white noise is set as input .
Having the estimate
Fig. 22 shows the result of a simulation with a random noise. The noise to be suppressed is the noise produced by a fan in a factory. Note that although it seems that the algorithm takes longer to adapt than in the previous case, this is due to the shorter length of this audio.
Finally, Fig. 24 shows how the first 4 coefficients of the adaptive filter converge to their respective values.
- Fig. 20. Simulation of the system inside the aircraft cabin
- Fig. 21. Sample of the correlation between the desired inverted signal and the signal generated by our system for the aircraft cockpit case.
- Fig. 22. Simulation of the system with noise from a factory fan
- Fig. 23. Sample of the correlation between the desired inverted signal and the signal generated by our system for the case of the factory fan.
- Fig. 24. Adjustment of the first 4 coefficients of the adaptive filter.
The system behaved appropriately under inputs of different nature. This shows that it is suitable for use in, for example, noise cancelling headphones.
- Fig. 25.
for filter estimation - Fig. 26. Simulation of a fan in a factory with the FX RLS algorithm
- Fig. 27. Simulation of an aircraft cockpit with the FX RLS algorithm
C. Simulation with FX RLS algorithm
AswiththeFXLMS,we first estimated the $\hat{S_2} filter,giving
a result of
Finally, we simulated the same environments proposed for
the LMS case and arrived at the results shown in Figures 26 and 27.
VII. CONCLUSION
In this research work, the theory and implementation of three types of noise cancellation systems were developed. It was found that the Broadband Feedforward system has the most practical applications and was the most detailed. In conjunction, the FX-LMS algorithm was found to be the most appropriate for the implementation of the adaptive filter. Although the system was successfully simulated, its physical implementation is suggested to corroborate the results obtained in the simulations.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」