Go Down

Topic: Arduino uno audio delay project (Read 11639 times) previous topic - next topic

Kitax

Hi everyone!

i want to make an audio delay tool, and i have never worked with ad and da converters. i learned quite  a bit from PCF8591 datasheet, but i still have many questions.

my idea is to take two PCF8591 chips, one to do the a to d and other one from d to a conversion and a ram memory to store the digital audio signal for a short time... i'm thinking from 0 to 1 sec.

here comes in the arduino uno. i need it to drive both chips, and i heaven't done research on RAM chips, but i'm guessing that too
so i was wondering what frequency do i need to run those chips to achieve listenable audio signal, and is the 4 MHz frequency (from attiny) enough?
has anyone done this before?
how do i calculate the max delay i can get? (im guessing it would have to be the amount of memory i have devided by the frequency times the amount of bytes i send)

AWOL

Quote
o i was wondering what frequency do i need to run those chips to achieve listenable audio signal, and is the 4 MHz frequency (from attiny) enough?

4MHz is overkill for audio (Typical bandwidth of audio is 20kHz)

However, assuming you plan on using the Tiny's own ADC to sample the audio, you won't be able to achieve much better than telephony quality (3kHz bandwidth)

UnoDueTre

#2
Dec 18, 2013, 10:37 am Last Edit: Dec 18, 2013, 10:44 am by UnoDueTre Reason: 1
Also have a look at dual port RAM, it will allow you to write data to it from the ADC, and read it out to the DAC at different rates.

Kitax

Quote

4MHz is overkill for audio (Typical bandwidth of audio is 20kHz)

However, assuming you plan on using the Tiny's own ADC to sample the audio, you won't be able to achieve much better than telephony quality (3kHz bandwidth)


well i was going to use PCF8591 for conversion. http://www.nxp.com/documents/data_sheet/PCF8591.pdf
does that mean that i can get the 20kHZ frequency?

AWOL

8 bit audio will sound awful whatever the sample rate.

UnoDueTre

#5
Dec 18, 2013, 10:58 am Last Edit: Dec 18, 2013, 11:04 am by UnoDueTre Reason: 1

does that mean that i can get the 20kHZ frequency?


No, see attached below (from PCF8591).
Plus, where are you going to store the samples?
The Arduinos don't have much RAM.

EDIT:

Since the max sample rate is 11KHz, it means your max input frequency is just over 5KHz, couple this with the 8 bit resolution and it will sound pretty dreadful.

Kitax

well i want it to delay human voice, so the 5 kHz max frequency isnt bad i guess.

as for the 8-bit sound, i think i just need to make it understandable, so i think that will work as well

i am going to use a RAM chip because i know that arduino doesnt have much RAM

(have you ever tried to talk while hearing your voice with a delay? it is really hard, and that is what i am trying to make, headphones that delays your voice and plays it back, so i guess the 8-bit sound would do just fine)

AWOL

I think there's a smartphone app for just that purpose - it is supposed to help stammerers.
Wiring RAM is going to gobble up pins.

Kitax

well i have to make a school project, and im considering this one

i heavent actually looked into ram yet, but i will. i think, that the one attiny 2313 can drive all 3 of the chips, but if it cant i guess i can just get another one, i guess...

CrossRoads

http://www.atmel.com/Images/8246S.pdf
18 IO pins:
reset
serial in for debug
serial out for debug
xtal 1 need to use external crystal for 16 or 20MHz operation
xtal 2
leaves 13 pins
SCK, MISO, MOSI - needed for high speed transfers to ADC, DAC, SRAM
ADC chip select
DAC chip select
SRAM chip select
down to 7 pins

So IO wise you would seem to be okay.
However, look at these numbers for 2313:
- 2K Bytes of In-System Self Programmable Flash
- 128 Bytes In-System Programmable EEPROM
- 128 Bytes Internal SRAM

I think you will really struggle to get your code working with that few resources.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Kitax

i think one of these would be a good ram for this project, but i dont really know... im gonna have to do research on them and on ram chips... i heavent really used them before. maybe you could introduce me or give some links to where i could read about them?

https://www1.elfa.se/data1/wwwroot/assets/datasheets/fm24c64b_eng_ds.pdf
https://www1.elfa.se/data1/wwwroot/assets/datasheets/zsLyontek_SRAM-LY6264_EN.pdf

UnoDueTre

Admittedly I haven't looked in detail at the chips you provided links for, but one thing to keep in mind, whenever you use a chip that may be a bit more specialized, always first check availability and price before committing any time or effort to a design that uses the part.

Kitax


Admittedly I haven't looked in detail at the chips you provided links for, but one thing to keep in mind, whenever you use a chip that may be a bit more specialized, always first check availability and price before committing any time or effort to a design that uses the part.


already did it... i chose these chips because they are available for a reasonable price, and i picked 2 different ones of which i think at least one would work for me, and this time i guess it will be

https://www1.elfa.se/data1/wwwroot/assets/datasheets/fm24c64b_eng_ds.pdf

CrossRoads

That would be a good RAM for Storing data.
Your code will not execute from that RAM tho - only from the internal SRAM, the 128 bytes in a '2313 that are used for registers and stuff.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Kitax

#14
Dec 19, 2013, 12:47 pm Last Edit: Dec 19, 2013, 12:50 pm by Kitax Reason: 1

That would be a good RAM for Storing data.
Your code will not execute from that RAM tho - only from the internal SRAM, the 128 bytes in a '2313 that are used for registers and stuff.


i know that... preveously i said about storing the 8 bit audio i converted to play it a bit later (a few microseconds or so, preferably up to second, but i know it is quite a bit of data and i dont know exactly how much delay i can get from it) the whole point of the conversion is to get that delay. i just wanted to play around with DAC and ADC and data storage to get better knowlage of how they work.

user named UnoDueTre, posted a picture of exactly what i wanted to make from the beginning

Go Up