Recording voice by Atmega32

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

Hi I would like to Record voice by atmega32 and send the recorded data by Uart to my computer.

so I googled it and found VS1003 and isd25120.

but it looks like that these two IC just Record the voice and play it, but I need to get a data of recorded voice in my avr. so is there any other way or IC to do this ?

 

P.S: I prefer to use a Ic for this operation and do not involve my avr for converting analog voice to digital I need to read converted voice data by avr!!. 

 

thanks

Last Edited: Sun. Sep 11, 2016 - 06:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

nta_xyz wrote:

P.S: I prefer to use a Ic for this operation and do not involve my avr for converting analog voice to digital I need to read converted voice data by avr!!. 

 

This is pointless because you are either going to use the ADC on a chip or the ADC on your AVR. You might as well use the AVR. This is well documented. Then you might want to record the data to a serial EEPROM or a Micro SD card to get the data to a PC

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

first question which quality of sound? 

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

sparrow2 wrote:

first question which quality of sound? 

 

my purpose is recording data which send by microphone. 

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

Someguy22 wrote:

This is pointless because you are either going to use the ADC on a chip or the ADC on your AVR. You might as well use the AVR. This is well documented. Then you might want to record the data to a serial EEPROM or a Micro SD card to get the data to a PC

 

I do not need to save the data in sd card or eeprom I just need to send that to uart. by the way if you know how I can convert microphone data to any kind of format (even by ADC) which can be play in media players please help me.

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

? does that mean that the microphone is digital? (if that is the case why not send the data direct to the PC).

 

or what do you mean with data ? 

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

sparrow2 wrote:

? does that mean that the microphone is digital? (if that is the case why not send the data direct to the PC).

 

or what do you mean with data ? 

 

Is there any digital microphone ? :D

 

If there is microphone which can convert our voice to digital data I do not have problem any more!! :D

because I want to speak to the microphone and then convert my voice to the format which can be recognize as a valid sound file in PC and then send that data to my pc by uart.

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

Then again which quality ?

 

just to understand

phone

HI-FI

?

 

What else does the mega16 do since you don't want to use it's ADC? 

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

Simple sums time...

 

High quality audio is sampled at 16 bits and at 48kHz.

 

Assume we split the 16-bit sample into two 8-bit parts for transmission to the PC and run our UART 8-N-1 for a total of 10 bits per part or 20 bits per sample.

 

48kHz x 20 bits is 960,000 bits per second or 960kbaud. Can your PC accept data at that speed?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

And that calculation has no allowance for overheads like indicating which byte sent is the LSbyte and which the MSbyte.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

sparrow2 wrote:

Then again which quality ?

 

just to understand

phone

HI-FI

?

 

What else does the mega16 do since you don't want to use it's ADC? 

 

phone quality is good for me.

 

mega16 just read the microphone data and sending that to uart I wanted not to be involved in ADC :D so if you can guide me how I can do this there is no problem for using adc.

but I do not know when I read mic data by ADC how i can convert that to the format which can be recognize in pc.

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

We should start at the beginning, right? What kind of microphone are you using and how to connect it to the ADC? The ATMega32 ADC has gains of 1x, 10x and 200x, you have to know the amplitude of the output signal from the microphone to decide how the ADC should be configured, or if you need to use some external amplifier (opamp or transistor).

 

Only when you have the data acquisition part working, you should start to think about the interface with the PC.

 

edit: read this document to make sure you know the basics. If you already do, sorry, but I can't guess at your knowledge level.

Last Edited: Sun. Sep 11, 2016 - 10:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Standard comms frequency range is 300 Hz to 3 kHz.

Leon Heller G1HSM

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

A simple question by the OP is turning out to be something different. Why not just state the problem you are trying to solve rather than deciding the solution and then running a game of 20 questions for everyone who is trying to help. Good luck.

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

As no one had mentioned it so far: AVR335

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

Thank you, clawson, for introducing the Atmel application note, AVR335; "Digital Sound Recorder with AVR® and DataFlash®".

 

Kerim

  

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

That app note is a good example of how to use the dataflash, but doesnt show how to do the comms. If 4Khz freq resp is ok, then we use 8KHz sample rate. Lets try 8 bits per sample. Thats 8000 bytes per sec to send, 80000 bits per second to send. Those samples could be sent to the pc over the uart at 115200 bits per second. Everyone agree on this plan so far?

 

Imagecraft compiler user

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

bobgardner wrote:

Everyone agree on this plan so far?

 

Certainly sticking with 8-bit values is going to make life a lot easier.

 

If the OP needed better quality he could look at sampling at 12-bits and then doing a lookup, or piece-wise linear approximation, to a companded 8-bit result. But yes, stick with 8-bit values going to the PC.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Better tell him he needs an xmega to get 12 bits.

Imagecraft compiler user

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

OP should take a look at A-law and u-law.

 

But if it's to a PC why not go faster, I guess that OP will use a RS232 to USB converter anyway.

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

The OP is just looking to get voice sound files that play in a media player. See posts #1 and #5. EVERY PC I have ever had had a microphone port on the front or the back of the computer.