Pages: [1]   Go Down
Author Topic: Crummy Digitizing  (Read 1731 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 25
Hacking since the 70s
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Back in the early 80's, I remember hooking up a microphone to my TRS-80's cassette port, and sampling it furiously to digitize some audio.
It sorta worked. If I screamed into the mic, I could, just barely, record a 16KB audio sample that played back recognizeably (barely). (Emphasize the barely). I remember screaming "KICK ME" into the mic, and it played back.

Question. Could I replicate this ancient process on the Arduino? I'm not looking for 22kHz or anything that grandiose. I'd like to be able to do around 8kHz sampling, maybe 10 seconds, or so, and stream it out over serial to another Arduino to playback the sound.
My wife broke her ankle, and it'd be super-neat (TM) if I could build a little battery powered intercom.

Of course, I could just go out and BUY something (shudder)...

I guess since I was able to do it on a 1.77 MHz Z80, it should be possible on the Atmega328...

Any suggestions?
Logged

0
Offline Offline
Faraday Member
**
Karma: 13
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, this is possible. 8 kHz sampling is only 125us between samples which is a fairly long time for the Arduino. 10 kHz sampling rates are achievable using the built-in A/D converter. You will need a microphone and amplifier, either on a microphone breakout board like this:

http://www.sparkfun.com/products/9964

or one of our soon-to-be-released new products (which I don't want to pre-announce  smiley-wink  )

You are limited by RAM so you will definitely have to stream the data out as you get it. The bit rate is quite modest (10 bits at 8000 sps is only 80 kbit/s so could be done over a 115200bps serial link). You could even knock that down to 8 bits per sample (64kbit/s) and get quite intelligible speech.

--
The Arduino Drum Machine: 14-track MIDI drum machine sequencer / groove-box
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 31529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
You are limited by RAM
True there is only 2K of RAM for everything so there is no way you can record anything over a second.
Logged

Brazil
Offline Offline
God Member
*****
Karma: 1
Posts: 616
Wusik Dot Com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm curious about this too. ;-) I managed to get 6 voices at 21khz and 8-bits without problem, by reading from the Program Flash, but sampling and saving to an external memory I haven't tested. And since the Arduino has only less than 2K of free ram to record something... but I wonder if maybe a SD Card could be used instead? Maybe external SRAM?

Wk
Logged


Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 331
Posts: 16540
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without a lot of external support components and modules, I think an Arduino is a poor choice for processing/sampling audio signals via A/D conversion. Not saying it can't be done in some manner, but it's like trying to fit a 2 pound application into a 1 pound arduino.  smiley-wink

Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 513
Posts: 31529
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would agree with that.

You can use SD cards to read data from but they are too slow to write it in real time. External SRAM is the way to go. However, I am not sure if I2C SRAM will be fast enough. SPI will be faster, with parallel SRAM faster still.
I have bought some SAM chips to try this out but I have not got round to doing this yet.
Logged

Pages: [1]   Go Up
Jump to: