Potenial correction in AFC example?

I am noticing that the newest_ring_audio_block_id variable in AudioFeedbackCancelNLMS_F32.cpp gets updated after update() is called. There is a check in this update() to see if the algorithm is outpacing the feedback data, comparing the current block id to the newest_ring_audio_block_id (which is updated in AudioLoopback_F32.cpp). This check should always find an error since at that point the current block id will be higher than the newest block id variable.

So i suggest changing the inequality from > 0 to > 1 on line 25 of
AudioFeedbackCancelNLMS_F32.cpp (and for NXLMS). Otherwise this makes it impossible to read the serial monitor. I was able to make this change no problem, but let me know if I shouldn’t do that.

Oo! Good analysis! Thanks for looking at it so deeply.

I can’t look at it myself until Monday. Sorry. I’ll check it out then and report back.

Chip

@K_S, You were right!

I fixed the warnings so that off-by-1 is expected and so that it won’t start displaying errors until it’s off by 2. I’ve pushed the changes up to the main Tympan_Library repo on GitHub. You should get them if you update your Tympan_Library.

Thanks for finding this issue!

Chip

1 Like