ΣSigmaStudio Ask AI Русский Log in

ADAU1761 Adaptive filter

SigmaDSP & SigmaStudio JohnAmpetronic Jan 9, 2014 00:00 9 replies Original on forum ↗
Subscribe
JohnAmpetronic Question
Jan 9, 2014 00:00

Hi All

I have been playing with module for a couple of months and I would like to help anyone who starts using it with the results of my tests. The toolbox documentation leaves a few gaps which I will try to fill here I would appreciate any comments as I might have got this completely wrong.

A standard adaptive filter is shown BELOW together with the assumed pins of the SigmaStudio block.

The first green pin on the left hand side (PIN0) is the non-inverting input to the mixer at the output of the NLMS. The second pin (PIN1) is the input to the FIR filter of the NLMS block. The third orange pin on the left (PIN2) is the adaption enable pin that controls the filter adaption. The coefficients can only change when this input is high (not 0). On the right of the block is the NLMS outputs. The first blue pin (PIN3) is the output of the mixer. The second pin on the right (PIN4) is the output of the FIR filter. The #taps box controls the number of taps used in the FIR filter. Alpha is the step-size and TC is the time constant for the normalisation.

First - Bretts example circuit for the filter needs a couple of changes

1) The adaptive filter length needs to be greater than the delay applied to the noise signal. The adaptive filter is trying to delay the noise by a similar amount which it cannot do if its length is shorter than the delay block.

2) The Alpha (update) coefficient needs to be small - large values will cause the filter to be unstable (try the below circuit with Alpha = 0.1).

There is, I think, a bug in the code in that the output of the filter from the orange control port should be 0 before the filter has adapted as the FIR coefficients should all be zero. This is not the case as there is output from this port even if the filter is never allowed to adapt.

You cannot use this block for noise cancellation as that requires an additional FIR filter in the error update path which is internal to the block which is a pity.

If time permits could you alter this block or produce a derivative so that

a) The FIR coefficients are initialised to zero

b) The adaptive filter alone is implemented. We can add the mixers etc outside of the block. This will make debugging much easier and allow noise cancellation and other optimisations to be performed.

If any of this wrong please tell me - it might explain why I have problems in my application!

Regards

John

55b80e4e0e3f045a7e1b5af3f28f033d.png
55b80e4e0e3f045a7e1b5af3f28f033d.png
55b80e4e0e3f045a7e1b5af3f28f033d.png-450x253.png
55b80e4e0e3f045a7e1b5af3f28f033d.png-450x253.png
90a9a0757d79f18c05bc3ea55d5374b0.png
90a9a0757d79f18c05bc3ea55d5374b0.png
90a9a0757d79f18c05bc3ea55d5374b0.png-109x111.png
90a9a0757d79f18c05bc3ea55d5374b0.png-109x111.png
ecf79c69c7d5dedae3e96d4f4370c66a.png
ecf79c69c7d5dedae3e96d4f4370c66a.png
ecf79c69c7d5dedae3e96d4f4370c66a.png-450x253.png
ecf79c69c7d5dedae3e96d4f4370c66a.png-450x253.png
ADIApproved Reply
Jan 9, 2014 00:00

Hi John:

Thank you for your post, we'll be happy to make the "FIR default to zero" modifications for your application. That's not a big deal but can you elaborate on" "You cannot use this block for noise cancellation as that requires an additional FIR filter in the error update path which is internal to the block which is a pity. " perhaps by showing us a block diagram.

Regards

Miguel

JohnAmpetronic Reply
Jan 9, 2014 00:00

Hi Miguel

Thank you for your prompt reply. The "coefficient start at 0" NLMS will really help me - thanks.

I should explain my remarks about noise cancellation - I meant active active noise control - creating a zone of quiet at a point. For echo cancellation where the filter acts directly on the signal to be removed your NLMS block as it stands is fine.

For the filtered-X noise control algorithm used in a good deal of noise control algorithms, an extra FIR filter is required to filter the input signal before it is used to update the coefficients. I will knock something together in power point tomorrow to illustrate.

Regards

John

