Noisy A/D performance
BradC
Posts: 2,601
G'day all.
I'm doing a bit of audio signal processing and trying to get optimum performance from the delta sigma A/D the prop can do.
A closeup of the configuration is attached.
I'm running 2 channels, one has 1nf caps high and low, the other has 10nf caps high and low. (don't need 2 channels, just experimenting)
In the picture the extra cap is between the vdd and vss pins. I've used pin0 as the detection pin and pin 2 as the feedback pin. Pin 1 has been tried as an input, an output high and low.
Started with 100k feedback resistors, but I've got better performance from 33k.
Now, to the problem. I'm seeing instability of the readings. The capacitor size (1 vs 10nf) makes no difference to the noise levels.
The code I'm using is identical to the code in the application note. I've also tried a modified version of the Microphone to Headphones demo. I'm pretty convinced its not a software issue.
The sound is great when there is a sufficiently large input signal although the noise is still superimposed on it (you just can't hear it relatively), but when the input signal is very slow changing or static the counter hunts anywhere +/- 5 counts per sample.
I'm running in 12 bit mode at 19.5Khz, but it makes no difference. The instability is about the same no matter how fast or slow I run it.
Now, when things are static for a while (a few seconds usually) the counter will lock onto the signal nicely and hold a reading but if I disturb things with the tip of my finger, it will hunt for a while before it finally settles down again. By feeding the A/D output directly into a duty D/A the noise is very obvious. When it settles finally the silence is deafening!
With the 33k resistor it settles a lot faster than with the 100k. I tried lowering the value further but the noise values remain about the same while the sensitivity drops considerably.
I'm just stumped as to how I can improve the noise level short of a digital low pass filter (which I don't really want to do too unless I have no other option).
Of course the other option is to use an external A/D converter, but where is the fun in that ??
Is anyone else doing audio processing using the chip as a converter?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
Post Edited (BradC) : 9/11/2009 11:47:16 AM GMT
I'm doing a bit of audio signal processing and trying to get optimum performance from the delta sigma A/D the prop can do.
A closeup of the configuration is attached.
I'm running 2 channels, one has 1nf caps high and low, the other has 10nf caps high and low. (don't need 2 channels, just experimenting)
In the picture the extra cap is between the vdd and vss pins. I've used pin0 as the detection pin and pin 2 as the feedback pin. Pin 1 has been tried as an input, an output high and low.
Started with 100k feedback resistors, but I've got better performance from 33k.
Now, to the problem. I'm seeing instability of the readings. The capacitor size (1 vs 10nf) makes no difference to the noise levels.
The code I'm using is identical to the code in the application note. I've also tried a modified version of the Microphone to Headphones demo. I'm pretty convinced its not a software issue.
The sound is great when there is a sufficiently large input signal although the noise is still superimposed on it (you just can't hear it relatively), but when the input signal is very slow changing or static the counter hunts anywhere +/- 5 counts per sample.
I'm running in 12 bit mode at 19.5Khz, but it makes no difference. The instability is about the same no matter how fast or slow I run it.
Now, when things are static for a while (a few seconds usually) the counter will lock onto the signal nicely and hold a reading but if I disturb things with the tip of my finger, it will hunt for a while before it finally settles down again. By feeding the A/D output directly into a duty D/A the noise is very obvious. When it settles finally the silence is deafening!
With the 33k resistor it settles a lot faster than with the 100k. I tried lowering the value further but the noise values remain about the same while the sensitivity drops considerably.
I'm just stumped as to how I can improve the noise level short of a digital low pass filter (which I don't really want to do too unless I have no other option).
Of course the other option is to use an external A/D converter, but where is the fun in that ??
Is anyone else doing audio processing using the chip as a converter?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
Post Edited (BradC) : 9/11/2009 11:47:16 AM GMT
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
I'm just not sure how to remove all the noise the ADC produces. When left alone the value from the ADC hovers around 140/255 which is about right. But when the I apply an audio signal for passthrough the ADC and out to the DAC the noise is just tremendous.
Its like theres a 70 HZ wave out static on the line or something. I can hear the real audio source in the background but in the foreground its just all noise.
I do not belive there is a problem with the DAC as its been able to play wave files smoothly.
Anyone know where I could find documents related to audio processing to remove all that noise?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
Anyway, here is one link for consideration.· Most of what I have found in the past has been in C, but you should be able to infer it's operation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I have noticed that nearby pins can add noise... For the dip package, I had gaurd pins set to output 0 in either side of the signal pins (it's a waste of pins, but I had extra...)...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
Hrm.. mine is not that bad. My audio is crystal clear, just with a light fuzz on it (not distortion, just overlaid noise). Guess I can't expect a great SNR with only 12 bits [noparse]:)[/noparse]
Tried new caps Leon (nice 1nf monoblocks) but no improvement.
Time to break out the CRO I guess.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
I tried the guard pins to 0, and I tried them to +3.3v internally. No dice.
*then* I put 470nF between pins 1 & 3 (feedback is on pin 2, and input is pin 0), tied pin 3 to +3.3v externally and *poof* noise gone. Noise was 14 counts, it's now 2. Massive improvement.
As soon as I arc up the D/A converter it comes back though. I suspect it's related to the layout I'm using on the Proto board. Oh well, I'm a step closer anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
Note about the circuit layout, from the Spin test object:
' It is very critical that the following circuit be connected within a few millimeters of the
' Propeller pins, since at 80 MHz there is a 12.5ns feedback loop operating. Normally, this
' kind of thing is done on-chip, where parasitics are minimal. This probably will not work on
' the breadboad, at all. I soldered 0603 SMT parts directly onto the pins to keep things
' short and it worked beautifully:
http://forums.parallax.com/showthread.php?p=576575[noparse][[/noparse]url]
Post Edited (Bob Lawrence (VE1RLL)) : 9/11/2009 4:32:10 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
and having high precision at 5 volts or less (worse) is hard even with external ADC,
which needs capacitors on the power supply pins and input to absorb all of that RF noise in the circuit,
and averaging samples which still float after all that.
But even an (LM386) analog audio amplifier probably has more noise, and since Reality is analog except at the
noisy quantum level, it's probably impossible to remove all quantization noise from digital audio and
have an input-output connection with less noise than anything analog possible. Is there any such thing as a
digital microphone or a digital speaker? Funny idea but if there was quantum-level quantization in such
imaginary things, there would still be loss from finite sampling rate and influence from other noise sources,
including state changes in any logic gates in between the input and output.
Anything that can present a noiseless model of Reality must be a Synthesizer (or a Virtual Reality).
The noise envelope changes depending on which cog the A/D is running on. It gets slightly cleaner as I move from cog 0 to cog 7. In addition, if I shut down all the other cogs it cleans up nicely. It *appears* that accessing the HUB is ever so slightly changing the threshold voltage on the feedback pin. A SPIN cog running hard induces more noise into the system than an assembler cog doing maths but not touching the hub.
I can't measure accurately less than 20mV on my CRO and the hash on the 3.3v rail is up around 20mV, so I suspect the threshold point is changing due to either internal power distribution resistance in the chip itself, or insufficient bypassing on the Propeller Proto-Board.
I thought I'd get clever and set up an identical parallel A/D circuit, just without the audio input and see what happened. As it turns out, the noise envelope is almost identical to the first unit. (The phase and envelope is identical) Logically this means the threshold on both input pins is varying precisely the same amount as the 3.3v rail fluctuates. I thought I'd get clever and try to subtract the noise from the reference converter from the audio converter, but it's just different enough to leave a significant noise signal behind.
Time to start looking for a small external 12 bit converter I guess. I was hoping to get away with just the prop and an op-amp.. oh well.
Oh, and the noise gets significantly worse when I start swinging other pins around, so it *has* to be something to do with the threshold point on the feedback pin. I just can't see any other reason for it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
Rayman have a nice applet on his site
Perhaps you should consider Vdd/Vss AVdd and AGnd. In this way you will remove most of the other logic switching noise from the input pin. I think that C1+C2+R1 tap should be as close as possible to the prop input, but for C1/C2 Vcc/Gnd i think is better if they are well filtered. Ofcourse if you're doing audio you have a capacitor instead of R2
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· Propeller Object Exchange (last Publications / Updates)
Post Edited (dMajo) : 9/12/2009 9:42:15 AM GMT
With a 5V supply, this are 1.2 mV. See the app-notes of ADCs and their suggestions about board-layout. No, not bread-boards, but double-sided, shielding, well thought out position of caps (with low inductance), an extra power-supply with very little noise ...
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
A guitar has quite a dynamic range.
I'll re-work the board again taking into account separate rails for the ADC portion tomorrow and see what happens.
It's purely for academic value now as I've ordered some external 8 pin converters which will arrive on Thursday. I'll keep playing with the internal converters between now and then.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lt's not particularly silly, is it?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
It's probably just one of those wonderful uses that was discovered, rather than intended
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point