Thanks for your response! You're correct in assuming that by 'moving average of every 4 bits,' I intend to downsample the data. Essentially, I plan to average groups of four consecutive bits to reduce the data rate while retaining essential information. So, The effective sampling rate would be approximately 390Mbps (65Msps x 12 bits x 2 ADCs / 4).But maybe by "moving average of every 4 bits" you intend for Teensy to downsample the data? Really just guessing here, as I really don't have any idea what those words are meant to say.
Yeah, you are totally right! that's what I meant, lost with my lingo.Do you mean averaging groups of four consecutive 12-bit values? To say "four consecutive bits" is incorrect and confusing.
Essentially, I plan to average groups of four consecutive bits to reduce the data rate while retaining essential information. So, The effective sampling rate would be approximately 390Mbps (65Msps x 12 bits x 2 ADCs / 4).
I aimed to overclock it to overcome any CPU cycle limitations and dedicate a USB port on a machine to achieve full speed. But it seems even if I managed to use two samples per 32 bits bus to gain CPU cycles, any drop in the rate from USB side would cause data loss without a huge pool of RAM to maintain data flow. I am not sure if Teensy DMA can handle SDRAM and two 12bit ADC.Acquiring from the ADC at that speed will also be quite a challenge. FlexIO2 with DMA is probably the only realistic hope. Recently 16 bit high speed FlexIO reception has been discussed. Maybe you can find those conversations, or someone might give a link to those.
Implementing the downsampling code might also be quite a challenge. On average, you'll have only about 9.23 CPU cycles per incoming data. Or maybe a better way to think about it would be almost 37 CPU cycles per downsampled output. You'll need to fetch 4 raw data from memory, add them together, shift (divide by 4), and store to the output buffer. Since the data will be 16 bits (FlexIO can't do 12, so you must have 16 with 4 zeros) maybe you can use techniques like in the audio library to bring in 2 samples per 32 bit bus read and use the DSP extension instructions to do the addition step. Complicated, but that's probably the sort of effort needed to get this to happen with 2 streams ot 65 Msample/sec using only a 600 MHz CPU.
Not impossible, but pretty unlikely you'll succeed in pushing the hardware this far.