ByronS Reply
Mar 10, 2015 00:00

Thanks for adding this post, as it has been very helpful to understand what the NLMS block is doing in lieu of docs from ADI.

Has there been any progress on this topic in terms of further examples etc posted by ADI that I'm not aware of? I have found a few things on the forum, but there doesn't appear to be much new posted on this topic.

I have a new project in which I need to have echo cancellation, so I'm playing with the ADAU1761 evaluation board. It works great at removing white noise, but when I feed the input with a streaming audio source (radio station coming from my PC) it doesn't seem to have much of an effect. My 'real' audio source that goes to pin0 is a pure sinewave source.

I see from a July 9th 2012 post by Brett (entitled 'Echo Cancellation') that the use of a IIR filter to roll off more of the low end. Since I don't have a means of generating the necessary coefficients for that type, I've simply added a cascaded high pass filter. Sof far, I'm still having minimal luck.

Any suggestions as to what else I'm doing wrong?

cc0ef22675c7ff0ff9a589dcf05c9360.jpg
cc0ef22675c7ff0ff9a589dcf05c9360.jpg
cc0ef22675c7ff0ff9a589dcf05c9360.jpg-620x214.jpg
cc0ef22675c7ff0ff9a589dcf05c9360.jpg-620x214.jpg
JohnAmpetronic Reply
Mar 12, 2015 00:00

If the circuit is working OK with white noise (I assume you mean the circuit in my first post) then have you tried feeding a white noise into the analogue input of this circuit? In theory, white noise is white noise whether it is calculated or digitised from an analogue input. This should tell you whether it is the content you are trying to cancel that is wrong or there is a fault in your program (unlikely). If you can cancel an analogue noise input, then you are in business. It then is a case of changing the coefficients of the filter to optimise the filter for the inputs you are using. I suspect for a radio station you will need to increase the value of Alpha (unless you are listening to heavy rock and then we are back to white noise). Increasing it too high will cause it to go unstable and it will be obvious if it does.

Good Luck

John

ByronS Reply
Mar 18, 2015 00:00

Hi John, I appreciate the reply. I should correct my statement from the 10th. It works great on eliminating a pure sinewave, but is really in-effective on white noise or 'real' audio. As you know, the upper mixer input is simulating the microphone audio I'm trying to keep. I took the analog input and fed it with PC radio source in place of white noise (using both music as well as talk radio). I've played around with the values (various combinations of Alpha and TC) for several days and had absolutely no luck in eliminating the radio source at all and minimal luck with the white noise.

My apologies, but I'm very much a novice when it comes to acoustic noise cancellation, so I'm still trying to get up to speed. After your original project post, where you able to get something working?

Is there another part within the ADAU series of parts that is more appropriate than the 1761?

I'm after whatever feedback I can get on this one before I completely abandon the 1761..

JohnAmpetronic Reply
Mar 19, 2015 00:00

Hi Byron

I think I can see where you might have made a mistake. The Sigma Studio adaptive filter has two inputs. The top one needs to be fed with a delayed version of your noise to be removed AND the signal you want to keep. The second input is fed with an un-delayed version of the noise. This configuration will let the filter converge.

I suggest you start with the circuit in my first post and confirm that the noise gets removed and the tone is left. Then, leaving everything else as it is, replace the W noise generator with the analogue input with the radio signal and see what happens. The important thing is to ensure that the mixer remains.

Good luck and let me know how you get on.

John

klangmeister Reply
Aug 17, 2015 00:00

Hi John,

I'm also trying to wrap my brain around this. Do you think it's at all possible to use the NLMS block for feedback cancellation in a PA-system type environment? (live amplification which feeds back into the microphone and then generates howling)

Best regards, Roman

JohnAmpetronic Reply
Oct 16, 2015 00:00

Hi Roman

Sorry this is a bit late! I don't think an adaptive filter is the correct architecture for acoustic howl reduction. Adaptive filters are good when you know the noise you want to remove (such as an echo or engine noise). I think the FFT based howl reducers are best when you want to eliminate a peak in the frequency response like a howl.

Regards

John

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin