Audio signals crash course

Status
Not open for further replies.
I have to say congratulations on get'ner done!

Odd kind of nag, more at myself. You don't have to worry too much about SOP in a bread board if you have money to throw at the problem. I really burned myself jumping on that hayride before it got popular. I think I spent something like $27 for a single adapter board.

Anyway, price has dropped and IIF you feel like looking at surface mount.
http://www.ebay.com/itm/221141900853

Those are typical. You can get them for just about any package size and format.

Nobody has come out of the woodwork yet to ask for stereo kits with 48 bit DACs and 32 gig SD card that puts out 300 Watts per channel for less then a six pack, but I feel it is on the way! 🙂 Nice work, I'm really impressed.
 
Does your MCU have an I2S serial port? If so then you could perhaps set it up to feed a TDA1387. Its also SMT but the pin spacings are more friendly than that TI part. I don't think TDA1387 is a current production chip but there are sellers on eBay for a reasonable price I believe. Needless to say this DAC sounds awesome when done right 🙂

If you really can't face SMT parts, there's always TDA1543 in DIL8.

The SPI port looks like it can be reconfigured to be I2S. I think I2S is almost identical to SPI, right?

I don't like working with chips that aren't production. Even though what I'm doing is technically hobby, on the off chance that I want to start manufacturing them, I don't want to have to resource too many parts.

So, if the TDA1387 and 1543 aren't available, what is your third opinion? Sorry to be so demanding... :cheeky:


ricortes -
I have to say congratulations on get'ner done!
Aw, shucks. You're too nice!! My success with this particular project is 100% thanks to diyaudio forums. You guys are :superman:uper. That being said, stay tuned. I haven't even gotten started yet!!

Your ebay link just took me to a blank page 🙁 I will try and locate a general purpose SOP breakout on sparkfun or adafruit. I'm sure that sort of thing will be useful for the forseeable future. If I can't track a good one down, Like I said, I have blank PCBs and etchant, so I might just fab my own SOP breakout PCBs.
 
Alright, guys, delivery time.

We're playing a really short snippet of Scott Joplin's "Maple Leaf Rag" here. There is no filetype, it's about 50kB of mono 8-bit raw audio data stored directly in a C-array as hexidecimal values. In the next few days, I'll be adding an SD card, so I will be able to read WHOLE WAV files.

Audio snippet with PIC32 - YouTube

Thank you guys a TON. I have a final exam tomorrow, but once school is done for good, I'll be back (with a 14 or 16-bit DAC) and looking for more tips.

That is really 😎
 
The SPI port looks like it can be reconfigured to be I2S. I think I2S is almost identical to SPI, right?

Its made a bit more complex by being stereo but apart from that, yeah it is. And the WS (word select) being moved by one bit position so it doesn't precisely 'frame' the data.

I don't like working with chips that aren't production. Even though what I'm doing is technically hobby, on the off chance that I want to start manufacturing them, I don't want to have to resource too many parts.
What kind of quantities are you envisaging? I'm designing a DAC using these parts and if I make a few hundred I'll do fine as I already have more than that in stock. A few thousand of these chips isn't going to be any kind of problem as far as I can see - and they're recycled ones, hence very very cheap 😀

So, if the TDA1387 and 1543 aren't available, what is your third opinion? Sorry to be so demanding... :cheeky:
A moon-on-a-stick guy I see 😉

