ADC jitter/noise only at certain frequencies

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using an atxmega32a4u and I'm getting some sort of weird noise/jitter/aliasing or something when trying to sample the ADC at certain frequencies. The ADC clock at 1.5 MHz. I have a timer configured to take samples at various frequencies below that. The timer triggers an event which tells the ADC to take a sample. When the sample is done this triggers a DMA transfer to SRAM.

It "works" but at certain timer frequencies I get crazy noise in the results.

Take a look at the images here. These are all sampling the exact same signal. The sample is good at 100, 250, 300, 750, 1500 kHz, etc. The samples at 400, 700 kHz, and other frequencies are filled with horrible (and variable depending on frequency) noise. Note, in the images the scaling is the same, notice the amplitude is way higher and includes regular noise on "bad" sampling frequencies.

It seems to get a clean signal only at multiples of the ADC clock (1.5 MHz). It does not matter what the ADC clock is set at, it can be slower and the results are the same which some sampling rates being clean and others full of noise.

Anyone have any idea what is going on? To me it looks like some part of the back-end (DMA or something) is transferring the data in mid-sample before it is complete or something. :(

Edit:
I made better images to show the issue. I put them all on one page.

Last Edited: Sun. Sep 15, 2013 - 02:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Those look suspiciously like the frequency is above 1/2 your sampling rate.

That's NOT the problem I'm having. My ADC always says -2048 counts. No jitter at all there!

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The sampling rate is 1.5 MHz and I'm pulling values off the ADC much slower. Although I can pull them at 1.5 MHz and they are clean.

I think it's some sort of aliasing or interference problem between the timer, ADC, and DMA... or something. It's just weird, at "bad" frequencies the amplitude increases by 2 or 3 times and it's filled with regular looking noise.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The images do give something of a qualitative idea of what is going on, but, without a quantitative information, it is difficult to guess. But, some questions: 1) what is the absolute value of the noise at "good" and "bad" frequencies, 2) what is the input signal ( source and circuitry )?

Agreed that it seems to be far too systematic for random noise, however, that does not rule out things like aliasing ( as you mentioned ) created by beat frequencies between things ( e.g. the signal and sampling frequencies ).

Martin Jay McKee

As with most things in engineering, the answer is an unabashed, "It depends."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes my original images are not great examples because even the "good" ones look noisy and the gain is high.

Here are some better ones. These are all showing the same simple binary TTL pulse. ADC clock is still 1.5 Mhz. Only multiples of the ADC clock are clean. Any offset from that introduces noise. Notice the difference between 375 kHz and 380 kHz when noise starts to come in.

Here I put all the images on one page at full resolution.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I'm making some progress. It looks like the error/noise is much less if I use a lower input impedance. The problem this creates too much load on my input source. I suppose I need a buffer/amp.

Interesting that it seems like it might be possible to compensate for high input impedance by simply pulling samples only at a multiple of the ADC clock.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What *is* the impedance of the source ?

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It could look like a mixing product of some kind, either from the AVR or your source.
Do you have a PWM or something like that running?
perhaps from the source.
Do you get power from a switch mode PSU it could come from there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Originally my impedance was approximately 390k. Yes, way outside the xmega's ADC specs apparently. It does seem to work if sampled at multiples of the ADC clock, kind of cool.

I have PWM running which is what sets the frequency that I'm capturing samples at (300 kHz, etc).

Anyway, now running with approximately 5k input impedance seems to have fixed the noise. I just need to figure out a way to only load the source with 390k instead of 5k. Probably op amp or something.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It depends on the sensor .... but often is adding 100nF to the ADC-input doing great.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips