Help with Modified FxLMS in an ANC application.
Hello and thank you for this forum.
I am trying to implement ANC using the Modified FxLMS block. I have confirmed I have the microphones and speakers working. I have been able to run the training mode, however, it only seems to output coefficients if I unmute first and run/start then mute and run/start to get coefficients which is not how the WIKI states so I wonder if I am getting reasonable coefficients. I am also not getting any cancellations when playing an external 1000Hz signal and am wondering if I am setting this up correctly.
This is my physical setup (only one side of the headphone for testing)
I hope someone may be able to look at my Sigma Studio setup and confirm whether I am doing things correctly or not. I have attached my project file as well. as these screenshots.
Training:
Training coefficients:
Runtime ran for 1-2 minutes and this is the current LMS coefficients:
Sigma Studio Project file.
ANC_PDMInput_1-sided_MFxNMLS_RM-2.dspproj
I appreciate any feedback.
Adding to thread 20230516:
I have followed the WIKI example wiki.analog.com/.../mfxlms it shows the MFXLMS filter module run at 2000Hz by down sampling and later upsampling. I originally did not do this, because I did not want to limit the filtering, but in an attempt to replicate the example, I have incorporated this and can hear something happening but not actual cancellation of a known frequency.
Here is my set up and I will attach the project.
Can someone help me understand this, my concern is if we are downsampling to 2000Hz how will we be able to filter out anything greater than 1000Hz or even if up to 2000Hz?
Sigma Studio Project file: Had to zip it.
ANC_PDMInput_1-sided_MFxNMLS_RM-2wUP-DOWNsampling.zip
Any help is appreciated.
Edit Notes
updated labels for Ref and Error Mic in diagram
[edited by: RMontane7777 at 8:26 PM (GMT -4) on 15 Jun 2023]
anc
software
ADAU1787
Rev1831
Integrated/Special Purpose A/D Converters
V4.7
Sigma Studio with ADAU1467Z
adau1467z
Build 0
MFXLMS
Audio CODECs
Show More
Hello, first some comments/questions on your setup. Typically the Ref mic captures the noise, so I think your Main mic should be called Ref mic and the Ref mic should be called Error mic. For headphones Ref mic is outside and Error mic is inside. Also, you want the headphones placed on a head so that you have acoustic isolation between the Ref and Error mics, otherwise the anti-noise from the headphone speaker will crosstalk to the Ref mic and you wont get good cancellation. Another issue here is latency, you have some very short acoustic paths and delay through the Eval board may be to much to result in a causal system.
Thank you for the reply bitmechanic,
I appreciate your comments, I am operating the system with the Reference mic picking up the outside noise and the error mic inside on top of the speaker. I will re-label the program to align with this.
I am using a binaural microphone from 3DIO to act like the head for secondary path training and testing for cancellation.
Any thoughts on how to improve the potential latency? should I place the error mic further away from the speaker?
Also, what are your thoughts on MFxLMS downsampling to 2000Hz will we be able to filter out anything greater than 1000Hz or even if up to 2000Hz?
Hello,
Currently your Ref mic is 2cm away from the anti-noise speaker, that's an acoustic path of 0.02/340 = 6 uS
So your secondary path latency (acoustic + ADC,DAC,etc) needs to be less than that. 6uS is about 3 samples at 48kHz. The analog in to analog out of the Eval board is around 50 samples, so its too long. For headphone ANC customers usually use the ADAU1787 running at 768kHz which has a analog in to analog out latency of only 5uS.
To continue with your setup, you need to move the Ref mic further away from the head. Maybe try 0.5 meter away, with your noise source also near the Ref mic. If you are downsampling to run the MFxLMS at a lower rate check the latency to make sure you still have a causal system.
Thanks Again bitmechanic,
I appreciate this insight to the latency. We originally looked at using the ADAU1787, however, there was no available MFxLMS filter ready to use within SigmaStudio. We were looking for a quick way to develop a proof of concept. Is this available now?
Let me review and calculate the above. Based on the WIKI for the MFxLMS filter wiki.analog.com/.../mfxlms require the downsampling, not sure why exactly. Any other insight is greatly appreciated. Seems like this MFxLMS block could not be used for this application (Ref mic 2cm away form anti-noise speaker) even if the ADAU1787 supported it due to the downsampling.
Hi bitmechanic,
I am preparing a setup with the reference mic at 0.5 meters away (with the option to move further. in order to get something to work), Can you answer a few questions for me as well?
Can you elaborate more on a few things?
How does the down-sampling and up-sampling of the MFxLMS affect the latency? Does the entire system slow down to the down-sample rate of 2000Hz even though we up-sample back to 48KHz? . I am using this WIKI. wiki.analog.com/.../mfxlms
Do I need to downsample to use the MFxLMS block?
Can you elaborate more on this "So your secondary path latency (acoustic + ADC,DAC,etc) needs to be less than that. 6uS is about 3 samples at 48kHz. The analog in to analog out of the Eval board is around 50 samples, so its too long." I am a bit confused about how to apply it.
wiki.analog.com/.../mfxlms
Thank you in advance for your help here.
Hello,
2. Its not necessary to use down/upsampling with the MFxLMS module. In some applications, such as road noise cancellation, the noise is limited to lower frequencies, so running MFxLMS at a lower rate has some advantages, i.e. lower MIPS, shorter filters, which may improve performance and convergence. The wiki shows use of downsampling as an example.
1. Downsampling/upsampling requires filters which have group delay that adds to the overall audio in to audio path.
3. Secondary path latency i.e. acoustic delay + DSP signal path delay must be shorter than the Primary path delay, otherwise the the MFxLMS would have to go 'back in time' to get cancellation, i.e. the system would be non causal. For example if the noise source was closer to the error mic than the antinoise source the system would be non causal. When running secondary path training you can check the error to see if the filter is converging to a valid impulse response.
Please log in to reply.