All the decent sounding audio DACs have gone out of production. The TI one I mentioned is fine, albeit you'll need a break-out board. Another TI part (PCM1704) was still available last time I checked but its waaaaaaay dear. Here's another possibility from TI - as you mentioned a while back 14bit DACs might be acceptable, how about this - Digital to Analog Converter - High Speed DAC (>10MSPS) - DAC904 - TI.com
Its a little bit pricey but not prohibitively so like PCM1704. What looks promising about this one is it has very low glitch and gives out ooodles of current (20mA compared to audio DACs' 1-4mA) so gives all kinds of flexibility in designing the output stage.

<afterthought> Might blow your budget (still cheaper than PCM1704 though) - this from ADI. It does have the full 16bits http://www.analog.com/en/digital-to...eed-da-converters/ad768/products/product.html
Recycled ones are available much cheaper than list btw 🙂
 
Last edited:
Try the link now. I've edited the rover thing out of it.
Huh. These look really cool! Looks like that TI SOP package isn't quite so out of reach!
Thanks Mooly.

abraxlito -
Its made a bit more complex by being stereo but apart from that, yeah it is. And the WS (word select) being moved by one bit position so it doesn't precisely 'frame' the data.
Sounds manageable!

What kind of quantities are you envisaging? I'm designing a DAC using these parts and if I make a few hundred I'll do fine as I already have more than that in stock. A few thousand of these chips isn't going to be any kind of problem as far as I can see - and they're recycled ones, hence very very cheap
Certainly not anything TOO crazy. Dreams of mass production aren't the only thing holding me back... for instance, I would hate to come back to a project like this in 3 or 4 years, accidentally blow out the DAC (these Michigan winters generate a lot of static electricity!), and not be able to replace it because all the parts are gone.

All the decent sounding audio DACs have gone out of production. The TI one I mentioned is fine, albeit you'll need a break-out board. Another TI part (PCM1704) was still available last time I checked but its waaaaaaay dear.
TI has a new part they say is a replacement for the PCM1704: PCM1795. It looks pretty good (32 bits @ 192 kSamp/sec!!), and is only around 4-7 bucks, depending on quantity. That being said, I think the DAC904 you showed me is my best bet. Once you get up around 14 bits, 2 extra bits ain't gonna do much good unless you're listening to, like, a world class string quartet in a dead-quiet room out of super hi-fi speakers. That being said... the price is a bit high ($20). I still might bite, though.

<afterthought> Might blow your budget (still cheaper than PCM1704 though) - this from ADI. It does have the full 16bits http://www.analog.com/en/digital-to-...s/product.html
Recycled ones are available much cheaper than list btw
I saw an ADC (not DAC) for.... wait for it.... $4,400 once on digikey. This thing was crazy. It could sample several channels at a rate of, like 16 Gigasamps/sec. Probably for a super high-end oscilloscope (some of those scopes cost more than a ferrari!)

EDIT: Here's the above-mentioned chip http://www.digikey.com/product-detail/en/ADC12D1800RFIUT/ADC12D1800RFIUT-ND/4251094 Turns out my numbers were a bit off... "ONLY" 3.6 Gigasamps/sec and could only do 2 channels at that speed.
 
Last edited:
With the DAC904 you can do what Philips did on their first CD player and use 4X oversampling to make up for the missing 2 bits. TDA1540 was the chip they were using (its been out of production for ages).

eBay price for it $13.50 each out of Hong Kong - tried linking to it but that fails.
 
Last edited:
With the DAC904 you can do what Philips did on their first CD player and use 4X oversampling to make up for the missing 2 bits. TDA1540 was the chip they were using (its been out of production for ages).
oversampling? Like, let's say hypothetically I wanted to use a 2-bit DAC to produce 4-bits of output....

Desired output: 1millisecond of 1010

Actual output:
0.25 milliseconds of 11
0.25 milliseconds of 11
0.25 milliseconds of 10
0.25 milliseconds of 10


...almost like a PWM?
 
Yes - the digital filter should take care of this by generating the interpolated points in between the supplied samples. The quantization noise is 12dB higher but that's in the wider bandwidth (88.2kHz) so it needs a steep analog filter to get back 6dB of that. So in theory a 14bit DAC 16X oversampled should get us to 16bits effective. I think probably Philips used some noise shaping as well (pushing up the quantisation noise beyond 20kHz in exchange for lower noise in-band) to get 16bit performance but with only 4X oversampling.
 
Yes - the digital filter should take care of this by generating the interpolated points in between the supplied samples. The quantization noise is 12dB higher but that's in the wider bandwidth (88.2kHz) so it needs a steep analog filter to get back 6dB of that. So in theory a 14bit DAC 16X oversampled should get us to 16bits effective. I think probably Philips used some noise shaping as well (pushing up the quantisation noise beyond 20kHz in exchange for lower noise in-band) to get 16bit performance but with only 4X oversampling.
I would be struggling to push my PIC to oversample 16x on a 44.1kHz sampling rate.... I would have to send new data out the SPI bus at a rate of almost 1MHz per 16 bytes, which means.... writing ISRs in assembler 😎
 
Last edited:
I agree - 16X OS is most probably way beyond that chip's math capability. I've run a 4X OS filter (a clone of the original Philips SAA7220 120tap FIR filter) - it took about 60MHz of ARM Cortex M0 and that was all hand coded assembler, no IRQs 😀
 
Since I started embedded computing when clock rates were in the low single digit MHz, none of today's offerings seem 'crappy' to me. But yes I agree, the fun of embedded is doing stuff with highly limited resources. Did you ever see the guy who put wikipedia onto an ARM Cortex M0? You can probably find it on Youtube, amazing feat of shoe-horning.

About the oversampling benefits, I was rather scratching my head over that. You might well be right - I was just thinking that noise was proportional to the square root of bandwidth so that halving the bandwidth would halve the noise power, but I might well be using the wrong heuristic. Perhaps this only applies to thermal (Johnson) noise. So you reckon that the noise amplitude is going to be proportional to the bandwidth - 16X less bandwidth giving 4 extra bits. I guess its time to do some research....😛
 
Thinking about it...

Just things I find personally interesting. Putting them out there to let you know what thought your journey is generating. I don't expect you to follow anything I say or even be interested. Just a nod for topics I find personally intriguing. Of course the other contributors to the thread deserve kudos too.

With your current hardware, even the 8 bit DACs, you should be able to get 16 bits just by using two DACs. What you would do is set one DAC for the upper 8 bits i.e. output from ~0-3V and the second DAC to output ~0-.012V. That would give you 0-3V output in .000046V steps. Well, a little noise for the time it takes to switch from one DAC to the other.

Same thing could be accomplished using them both at 0-3V output with a couple of resistors such that the lower 8 bit DAC's output was divided by 256.

Then instead of the over sampling power function to add extra bits of resolution, it is just a linear 8 bits per DAC for resolution! AHHHH! The fabled 48 bit DAC! hehe

Output could also be done with a summing op amp design. Lots of choices.

I used to work with price sensitive products so options like using twice as much of something cheap and available was sometimes the answer to something expensive and unobtainable. I'm having flashbacks! If you have 16 bits of output resolution, you could eliminate the 10k pot on the input to the amp and just use scaled output/digital volume control.

I'll have to dl your PIC's datasheet and have a look at it.

I'm reminded of a saying a manager once said when I told him we had a bad batch. "Some of the products we make are better then other products we make but we don't make bad product."
 
Status
Not open for further replies.