Hi, I'm fairly new to programming but for my final year uni project I'm needing to develop a DSP that automatically time aligns a DI signal and a microphone signal (the DI signal roughly needs to be delayed by 1ms). I'm just wondering if anyone has any good pointers to actually get me going with my task. I'm using a BeagleBone Black with Bela capes.
Wow. This is not really a beginner C++ question. I do a fair bit of embedded DSP coding for fun. When you say that you need to automatically time align the signals, are they the same waveform? How will you know when they are aligned?
In general, the way to do this is with a delay line on the "early" signal (or both if you don't know which will be early). If your sample rate if 48K sps, then you have a delay of about 48 samples for 1ms. Use a digital PLL routine to align the signals. You should be able to mock up the code in GNU Radio or Python (scipy) pretty easily, then port it to the BBB.
I mock up most of my DSP code in scipy because I can visualize the data using matplotlib in near real time, and it is at a much higher level than my C++ code.
Essentially I'll be using a software called clio that will read the two outputted signals, which will then tell me whether they are lined up or not. I've already done some preliminary tests in which I did the time alignment manually through a mixing desk into clio, hence why I know it needs to be around 1ms.