Implementation of the Feedforward Multichannel Virtual Sensing Active Noise Control (MVANC) by Using MATLAB
Abstract
The multichannel virtual sensing active noise control (MVANC) methodology is an advanced approach that may provide a wide area of silence at specific virtual positions that are distant from the physical error microphones. Currently, there is a scarcity of open-source programs available for the MVANC algorithm. This work presents a MATLAB code for the MVANC approach, utilizing the multichannel filtered-x least mean square (MCFxLMS) algorithm. The code is designed to be applicable to systems with any number of channels. The code can be found on GitHub.
1 Introduction
Active noise control, often known as ANC, is a cutting-edge method that eliminates unwanted noise by providing regulated anti-noise that effectively cancels out the noise that is present in the environment. In the field of wave physics, this phenomenon, which is referred to as destructive interference, is an advanced application of the theory of superposition [1, 2]. With the help of the adaptive algorithms [3, 4, 5, 6, 7, 8], the use of active noise cancellation (ANC) is widespread in a variety of applications that are sensitive to noise problems. Some instances of these applications are windows [9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22], vehicles, and headphones [23, 24, 25, 26, 27, 28, 29, 30]. ANC is also efficient at minimizing low-frequency noise [31, 32]. However, it is essential to note that the "quiet zone" is only localized to the monitoring "error sensor" in the majority of ANC applications. This is because the monitoring "error sensor" supplies a posteriori information to the adaptive algorithm. Therefore, the typical approach to active noise control (ANC), in which the quiet zone is dependent on the positioning of the physical error sensor, appears to be unworkable in situations where physical placement is inconvenient, such as at the eardrums [33, 34, 35, 36, 37] or domestic living areas [12]. Currently, numerous forms of virtual sensing ANC approaches have been presented in order to ease the restriction on error sensor placement. This problem cannot be solved without these techniques [38]. The silent zone can be efficiently generated in these ways at the desired ’virtual’ locations, which are located away from the actual error sensors [39]. Specifically, we focus on a virtual sensing ANC algorithm that uses an auxiliary filter to achieve optimal control on the virtual position which overcomes the spatial correlation and causality constraint between error microphones [40]. This technique requires a preliminary training stage to produce an auxiliary filter that indirectly records the relationship between the physical sensor and the required virtual location. This stage is necessary to obtain the filter. As a consequence, the pre-trained filter assists the ANC system in obtaining sufficient management of the disturbance at the position of the virtual error sensor. To obtain a larger quiet zone at the desired location, this study realizes the feedforward multichannel virtual sensing ANC (MVANC) technique employing the widely-used simulation tool, MATLAB, and makes its code accessible to the public.
2 Theoretical Introduction on Feedforward Multichannel Virtual Sensing ANC Technique
Figure 1 depicts the implementation of a generic multichannel ANC system, which includes reference microphones with a value of , secondary sources with a value of , and physical error microphones with a value of . A further point to consider is that there are independent primary sources that are positioned ahead of the reference microphones. When applied to this multichannel system, the MVANC approach is utilized to cancel out the disturbances that occur at the virtual microphone positions in the distant field. It is assumed that the number of reference microphones is more than the number of primary sources (). This assumption is made for the sake of brevity and to avoid losing generality.
The MVANC technique is comprised of two stages: the first stage is the tuning stage, and the second stage is the control stage. During the tuning stage, the output signal vector is determined by the following equation, as depicted to the right in Figure 2:
(1) |
where
The expression represents the kth output signal at a time sample of , while the expression represents the matrix transpose operator. The stacked reference vector is stated to be
(2) |
in which denotes the th reference vector, which owns elements and is expressed as
(3) |
The control filter matrix in Eq. (1) is given by
(4) |
where the variable denotes the weight vector of the control filter, which determines the influence of the th input reference signal on the th output control signal:
(5) |
According to the traditional MCFxLMS technique, the new control filter that extends from the th input to the th output is obtained from
(6) |
where the symbol is used to indicate the stepsize of the MCFxLMS algorithm, while the symbol is used to represent the error signal at the th virtual microphone. The filtered reference is a convolution that is performed between the th reference signal and the virtual secondary path estimate , which includes the path from the th secondary source to the th virtual microphone. In the tuning step, it is possible to observe that the final control filter converges to the same optimal control filter that was achieved using the standard MCFxLMS. This knowledge may be derived from the equation (6).
Following this procedure, the optimal control filters can be obtained once the training converges. Then, the auxiliary filters are trained using the least mean square (LMS) algorithm as shown in Fig. 3. The th auxiliary filter vector can be obtained from
(7) |


