Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ADC to DAC Bit conversions

Status
Not open for further replies.

jamesr

Newbie level 6
Joined
Dec 4, 2013
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
136
Hi,

I have a requirement (well assignment) to sample some data from a 12 bit ADC into a 10 bit word, then do some filtering, then pass this back to a 12 bit DAC.

Quantising the 10 bit word form the ADC from what I can read is just a simple as shifting the bits and losing the LSB's. (Correct me if I'm wrong here).

The filter part is to be done using 12 bit arithmetic, which I'm assuming is to ensure the correct bits enter the DAC. The filter is a 2 point moving averager. So I was wondering are there any considerations I should be thinking about, ie. saturation of the values form the filter, or should I be bit shifting the result before passing to the DAC?

I suspect I've not put enough detail in the question to get a detailed answer, so feel free to point out other inputs.

Thanks
James
 

Depending on your requirements, just shifting off your 2 LSBs might work, but it's not optimum-you should perform rounding to get a little more accuracy.

As far as 12-bit arithmetic, since you are only averaging two points, 11 bits would work as well, since the sum of two 10-bit numbers will never exceed 11 bits. It's not completely clear, but I'm assuming what you want to do is sum the two most recent samples, shift right (divide by 2) and send this to your DAC, right?
 

Hi Barry,

Yes, essentially that's what I was thinking, the sum of 2 10bits can't exceed 11 bits so I can send this straight to the DAC.

If I was then to use a different filter, say 3 or 4 point, it could be possible to have an overflow from the 12 bits, but my thought is to still do a shift and lose the LSB's before passing to the DAC.

You mentioned not optimum, and should perform rounding, can you elaborate a little more on this? I'm not sure I follow, I'm using integers.

p.s the ADC will be sampling audio, not sure if that makes any difference.

Thanks
James
 

Let's say you have x=11110011 =243 decimal.

243/4=60.75

shift right x2=> 111100=60

But if you round the lower two bits and THEN shift

x==> 11110100 ==>111101=61.

Which one is closer to 60.75?
 

Hi Barry,

I see, that does seem a sensible thing to do. Thanks very much for the help, seems quite clear now on what I need to do.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top