Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

V poor sound quality

Status
Not open for further replies.

andy257

Member
hi

having a spot of bother with the quality of the sound coming from my embedded system. Basically i am using my laptop audio line-out to feed the input of an adc. The adc output is fed into a dac input. both adc and dac are ran from same sampling clock.

i am running both pretty fast >1mhz and the quality is still poor. If i connect my speaker directly to the line out of my laptop the quality is perfect so its not my little speaker that cant handle it.

low sounds such as bass etc sound ok ish its mainly voices that sound crap.
Although its hard to tell what sounds good, its all pretty poor.

Now i am stuck as to what can be causing this poor quality. I dont think its noise or interference, i have the sampling way more than is needed. what else can it be.

The adc and dac are 3.3V devices and they use this as a reference. The lineout of my laptop i am lead to believe is 1v pk to pk so i dont think its a prob with the input range but maybe?

Just out of interest i stuck a scope on my lineout and i measured 500mV peak to peak. Is this enough to corrupt the quality? although interesting when i change the volume the poor quality does not alter so i dont think it can be clipping. I am really lost as to what it can be.



if anyone has any ideas or possible causes of this loss of quality that would be fantastic.
 
Last edited:
Are you feeding the signal through a capacitor ? This could be forming part of a filter and give you the clipping effect.
 
do you mean a reconstruction filter at the dac output?

i am using a an audio amp module connected to the output of DAC which has a low pass filter at the input perfroming as a reconstruction filter.

all the elements i am using are pre build (on profesional pcbs) designed by professionals (digilent). The adc, dac, audio amp are all modules designed to connect together for audi application etc. They are add on periferal devices for their programmable logic boards.
 
I meant a capacitor to decouple your laptop from the adc input.

Strange things can happen when you connect PC / Laptop audio outputs directly up to othe equipment.
 
Right, a quick scan over the datasheets for the convertors you mentioned.

I realise you said these were on professional boards, but I'm intersted in what these boards have on them, as well as their real application.

Both the ADC and DAC you mentioned are unipolar..that is, will only accept a positive voltage. So at the very least the input from your laptop should be AC coupled with a cap, and a DC offset so 1v p-p becomes 0-2V centred around 1v (or half your power supply). As well as that I would have thought the board includes a opamp buffer, and possibly a low-pass/antialiasing filter.

Now thats the 'analogue front end'. Assuming the ADC does its job...what are you using to control this? Both ADC and DAC are SPI devices...so you could tie their data lines and clock lines together, but you would still need a 'CS' line to control when samples are transfered.

