Finally I am ready to try a DAC resistor ladder But...
metron9
Posts: 1,100
What is the best way to take a sound sample from sound forge or a wav file and store it as ascii bytes I am using 8 nit and 2 bit files. Maby a free program that converts wav to ascii files?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
www.sigview.com/download.htm
Sound forge can resize the sample rate to 2000 and bit depth of 8. Looking at a blowup of the data at these rates it looks like a 4 bit dac will do the job (see picture of 1S ms of data) I understand I need to send 4000 voltage signals per second or 4 per mS so I am using my mega48 (4MHz) it has 16 and 8 bit interrupt timers. (the only stamp I have is the BS2 right now but in the learning process it is very handy and it is what got me started from knowing nothing about IC chips)
The resistors I have not figured out yet as the high and low pictures show a low of 15.86 to a high of 554.49 mV (without the 8ohm resistor (speaker simulatior) 0 to 3 volts)
Note* I think a regular speaker has inductance to think about as well but I have not got that far yet)
Then there is the amplifier circuit (I have not got that far yet, Op amps of some sort I would guess will be used and that I will need some help on, but I am still going to give my brain a few days to absorb the reading I have done on them.)
So using 4 bit DAC I can get 16 voltage levels from 0 to 3 volts
Note* (the 15.86 to 554.49 shown in the pictures and stated above is with an 8 ohm speaker attached as a simulation, as I dont have a amplifier figured out yet)
Now I guess the signals below the 0 line are actually negative voltages. Today I start the journy of how to do that. I could use some pointers in that respect. So I would gess I would be working with 7 negative and 8 positive voltages using the 4 bit dac. I think I need an inverter for this or maby the op amp circuit can do this too but I am getting ahead of myself.
Remember this excercise is just to get the fundamentals of how PWM and DACs and amplifiers work. To me a working wxample I make myself no matter how crude or lousy the sound output will meke me jump for joy and another notch to the light bulb will be in place.
I know sometimes it looks like I know what I am doing but reallly slap a mask on me and a blue gown and I can look like a brain surgen too)
Do a google search for "R2R" and "DAC" and see what you get.
Here is something that I did once upon a time using a UVEPROM ... I used the EPROM burner software itself to "strip" off the 54 byte WAV file header.
http://webpages.charter.net/schwabelove/BasicStamp/
....follow the above·link to "Standalone EPROM *.WAV player"
Note: If you do not strip off the 54 byte WAV file header, you will hear an audible "click" everytime you initiate playing your WAV file.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Got to get some work done now (i am at work never enough time....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.