where denotes the stepsize of the LMS algorithm, and
(8) |
The expression denotes the auxiliary filter from the th reference microphone to the th physical microphone with a length of taps. Therefore,
(9) |
The stacked reference vector is given by
(10) |
where represents the th reference vector with elements and is expressed as
(11) |
The error signal is stated to be
(12) |


where denotes the error signal at the th physical microphone.
During the control step, the physical microphones are retained while the virtual microphones are eliminated. As depicted in Figure 4, the new control filters are obtained by utilizing the MCxLMS algorithm.
(13) |
where the symbol represents the stepsize of the MCFxLMS algorithm. The variable represents the product of the convolution between the secondary path estimate , which is derived from the th secondary source to the th physical microphone, and the th reference signal represented by . The error signal is given by
(14) |
where represents the th optimal auxiliary filter obtained from Eq. (7).
Following the tuning stage and control stage described earlier, the feedforward MVANC system that has been proposed is capable of achieving noise cancellation at virtual places inside the system.
3 Code Explanation
The section provides the explanation of the program of a feedforward MVANC in Matlab. This program includes the following five MATLAB files: generates the filtered reference signals and disturbances, , and are the programs of the MVANC technique, while is the main program used to evaluate the programs of the MVANC system.
3.1 Function: CreatReferenceSignal
The MVANC technique utilizes the FxLMS algorithm to adaptively update the control filter coefficients. Therefore, generates the reference signals filtered by the physical secondary path and the virtual secondary path respectively. In addition, it produces disturbances at the location of the physical microphone and virtual microphone respectively. These signals will later be used in other functions.
In this code snippet, is used to store the disturbances at virtual microphones and has a dimension of by , while is used to store the disturbances at physical microphones and has a dimension of by . In addition, is used to store the reference signals filtered by virtual secondary paths and has a dimension of by by , while is used to store the reference signals filtered by virtual secondary paths and has a dimension of by by . , , and denote the simulation cycle number, the number of virtual error microphones, the number of physical error microphones and the number of secondary sources respectively.
3.2 Function: MultichannelFxLMS
In the tuning stage of the MVANC technique, the optimal control filters are first trained by using the FxLMS algorithm.
In this code snippet, is used to store the optimal control filters trained using the FxLMS algorithm and has a dimension of by , where denotes the length of the control filter. is used to store the error signals at virtual microphones and has a dimension of by .
3.3 Function: AuxiliaryLMS
After the control filter converges, the optimal control filters are then used by to train the auxiliary filters using the LMS algorithm.
In this code snippet, is used to store the optimal auxiliary filters trained using the LMS algorithm and has a dimension of by . is used to store the error signals and has a dimension of by .
3.4 Function: ContrFxLMS
In the control stage of the MVANC technique, the optimal auxiliary filers are used by to train the new control filters using the FxLMS algorithm.
In this code snippet, is used to store the new control filters trained using the FxLMS algorithm and has a dimension of by . is used to store the error signals at physical microphones which have a dimension of by , while is used to store the error signals at virtual microphones which have a dimension of by .
4 Testing Code: Four Channel Virtual Sensing Active Nose Control System
The carries out a simulation on a 1x4x4 MVANC system, where there is reference microphone, secondary sources, physical microphones and virtual microphones. In the simulation, , , and are used to achieve noise control at desired virtual locations.
4.1 System Configuration
The following commands define basic system configuration parameters. Specifically, the sampling frequency of the system is set to 16 kHz and the length of control filters is set to 512 taps.
4.2 Create Primary Noise for Tuning and Control
The following commands generate a broadband noise of 800-2500 Hz as reference signals in the tuning stage and a broadband noise of 800-1800 Hz as reference signals in the control stage by filtering white noise through different bandpass filters.
4.3 Loading Primary and Secondary Paths
The primary path is the path that the noise takes from the noise source to the error microphone, and the secondary path is the path that the anti-noise takes from the secondary source to the error microphone. Both of these paths are essential to the detection of errors. As a result, physical paths are distinct from virtual paths due to the fact that the physical microphones and virtual microphones are situated in distinct locations. In this context, the primary paths and the secondary paths are loaded from files.The length of the primary paths is 128 and the length of the secondary paths is 32.
4.4 Create Disturbance and Filtered Reference Signals
The following commands generate disturbance signals by filtering the reference signal through the primary path and filtered reference signals by filtering the reference signal through the secondary path. Specifically, different disturbance and filtered reference signals are generated with primary noises in the tuning and control stages, respectively.
4.5 Tuning Stage 1: Training the Optimal Control Filters
The following commands train the optimal control filters using the FxLMS algorithm with a stepsize of 0.000001.
4.6 Tuning Stage 2: Training the Auxiliary Filters
The following commands train the auxiliary filters using the LMS algorithm with a stepsize of 0.001.
4.7 Control Stage: Training the New Control Filters
The following commands train the new control filters using the FxLMS algorithm with a stepsize of 0.00001.
4.8 Drawing the Figure of Error Signals
Drawing the error signals of the four virtual microphones.

