Hello,
I have managed to get (acceptable I think) audio out of the AVR A-D
Converter (ADC). I have posted a sample (avradc.wav):
http://groups.google.com/group/low-cost-ata/web/avradc.wav
Here is a plot of some of the audio:
http://groups.google.com/group/low-cost-ata/web/avradc_plot.png
Through headphones you can hear some background noise, it could be
quantisation noise due to the low dynamic range. Or possibly other
distortions, like noise or non-linearities in the ADC. It could even
be aliasing as I don't have any anti-alising filtering. However
through the speaker of my laptop it sounds pretty good, and the
background noise is at a similar level to a regular phone call.
The AVR was running spiadc.c, and the host PC spirec.c, I was sampling
at about 16kHz, with 8 bit resolution. On the plot you can see that
most of bits are being used in the range 0-255. The input circuit was
very simple:
+ phone was powered by 20V through a 1k resistor. I needed to raise
the supply voltage to get a clean waveform out of the phone. The
phone has about 6V across it, (20-6)/1000 = 14mA DC I guess.
+ I coupled the audio to the ADC via a 470n resistor. On the ADC pins
I used a couple of 68k resistors between GND and VCC to bias the ADC
input pin at 2.5V.
So this shows (I think) that the AVR ADC is of sufficient quality to
handle telephone quality audio. Kiko's AT3344 Phone recorder project
had hinted at that however I wanted to hear the audio quality through
a telephone handset.
Next step is to see if we can get the PWM D/A and ADC working at the
same time. I would also like to do a little more work on the DC-DC
converter to see if modulating the -48VDC (say with an 80Vpp 20Hz
trapezoid) will ring an analog phone OK.
Cheers,
David