Close

This ADC makes weird noises

A project log for Cortex Guitar Board

Audio DSP board based on a Cortex-M4 microcontroller for experimenting with things like guitar effects and sound synthesis.

Jonas NorlingJonas Norling 08/24/2016 at 19:334 Comments

I have noticed for some time that the line-in signal from the codec (WM8731) can have some strange noise components. When the input is silent, like when it's left open or shorted to ground, I would have expected the signal to be pretty close to zero and have a flat noise floor when looked at in the frequency domain. I noticed that the noise components can be moved around, and sometimes made to almost disappear, by poking at the audio input in different ways or feeding it different signals. My guess was that there was something non-optimal about the power supply or the I2S clocking. But the weirdness reached a new level when I noticed that a new batch of chips (labelled "58AJMDN") made different noises than the old ones ("56ADMDN"). The old would have a soft band of noise around 2 kHz + harmonics, while the new ones had a sharper noise peak around 1 kHz. This prompted deeper investigations, and furrows upon my forehead.

After doing all the physical/analog things, like exchanging codecs between boards, adding decoupling capacitance and trying different weird clocking and PLL options, I started to go through the datasheet again and toggle configuration bits. There was something that made a clear difference — turning off the automatic high-pass (DC removal) in the ADC made most of the problem disappear. There was quite a large DC offset to be removed in software then, and that offset seems to be internal to the chip somehow.

The picture above is a spectrum captured with Baudline, over USB, of the line-in signal. The measurement was with the line-in connector essentially shorted (there was a pair of headphones connected). The DAC was fed with the incoming signal in the first two cases, then with a generated sine signal in the third case.

All of those have some noise where it shouldn't be, but it's centred around different frequencies. The peaks at around 1050 Hz, with harmonics, can be audible and annoying at very low levels. Whiteish noise at the same low level isn't really audible, or at least it's very much easier to not care about. And a bit of crosstalk between output and input in an integrated codec chip is also pretty easy to forgive.

Everything I change gives slightly different weird results. Disabling the DAC and muting the DAC generates some artefacts. Letting the DAC output a constant DC signal of 100 (S16 samples) yields a pretty nice and flat noise floor from the ADC, but there are still some strange spikes here and there.

Discussions

Svilen Stoyanov wrote 06/18/2017 at 21:45 point

With a completely different board, but with same codec - WM8731, I noticed a clicking noise and found that is related to the HPF. When was searching on the net, I found your post and can confirm that there is something wrong with it.

  Are you sure? yes | no

K.C. Lee wrote 08/24/2016 at 21:03 point

Not sure if this is the issue:

AP2210 datasheet: - See ESR vs current plot.  So have to make sure that your 10uF output decoupling cap is within the range of stability.  (MLCC typically are too low!) Seen other LDO oscillate for failing to observe that.
Noisy power supply -> noise issues.

  Are you sure? yes | no

Jonas Norling wrote 08/25/2016 at 20:24 point

Thanks for the tip; that is certainly something to keep an eye on that I wasn't aware of!

The power rail from the voltage regulator looks and sounds pretty clean (I find that listening to it through headphones via a capacitor is a good debug tool).

The DAC signal shows up as noise on the codec's analog rail, even if the DAC is muted, and that noise comes from inside the codec. The strange noise components (1kHz, 3kHz, 5kHz, …) are not present on the supply rails as far as I can see.

  Are you sure? yes | no

Andrej Radovic wrote 12/02/2017 at 20:14 point

I know this is way too late, but I'll leave an explanation for everybody that ends up on this page in the future.

WM8731 is just not usable in a guitar pedal because of its crappy THD+N specs. The noise you're experiencing is always present, even if you have a super clean (<10uV variation) power supply. The DAC noise isn't as bad as the ADC noise, so the codec would work okay in something like a cheap MP3 player or boombox where it's used as a DAC. The ADC would be bad even in a dictation (speech) recorder. Combined, they're great at emulating radio static - worse than white noise.

WM8731 is particularly unsuited to guitar pedals, yet it works 'okay' in Mutable Instruments' eurorack synth modules. The reason is gain. Pedals get chained with other pedals and then connected to amplifiers. Boost/drive/distortion/fuzz pedals have tens of decibels of gain. Amplifiers' preamps have some serious gain, too, especially if you're getting them to the verge of clipping (or outright getting them to clip). Remember, you could amplify your signal 60dB, the tops would just clip and the 'soft' parts (like noise) are still amplified 60dB.
Now, every time you amplify a noisy signal by a factor X, you're amplifying the noise by X as well as the signal. When you amplify the signal 100 times (from 0.3V to 30V, that's +40dB), you also amplify the noise by the same amount. And that -74dB noise floor becomes a very noticeable -34dB noise floor. That's just amplifying a Strat to the point just below clipping for a 100W amp with 8Ohm speakers. If you add more gain, you get more noise. I tried it with an AC30 on medium gain (5-6 on the volume pot, top boost channel and it's unbearable.

That's why pedal manufacturers use converters with a very low noise floor. Strymon uses Cirrus Logic CS4272 (114dB thd+n), even Boss uses AK4452 (100dB thd+n) in their 2008 DD-7. Old equipment (DD-2 and vintage racks) used companders to hide the problem, back when there weren't any decent codecs available.

  Are you sure? yes | no