WiPy2 ADC performance



  • Has anyone any experience with audio ADC sample rates on the WiPy2?

    A simple "for loop" doing an ADC read (specifically "adc_c.value()") gives about 15k samples per second (15000 samples in 1048ms).

    I'm hoping that's nowhere near optimal, and would love guidance on getting this to run MANY times faster. I'm hoping to sample 4 channels of audio at 16k samples per second,

    Possible solutions:
    Timer driven callback (not sure how much time is taken by the for loop)
    Initiate sample, and come back in a little while (not sure if this is planned for the API)
    Some sort of direct dump of samples into memory (DMA or something)

    Anyone have any hints?

    Cheers

    Jon



  • Actually I did not find one which would suit. Theer are plenty at any quality for the acquiring side, but no device buffers the output, and that is the same problem you have with the internal ADC - accepting and handling the data in real time w/o any loss. Even if you limit the bandwith to e.g. 5 kHz, you have to process 10k samples per channel. at least.



  • Any suggestion about an external ADC that can sampling audio for Pycom boards?



  • The ADC of the ESP32 is very noisy and non-linear. You'll find some discussiona about that. The noise is like +/- 10 LSB. You can get acceptable values by averaging like 1000 samples. For an audio application I would expect nothing but noise and distortion. Better go for an dedicated external ADC.



  • Hi, I'm very interested in what you are doing. Can you explain to me how works your code?

    Thanks


Log in to reply
 

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.