It can be seen from Fig. 5 that the MVANC system can achieve noise control at the virtual locations and the noise reduction performance is around 40 dB.
4.9 Drawing the Figure of Control Filter Coefficients
Drawing the control filter 1 coefficients in both tuning and control stages. The remaining three control filters are very similar to control filter 1.

It can be seen from Fig. 6 that the control filter 1 derived from the tuning stage exhibits a passband within the 800 to 2500 Hz frequency range. Conversely, control filter 1 from the control stage demonstrates a passband within the narrower 800 to 1800 Hz range. This result is consistent with the different primary noises used in the tuning and control stages.
5 Conclusion
The purpose of this article is to provide a comprehensive explanation of a MATLAB program that simulates the feedforward multichannel virtual sensing active noise control (MVANC) technique by employing the multichannel filtered-x least mean square (MCFxLMS) technique.
References
- [1] Dongyuan Shi et al. “Active noise control in the new century: The role and prospect of signal processing” In INTER-NOISE and NOISE-CON Congress and Conference Proceedings 268.3, 2023, pp. 5141–5151 Institute of Noise Control Engineering
- [2] Bhan Lam et al. “Ten questions concerning active noise control in the built environment” In Building and Environment 200 Pergamon, 2021, pp. 107928
- [3] Yu Guo et al. “A survey on adaptive active noise control algorithms overcoming the output saturation effect” In Signal Processing Elsevier, 2024, pp. 109525
- [4] Junwei Ji et al. “A Computation-efficient Online Secondary Path Modeling Technique for Modified FXLMS Algorithm” In arXiv preprint arXiv:2306.11408, 2023
- [5] Chung Kwan Lai, Dongyuan Shi, Bhan Lam and Woon-Seng Gan “MOV-Modified-FxLMS algorithm with Variable Penalty Factor in a Practical Power Output Constrained Active Control System” In IEEE Signal Processing Letters IEEE, 2023
- [6] Junwei Ji et al. “A practical distributed active noise control algorithm overcoming communication restrictions” In ICASSP 2023-2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2023, pp. 1–5 IEEE
- [7] Dongyuan Shi et al. “Optimal output-constrained active noise control based on inverse adaptive modeling leak factor estimate” In IEEE/ACM Transactions on Audio, Speech, and Language Processing 29 IEEE, 2021, pp. 1256–1269
- [8] Dongyuan Shi, Woon-Seng Gan, Bhan Lam and Xiaoyi Shen “Comb-partitioned frequency-domain constraint adaptive algorithm for active noise control” In Signal Processing 188 Elsevier, 2021, pp. 108222
- [9] Bhan Lam et al. “Anti-noise window: Subjective perception of active noise reduction and effect of informational masking” In Sustainable Cities and Society 97 Elsevier, 2023, pp. 104763
- [10] Dongyuan Shi, Woon-Seng Gan, Jianjun He and Bhan Lam “Practical implementation of multichannel filtered-x least mean square algorithm based on the multiple-parallel-branch with folding architecture for large-scale active noise control” In IEEE Transactions on Very Large Scale Integration (VLSI) Systems 28.4 IEEE, 2019, pp. 940–953
- [11] Bhan Lam et al. “Active control of broadband sound through the open aperture of a full-sized domestic window” In Scientific reports 10.1 Nature Publishing Group, 2020, pp. 1–7
- [12] Rina Hasegawa, Dongyuan Shi, Yoshinobu Kajikawa and Woon-Seng Gan “Window active noise control system with virtual sensing technique” In INTER-NOISE and NOISE-CON Congress and Conference Proceedings 258.1, 2018, pp. 6004–6012 Institute of Noise Control Engineering
- [13] Bhan Lam, Chuang Shi, Dongyuan Shi and Woon-Seng Gan “Active control of sound through full-sized open windows” In Building and Environment 141 Elsevier, 2018, pp. 16–27
- [14] Dongyuan Shi et al. “Computation-efficient solution for fully-connected active noise control window: Analysis and implementation of multichannel adjoint least mean square algorithm” In Mechanical Systems and Signal Processing 199 Academic Press, 2023, pp. 110444
- [15] Chung Kwan Lai, Jing Sheng Tey, Dongyuan Shi and Woon-Seng Gan “Robust estimation of open aperture active control systems using virtual sensing” In INTER-NOISE and NOISE-CON Congress and Conference Proceedings 265.4, 2023, pp. 3397–3407 Institute of Noise Control Engineering
- [16] Chuang Shi et al. “Open loop active control of noise through open windows” In Proceedings of Meetings on Acoustics 29.1, 2016 AIP Publishing
- [17] Dongyuan Shi, Bhan Lam, Woon-Seng Gan and Shulin Wen “Block coordinate descent based algorithm for computational complexity reduction in multichannel active noise control system” In Mechanical Systems and Signal Processing 151.0888-3270 Academic Press, 2021, pp. 107346
- [18] Bhan Lam et al. “Active control of low-frequency noise through a single top-hung window in a full-sized room” In Applied Sciences 10.19 MDPI, 2020, pp. 6817
- [19] Chuang Shi et al. “On algorithms and implementations of a 4-channel active noise canceling window” In 2017 International Symposium on Intelligent Signal Processing and Communication Systems (ISPACS), 2017, pp. 217–221 IEEE
- [20] Chuang Shi et al. “Understanding multiple-input multiple-output active noise control from a perspective of sampling and reconstruction” In 2017 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC), 2017, pp. 124–129 IEEE
- [21] Zhengding Luo et al. “Real-time implementation and explainable AI analysis of delayless CNN-based selective fixed-filter active noise control” In Mechanical Systems and Signal Processing 214 Elsevier, 2024, pp. 111364
- [22] Xiaoyi Shen et al. “The principle underlying the wireless reference microphone enhancing noise reduction performance in multi-channel active noise control windows” In Mechanical Systems and Signal Processing 212 Elsevier, 2024, pp. 111284
- [23] Xiaoyi Shen, Dongyuan Shi and Woon-Seng Gan “A hybrid approach to combine wireless and earcup microphones for ANC headphones with error separation module” In ICASSP 2022-2022 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2022, pp. 8702–8706 IEEE
- [24] Xiaoyi Shen, Dongyuan Shi, Santi Peksi and Woon-Seng Gan “A multi-channel wireless active noise control headphone with coherence-based weight determination algorithm” In Journal of Signal Processing Systems 94.8 Springer US New York, 2022, pp. 811–819
- [25] Dongyuan Shi et al. “Selective fixed-filter active noise control based on convolutional neural network” In Signal Processing 190 Elsevier, 2022, pp. 108317
- [26] Xiaoyi Shen, Woon-Seng Gan and Dongyuan Shi “Alternative switching hybrid ANC” In Applied Acoustics 173 Elsevier, 2021, pp. 107712
- [27] Xiaoyi Shen, Dongyuan Shi, Santi Peksi and Woon-Seng Gan “Implementations of wireless active noise control in the headrest” In INTER-NOISE and NOISE-CON Congress and Conference Proceedings 265.4, 2023, pp. 3445–3455 Institute of Noise Control Engineering
- [28] Xiaoyi Shen, Dongyuan Shi and Woon-Seng Gan “A wireless reference active noise control headphone using coherence based selection technique” In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2021, pp. 7983–7987 IEEE
- [29] Xiaoyi Shen, Dongyuan Shi, Woon-Seng Gan and Santi Peksi “Adaptive-gain algorithm on the fixed filters applied for active noise control headphone” In Mechanical Systems and Signal Processing 169 Academic Press, 2022, pp. 108641
- [30] Dongyuan Shi et al. “Transferable latent of cnn-based selective fixed-filter active noise control” In IEEE/ACM Transactions on Audio, Speech, and Language Processing IEEE, 2023
- [31] DongYuan Shi, Woon-Seng Gan, Bhan Lam and Chuang Shi “Two-gradient direction FXLMS: An adaptive active noise control algorithm with output constraint” In Mechanical Systems and Signal Processing 116 Elsevier, 2019, pp. 651–667
- [32] Woon-Seng Gan, Dongyuan Shi and Xiaoyi Shen “Practical Active Noise Control: Restriction of Maximum Output Power” In 2023 Asia Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC), 2023, pp. 1245–1249 IEEE
- [33] Nobuhiro Miyazaki and Yoshinobu Kajikawa “Head-mounted active noise control system with virtual sensing technique” In Journal of Sound and Vibration 339 Elsevier, 2015, pp. 65–83
- [34] Marek Pawelczyk “Analog active control of acoustic noise at a virtual location” In IEEE Transactions on Control Systems Technology 17.2 IEEE, 2008, pp. 465–472
- [35] Marek Pawelczyk “Noise control in the active headrest based on estimated residual signals at virtual microphones” In Proceedings of the 10th International Congress on Sound and Vibration, 2003, pp. 251–258
- [36] B Rafaely, SJ Elliott and J Garcia-Bonito “Broadband performance of an active headrest” In The journal of the Acoustical Society of America 106.2 Acoustical Society of America, 1999, pp. 787–793
- [37] He-Siang Deng, Cheng-Yuan Chang and Sen M Kuo “Active noise control with virtual sensing technology for headrest” In 2018 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC), 2018, pp. 1272–1275 Ieee
- [38] MRF Kidner, C Petersen, AC Zander and CH Hansen “Feasibility study of localised active noise control using an audio spotlight and virtual sensors” In Proceedings of ACOUSTICS, 2006, pp. 55–61
- [39] Xiaojun Qiu “A review of near field acoustic error sensing strategies for active sound radiation control” In 25th International Congress on Sound and Vibration 2018, ICSV 2018: Hiroshima Calling, 2018
- [40] Dongyuan Shi, Woon-Seng Gan, Bhan Lam and Shulin Wen “Feedforward selective fixed-filter active noise control: Algorithm and implementation” In IEEE/ACM Transactions on Audio, Speech, and Language Processing 28 IEEE, 2020, pp. 1479–1492
- [41] Zhengding Luo, Dongyuan Shi, Junwei Ji and Woon-seng Gan “Implementation of multi-channel active noise control based on back-propagation mechanism” In arXiv preprint arXiv:2208.08086, 2022
- [42] Dongyuan Shi, Bhan Lam, Xiaoyi Shen and Woon-Seng Gan “Multichannel two-gradient direction filtered reference least mean square algorithm for output-constrained multichannel active noise control” In Signal Processing 207 Elsevier, 2023, pp. 108938
- [43] Dongyuan Shi et al. “Active Noise Control based on the Momentum Multichannel Normalized Filtered-x Least Mean Square Algorithm” In In Inter-Noise 2020. The International Institute of Noise Control Engineering., 2020
- [44] Dongyuan Shi et al. “What is behind the meta-learning initialization of adaptive filter?—A naive method for accelerating convergence of adaptive multichannel active noise control” In Neural Networks Elsevier, 2024, pp. 106145