The ADC outputs 4 leading 0's, then 12-bits of data, then 4 trailing zeros. Thats 20 bits per sample. With your SCLK running at 1MHz, thats a make sampling frequency of 1000/20 = 50kHz. More than enough for audio.
It starts this when CS is pulled low and the clock is going. (I suspect the four leading 0's are used to take the sample).

The DAC however, requires a similar interface, but with a 'sync' input. Looking at it, the data format is 16 bits....first two bits are 'don't care', then next two are power down control, then your 12 bits of audio data. The 'sync' input determines when the DAC recieves data. Similar to the CS line in SPI.

As far as the boards you have go, I'm sure the analogue can cope with audio, but bare in mind....in the datasheet, audio wasn't mentioned in the app notes. That doesn't mean they can't be used for audio, they're fast enough after all, but the boards you have might not contain the circuitry for audio (AC coupling, impedence buffer etc...).

So.....I would guess that if you've just connected these two devies together, running them off the same clock for Sclk, and tying the data lines together, the data formats are wrong, BUT similar, which means it probably is getting some form of audio data through, but constantly out of sync.

Now IF you have something taking the data from the ADC, formatting it then sending it to the DAC....then I would say its the analogue side. Perhaps some info on this boards and the saetup you have might be useful.

Regards,

Blueteeth.

Ps. Made a lot of assuptions there, sorry if I'm being patronising, just trying to help.
 
Blueteeth said:
Right, a quick scan over the datasheets for the convertors you mentioned.

I realise you said these were on professional boards, but I'm intersted in what these boards have on them, as well as their real application.

Both the ADC and DAC you mentioned are unipolar..that is, will only accept a positive voltage. So at the very least the input from your laptop should be AC coupled with a cap, and a DC offset so 1v p-p becomes 0-2V centred around 1v (or half your power supply). As well as that I would have thought the board includes a opamp buffer, and possibly a low-pass/antialiasing filter.

Now thats the 'analogue front end'. Assuming the ADC does its job...what are you using to control this? Both ADC and DAC are SPI devices...so you could tie their data lines and clock lines together, but you would still need a 'CS' line to control when samples are transfered.



The DAC however, requires a similar interface, but with a 'sync' input. Looking at it, the data format is 16 bits....first two bits are 'don't care', then next two are power down control, then your 12 bits of audio data. The 'sync' input determines when the DAC recieves data. Similar to the CS line in SPI.

As far as the boards you have go, I'm sure the analogue can cope with audio, but bare in mind....in the datasheet, audio wasn't mentioned in the app notes. That doesn't mean they can't be used for audio, they're fast enough after all, but the boards you have might not contain the circuitry for audio (AC coupling, impedence buffer etc...).

So.....I would guess that if you've just connected these two devies together, running them off the same clock for Sclk, and tying the data lines together, the data formats are wrong, BUT similar, which means it probably is getting some form of audio data through, but constantly out of sync.

Now IF you have something taking the data from the ADC, formatting it then sending it to the DAC....then I would say its the analogue side. Perhaps some info on this boards and the saetup you have might be useful.

Regards,

Blueteeth.

Ps. Made a lot of assuptions there, sorry if I'm being patronising, just trying to help.

hi bluteeth,

really appreciate your reply.
 
Last edited:
Blueteeth made a good point (quite a few actually!), but you didn't answer - how are you biasing the input to the A2D? - usually A2D's only work on a positive input, so you need to bias it halfway to feed it AC.
 
Nigel Goodwin said:
Blueteeth made a good point (quite a few actually!), but you didn't answer - how are you biasing the input to the A2D? - usually A2D's only work on a positive input, so you need to bias it halfway to feed it AC.

hi nigel

the adc chip has an input capacitor to ac couple the incoming audio. the adc board has other circuits on it to accompany the adc chip. There is a 2 pole anitalias filter on their and what looks like to be an input buffer also.

The input to the adc looks like a switched capacitor input with a internally biased Vcc/2 connection.

thanks
 
Last edited:
Hello again!

Thanks for the links, always handy when one has a schem to work with.
(btw the links for the ADC and DAC are the wrong way around....ADC links to the DAC and visaversa....just saying incase anyone else wants to look at them).

Ok, going from audio in to audio out...here's what I think....

Problem:
ADC - the schem for the board does indeed have an input buffer (with diodes for over voltage protection/clipping) which then goes to a 2-pole low pass filter. Very nice...however....if you look at signal route...theres no caps in series with it. Therefore...the input is unipolar. The ADC does not take a bipolar input (check datasheet page 5 'analogue input characteristics ..0-VDD)...and even if it does...the analogue front end doesn't have the facility to take negative voltage.

Solution:
A small biasing circuit should be added between the audio in form your laptop and the input to the ADC 'module'. Preferably with an opamp, but just for tseting you could use a voltage divider with say 47k resistors, and a 100nF cap. - as I said, not 'clean' but it would at least provide a DC-offest.

The DAC part, with amplifier/RCA connector seems absolutely fine for your purposes. I might have missed something, but it all looks good.

Now the 'control' part. Thats quite a clever idea...using the 4 leading zero's...as the input to the DAC, the first 2 are dont cares, and the second two...if 00, is 'normal operation'. And of course the trailing 0's at the end of the ADC's packet are probably worthless anyway.

So from this extra info....the only real issue I can see is that analogue front end. There may be a problem with the ADC....requiring a total of 20 sclk's for a complete conversion, but I don't think its a problem. If you're interested, because of the lack of 'negative input' to the ADC, your resolution is halfed..to 6-bits. No wonder it sounds dodgy :D All correctable with two resistors and a cap. If you're struggling I'll post a couple of schems, for 'simple' and 'ideal' circuits to add.

Blueteeth
 
andy257 said:
hi nigel

the adc chip has an input capacitor to ac couple the incoming audio. the adc board has other circuits on it to accompany the adc chip. There is a 2 pole anitalias filter on their and what looks like to be an input buffer also.

The input to the adc looks like a switched capacitor input with a internally biased Vcc/2 connection.

look on page 17

https://www.electro-tech-online.com/custompdfs/2008/02/ADCS7476.pdf

a circuit diagram of the complete adc board is here
https://www.electro-tech-online.com/custompdfs/2008/02/PmodAD1_sch.pdf

thanks

The capacitor is just the sample and hold one, NOT a DC blocking capacitor, and I'm not very sure what the opamp preamps are doing?, but they look to be entirely DC coupled?. If whatever you're connecting to the input doesn't have an AC coupled output, it's going to seriously affect the operation of the circuit, and most probably cause massive distortion.
 
hi blueteeth / nigel

thanks for the replies.

Nigel i assumed the input capacitor was the ac coupled input to the A2D and that was the point where it became biased. Why else is it biased to vdd/2 ?

the op amps on the A2D board are configured as a sallen key filter (anti alias) with a cutt off frequency set to 500k, seems rather large but it says its to complement the sampling frequency. The opamp chip has two opamps on it one is used for filter and one is used for buffer. With short circuit protection at the input.

I am a little confussed why the boards have been designed this way. It states the modules should work fine with audio appplications.

for a professional company they have not impressed me. (or perhaps it is me who has not understood?)
 
andy257 said:
the op amps on the A2D board are configured as a sallen key filter (anti alias) with a cutt off frequency set to 500k, seems rather large but it says its to complement the sampling frequency. The opamp chip has two opamps on it one is used for filter and one is used for buffer. With short circuit protection at the input.

It's not short circuit protection, it's to clamp any inputs above and below the supply rails (just as a PIC input pin does) - but it's DC coupled, so any DC coupled input to it will short the input to chassis, destroying correct operation of the opamps. Check the voltage on the A2D input pin (output of filter), ensure it's half of the supply voltage (although I fail to see where the bias comes from?), and doesn't change when you connect the input.

If your filter is 500KHz, then it's useless for audio, and perhaps another reason it sounds poor?.
 
hi nigel

this was taken from the reference manual for the adc board.

Each channel has two 2-pole Sallen-Key antialias filters with poles set to 500KHz. The filters limit the analog signal bandwidth to a frequency range suitable to the sample rate of the converter.

Now i found this odd also but assumed it would not be a problem since this is a commercial product and has been designed by a professional. Why would they make this product if it was useless for audio???

I will check the voltage on the pin and report back.
 
Andy,

Looking at it, I'm sure its fine for audio. I suspect the reason they didn't AC couple the inputs was to give it more flexability, so it could work with DC coupled devices. That is....it can measure an absolute voltage for industrial control applications. Once AC coupled it can only be used for AC waveforms...where-as DC coupled allows the user to use both (with an extra addon).

The input buffer (voltage follower) and low pass filter look fine to me. Of course 500kHz IS too high for an anti-aliasing filter for audio, but I wouldn't worry too much..I doubt the audio out of your laptop has much in the way of >30kHz components, so I wouldn't have thought it would hinder sound quality that much. (of course, its not perfect, but you *should* hear a voice quite clearly).
So as far as the whole ADC board goes...it IS fine for audio, just not specifically designed for it.

Even if your ADC has a VDD/2 bias on its input (I doubt it) the opamps before it don't. So the system you currently have is only sampling the top-half of an AC waveform. Giving you massive distortion (as nigel pointed out) plus...only 6-bits effective resolution.

If you have the facility to knock something up, here's a quick little circuit I think you should try. If this doesn't make a difference then the problem is else-where, and my posts have been in vain :(

Of course...there's one thing I forgot to mention. Another great little test would be to use a variable DC supply on the input of the ADC module...keep the rest of your setup the same, and put a Voltmeter on the output of the DAC module. (forget about the amplifier for now), Vary the DC input and measure the ouput of the DAC< they should be the same. That would inidicate that both are DC coupled, and you would require the little circuit below.

Good luck,

Blueteeth
 

Attachments

  • ADCbias.JPG
    ADCbias.JPG
    10.9 KB · Views: 213
thanks for the tips blueteeth, i will try out your advice. Wont be able to get my hands on some components etc until next week so it will wait until then. I do have a volt meter at hand now so can check if its biased at vdd/2.

i get the feeling i am getting closer to finding out why the quality is so poor.

If i am ever down Hertfordshire i will buy you a pint!

Thank you for you help.

i will keep you posted if your suggestion works. If it does not you can guarantee i will be back with more questions.
 
andy257 said:
thanks for the tips blueteeth, i will try out your advice. Wont be able to get my hands on some components etc until next week so it will wait until then. I do have a volt meter at hand now so can check if its biased at vdd/2.

i get the feeling i am getting closer to finding out why the quality is so poor.

If i am ever down Hertfordshire i will buy you a pint!

Thank you for you help.

i will keep you posted if your suggestion works. If it does not you can guarantee i will be back with more questions.

You are most welcome :) And a pint would be nice, its not bad down here in summer..lots of country pubs.

This is an interesting problem, and I would be happy to help any further should the 'quick and dirty' solution not work.

Good Luck,

Blueteeth
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top