Hello, I'm currently working on a project involving using an analog pin as an audio input, and I've been having some problems with harmonic distortion. The pin is being used to measure the voltage output of a microphone preamp at a sample rate of ~10.3kHz, and the distortion issue is apparent when looking at a plot of the signal being read by the Arduino: when playing a pure 233Hz sinewave into the input of the preamp, the signal that's received is heavily distorted. Looking at the spectrum of the signal, it's clear that this is harmonic distortion, because there are sharp frequency bands that form at integer multiples of 233Hz.
[this is where a couple images of the distorted signal & its spectrum would be, but I'm not currently allowed to upload more than one image]
I've been testing the system by playing signals directly into the input of the preamp using an external DAC, and the distortion issues have been present for every signal I've tried.
I am using an SSM2166 preamp, and I have it set up pretty close to how the datasheet suggests; the only notable difference is that I'm using a really small (2.2 microfarad) averaging capacitor for the level detector because, according to the datasheet, using a smaller capacitor is necessary for good low-frequency operation. Here's a schematic showing how the preamp is wired and connected to everything else:
I don't that the distortion is the result of a minor wiring mistake, as I've built two of these already and they both have the exact same problem. There probably isn't an easy solution to this, but if anyone at least has an idea of what the source of the problem might be, I'd appreciate some advice!
Thanks in advance.