Reducing Noise - Analog Supply?

Status
Not open for further replies.

chipaudette

Well-known member
Hi All,

I've been fighting noise issues with the Line-In on the Teensy Audio Board. It's a pretty persistent pulsing hashy kind of noise that my intuition says is related to digital activity on the board. So, I'm looking to see if I can trouble-shoot the issue by looking to better isolate the analog section of the Teensy Audio Board from the digital section.

Looking at the schematic, I see that there is a ferrite separating the analog supply pin from the digital supplies.

AudioBoardFerrite-Schem.png

I'm thinking about removing that ferrite and inserting a low-noise LDO to be (possibly) better isolation for the analog supply. Since there is no PCB layout published for the Audio Board, it's not obvious to me which component is the ferrite. Can anyone help me interpret the layout. Which component is the ferrite?

AudioBoardFerrite.jpg

Thanks,

Chip
 
Chip,

Do you have a spectragraph of the noise? It might help to determine the type/frequency of possible sources.

R.
 
Do you have a spectragraph of the noise? It might help to determine the type/frequency of possible sources.

I did a test using LineIn as my input (using the default LineIn gain command of 5) and I set the headphone volume to be 0.5. Attached to my LineIn are are two electret mics from Adafruit (SPW 2430), though it makes the same noise if I replace the microphones with 1 kHz resistors.

I recorded the audio over USB into Audacity via the Teensy's USB Audio Output feature, as I found that the noise sounds similarly through the headphones or via USB into the computer.

During this recording, my laptop was unplugged from the wall outlet, but that makes no difference. Also, I've run the Teensy off battery (to my headphones) and it makes this same noise.

Below is the spectrogram. It shows strong lines at ~2 kHz and ~5.5 kHz. They're strong but fuzzy, which reflects that they don't sound stationary. There's also some lower frequency garbage that is apparent when you make it louder, though this low-freuqency stuff is not nearly as annoying as the high-frequency stuff.

NoiseSpectrogram.jpg

Below is the average spectrum for the whole recording. I don't like how Audacity auto-ranges the vertical axis, but you can clearly see that the ~2kHz tone (actually 1.8 kHz) is about 59 dB down from "full scale", which is quite noticeable. If you want to apply any additional gain (for super-hearing!) this tone gets louder and quickly becomes unbearably annoying.

NoiseSpectrum.png

Any thoughts would be greatly appreciated. As I said, I've tried running off battery and I've tried replacing my mics with equivalent (short leaded) resistors. No help. Any other thoughts?

Chip
 
Last edited:
Additional tests show that this Line-In noise is not affected by the Line-In gain setting (I tried the default value, "5", as well as values of "10" and "15").

This result (if true) suggests that the noise is entering after the variable gain element built into the codec. I'm very surprised by that.

How stable are the clocks being fed to the codec? They're generated by the Teensy, but are they stable? Is instability being picked up by the analog portions of the codec during the ADC process? Hmm...

Chip
 
Chip,

Very interesting.

Firstly, the short story is that I have essentially the same issue (see attached T36_Shield2_Silence_4096pt_180M_QbasedPThru).
T36_Shield2_Silence_4096pt_180M_QbasedPThru.jpg

I have my analyzer set at 4096 points so I see a bit more detail, but you can see they are saying the same thing. I've set its parameters so it matches your grid and scaling etc.


The pink line shows a smoothed average, green shows the peak level.

My testing so far with the 3.6 has been with the noisy FFRT/IIFT setup so I haven't noticed before. Also, when there's a strong signal happening (e.g. a 5kHz sine wave), the level of the noise seems to drop significantly which masks the issue quite a bit.
Not sure why. See T36_Shield2_1kHsine_4096pt_180M_QbasedPThru and T36_Shield2_5kHsine_4096pt_180M_QbasedPThru
T36_Shield2_1kHsine_4096pt_180M_QbasedPThru.jpg
T36_Shield2_5kHsine_4096pt_180M_QbasedPThru.jpg
Second thing is that my Teensy 3.2 and its Audio shield do not show this problem at all. (see attached image with Teensy32_shield2). There is still noise of course below the -90db level, but the analyzer display settings are excluding these. See T32_Shield1_Silence_4096pt_180M_QbasedPThru

T32_Shield1_Silence_4096pt_180M_QbasedPThru.jpg

To make sure, I swapped over the audio shields between the two Teensies (I have them attached to the Teensies via un-pluggable female risers). The problem stayed with the Teensy 3.6
The wiring to the breadboard also goes with the shield as they are soldered in to line-in, out, ground etc on the shield).

I seem to have a slightly lower level of noise with my system, even accounting for the fact that I leave about 3db headroom on full scale signals on input. The levels do vary over a period of time though.

Overall, a rise of the effective noise floor from around -86db to -66db or more is not at all good.

All the tests above were performed using a simple sketch that passes though audio based on copying samples from an input queue Library object to and output queue object.

