Hi,
I will be using Bela for making ANC. Idea is to cancel audio from range 50-500 Hz and I wanted to make sure everything works fine before moving algorithm to actual platform. On actual platform I will use ALSA library to make this APP. Both platforms are ARM and processing will be done on CPU.
Before everything I wanted to make sure that this is feasible, by that I mean I need to find appropriate block size and sampling frequency and to calculate minimum latency, since ANC needs to run in real time.
Sampling frequency is limited to 48000 on actual platform (hence I will use that on Bela as well). So I just need to find appropriate block size. Do you have suggestion for block size that will make feasible ANC when it comes to Bela platform?
I would appreciate any suggestion/experience/thought.
My calculation goes like this: maximum latency is limited with upper frequency (1/500 = 2ms). Block size will be limited to 0.002 > 2* blockSize/48000 and that is 48 > blockSize.
Active noise cancellation feasibility
You are missing the converter's group delay. The one on Bela has 38 samples roundtrip group delay, plus add a couple of samples for serializers. So the roundtrip latency on Bela is 40 + 2 * blocksize / samplerate
. When using ALSA you'll have higher latency because of additional buffering and larger minimum usable blocksize.
To get smaller group delay, you could use the analog I/Os instead of audio I/Os, but the quality is lower. This could be relevant: https://blog.bela.io/analog-vs-audio-on-bela-explained/