Real-time ANC Simulink model based design simulation

3 views (last 30 days)
I am attempting to implement the model based implementation of the ANC system as described in https://www.mathworks.com/help/audio/ug/active-noise-control-with-simulink.html . More specifically, I am attempting the following system:
I have acheived the results that are intially stated in the example with the error converging to zero. I would now like to update the system with more realistic parameters to be more accurate to the real world implementation that I plan to implement. One thing I would like to try is being able to have an audio device reader be the noise input to the system instead of the noise source. However, what I do not understand is how real audio is fed into the LMS update block. The adaptive filter mode in both the system above and the examples final, real time system has the adaptive filter mode of the LMS update block set to "tapped delay-line FIR filter", which accepts scalar inputs. Therefore, the noise source block must have the number of output samples per channel = 1 and output sample time (s) = 1/F. However, the audio device reader does not allow the number of ouput samples per channel to be = 1 and I do not see how in the real-world implementation that this could be the case. My question is, how could I go about testing the abilites of this simulink system by reading actual microphone data and sending it through the algorithm to analyze the ANC systems abilities to reduce noise?

Answers (1)

Jimmy Lapierre
Jimmy Lapierre on 30 Nov 2023
Hi, the easiest way to get started might be to pre-record some audio and replace the noise source with that data.
With an audio device in there, first you will need to make sure the model runs fast enough (for ex., does it run faster than real-time with the noise source block?). Then, you can try an Unbuffer block to transform the audio device data from a larger frame size to scalar values. Alternatively, there is a "Block LMS Filter" that might be useful to do this, it might run faster.

Categories

Find more on Get Started with DSP System Toolbox in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!