Audio input problem
Posted: Tue Jun 04, 2019 5:10 pm
Hi.
I'm currently working on a device with an audio input. Here's the schematic I'm using:
The audio comes from an male audio jack. The ADC resolution is set to 9 bits and channel 6 and 7 attenuators are set to 11 dB. My code currently reads a value from ADC1 channels 6 and 7 and feeds them to both DACs of the ESP32 at GPIOs 25 and 26 respectively, after dividing the input value by 2 to get an 8 bit range, at 40 kHz sample rate. When nothing is connected to the input, I can't hear anything, even the noise. But when I connect some device like a PC or a phone to the input, even if it's not outputting anything, I can hear a vinyl record-like noise and cracks on the output. By disabling the DAC and feeding ADC values to the UART and plotting a graph of these values, high spikes up to 10 steps with a duration of 1-2 samples can be seen. Is this a hardware problem or the way ADC works?
Thanks for any response.
I'm currently working on a device with an audio input. Here's the schematic I'm using:
The audio comes from an male audio jack. The ADC resolution is set to 9 bits and channel 6 and 7 attenuators are set to 11 dB. My code currently reads a value from ADC1 channels 6 and 7 and feeds them to both DACs of the ESP32 at GPIOs 25 and 26 respectively, after dividing the input value by 2 to get an 8 bit range, at 40 kHz sample rate. When nothing is connected to the input, I can't hear anything, even the noise. But when I connect some device like a PC or a phone to the input, even if it's not outputting anything, I can hear a vinyl record-like noise and cracks on the output. By disabling the DAC and feeding ADC values to the UART and plotting a graph of these values, high spikes up to 10 steps with a duration of 1-2 samples can be seen. Is this a hardware problem or the way ADC works?
Thanks for any response.