I tried reducing the clock speed so I could try with the standard StereoPassThrough sketch, with interesting results.
For example at 72Mhz there is a very similar noise peak, but at about 17kHz rather than 1.8kHz.
The 'queue' based passthrough sketch with this clock speed still showed the noise at around 1.8kHz, but the (green) peak levels at the higher frequencies had grown quite a lot. (see attached T36_Shield2_Silence_4096pt_72MHz_StereoPThru and T36_Shield2_Silence_4096pt_72MHz_QbasedPThru).
T36_Shield2_Silence_4096pt_72MHz_StereoPThru.jpg
T36_Shield2_Silence_4096pt_72MHz_QbasedPThru.jpg

All of the above was done with Arduino 1.6.12 Teensyduino 1.31 beta-1.

Hopefully Paul & co can reproduce this stuff and make some sense of it.

I've run out of time for further testing, and I will be offline after today for a week or so unfortunately, but I'll try to check in when I can.

Good luck!
 
Last edited:
Thanks for all of this added info on your noise findings. While the Teensy 3.6 is my primary focus, I'm intrigued by your finding that you do not have the noise problem with the Teensy 3.2. In my memory, I do have the noise problem with Teensy 3.2. I'll have to make some recordings to see if reality matches my memory. :)

Chip
 
Last edited:
I definitely get noise with certain configurations of the Audio Board with Teensy 3.2 For example, I definitely get the noise with the Teensy 3.2 when I short the line-ins to ground.

In digging through other threads here in the Teensy forum, I came across a thread where someone was building a hi-res audio board. As part of that thread, there was this post that talked about reducing noise: https://forum.pjrc.com/threads/27215-24-bit-audio-boards?p=78831&viewfull=1#post78831

I tried Raj's suggestion to to audioShield.adcHighPassFilterDisable(). For the noise that wobbly squealing noise that I'm getting, issuing that command got rid of the noise. Amazing! Yay!

Chip
 
Last edited:
I just tested with the Teensy 3.6 in place of the Teensy 3.2. This adcHighPassFilterDisable() gets rid of the same squealing noise that I was hearing with the Teensy 3.6 as well. Double Yay!
 
How stable are the clocks being fed to the codec? They're generated by the Teensy, but are they stable?

There are 2 main sources of error in MCLK & BCLK.

#1: At some CPU speeds, the divisor from the main PLL clock isn't an integer. The hardware uses varying duty cycle to make up the difference. I recommend testing at 96 MHz CPU speed, since the divisor allow the same duty cycle for all clock pulses.

#2: The PLL has jitter. All PLLs do. There really isn't much that can be done about this, since it's entirely inside the chip.
 
There are 2 main sources of error in MCLK & BCLK.

#1: At some CPU speeds, the divisor from the main PLL clock isn't an integer. The hardware uses varying duty cycle to make up the difference. I recommend testing at 96 MHz CPU speed, since the divisor allow the same duty cycle for all clock pulses.

#2: The PLL has jitter. All PLLs do. There really isn't much that can be done about this, since it's entirely inside the chip.

So, I was chasing down an issue where I hear a quickly varying tone around 9kHz when doing filtered pass-through on a quad-i2s setup, per the sparkfun hardware guide. I'm doing a simple crossover with a quad-i2s setup. Stereo in on channels 2,3, and bass-out on channels 0,1, high-freq out on channels 2,3. When changing the crossover filters to just pass-through, I clearly hear the quickly varying 9kHz tone on the "left" channel of both boards. When I specify the MCU frequency to be 96 MHz, the 9kHz oscillation completely goes away. I still hear a bit of broadband-noise, but not a tone.

I'm posting this because changing from the default MCU frequency to 96MHz, per Paul's suggestion, helped get rid of a 9kHz noise for me. For more context, this 9kHz noise is only present when the DAC volume is high. I observe this varying 9kHz tone when the dac volume is -1 dB or I'm setting the DAC volume pretty high at -1.0 dB or 0.89. While the clock is still 72 MHz, and I change the DAC gain from -1.0 dB to -6.0 dB (or 0.5), the varying 9kHz tone is at a much lower volume and instead of changing quickly, it changes slowly. When I say "changes slowly", I mean it's a seemingly constant frequency for 5-8 seconds, then changes to a new value for 5-8 seconds, and so on.
 

Attachments

  • gain_72MHz_-6dB_9kHz_weak_slow.jpg
    gain_72MHz_-6dB_9kHz_weak_slow.jpg
    76.7 KB · Views: 58
  • gain_72MHz_-1dB_9kHz_strong_fast.jpg
    gain_72MHz_-1dB_9kHz_strong_fast.jpg
    92.1 KB · Views: 55
Hi Chip, The part your arrow points to is indeed the ferrite. I did exactly what you are describing and it dramatically reduced the noise! I built a linear supply and connected it across the VDDA cap just to the left of the ferrite in your picture. I also built a 5V linear supply to power the Teensy. There's a picture and more information in my thread, "Bass Preamp Project" down the screen somewhere :)

On a related note, I was trying to use A8 as a pot input, but found that the noise from BCLK and MCLK were inducing a lot of noise on that input. Not surprising because A8 (pin 22) is right between those two signals! I confirmed that if I disabled the Audio Shield, the noise on A8 disappeared.

Did you create the F32 library? I switched my design over to that library and it's working great! I especially like Compressor2 - I've got it configured as a limiter on my bass preamp and it performs just as I'd expect.

Hope this is helpful!
 
Status
Not open for further replies.
Back
Top