I'm trying to do a school project where I sample signals and apply a matched filter to them to detect certain signals. I've analysed the signal I want to detect and found out I'll need a sampling frequency of about 34 kHz to detect it properly (Nyquist sampling theorem). I'm using an MKR ZERO, mainly because of its higher amounts of SRAM (32 kb) and a faster clock (48 MHz).
The issue I'm having at the moment is that even with the faster clock, the MKR can only do about 29,000 ADC conversions per second. I've seen that people can change the prescaler on the ADC so that you can effectively increase the maximum rate you can sample at. I've tried to implement some code I've found online (https://forum.arduino.cc/index.php?topic=530905.0), but can't work out how to edit ADCRA.
Is there a library I can import? Or someway to adjust the values to change the prescaler?
Thank you for any help at all, even better if it shows I'm completely wrong in the first place lol