IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Dither after adding four PCM 16 bit signals?
Zopfi
post Oct 16 2012, 21:59
Post #1





Group: Members
Posts: 2
Joined: 16-October 12
Member No.: 103896



Hello all!

My DSP application is implemented on a FPGA using VHDL. Basically there are four 16-Bit PCM audio signals with 48k sample rate.
After processing each audio signal separately (one multiplication with a factor that depends on a sensor) i add those four audio signals to get a unified signal.
So the question is now, when i add those four audio signals i get a 18 bit result, but i must reduce the bit depth back to 16 bit to hand it to the audio codec chip (DAC).
Should i dither in this case? Or what is the typical approach when adding PCM audio signals and then want to go back to the original bit depth?
All calculation is done in fixed point.

smile.gif

This post has been edited by Zopfi: Oct 16 2012, 22:00
Go to the top of the page
+Quote Post
DVDdoug
post Oct 16 2012, 22:27
Post #2





Group: Members
Posts: 2448
Joined: 24-August 07
From: Silicon Valley
Member No.: 46454



I'm not a DSP expert, but my intuition says that after summing 4 uncorrelated signals the "16th bit" (bit zero) is already sufficiently randomized, so you don't need dithering.

I assume you can't hear dithering at 16-bits anyway, or you wouldn't be asking... I can't hear anything 80-90dB down...

QUOTE
when i add those four audio signals i get a 18 bit result
Shouldn't that require 20 bits?
Edit - Nevermind.. 18 bits is enough. ohmy.gif

This post has been edited by DVDdoug: Oct 16 2012, 22:41
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Oct 16 2012, 22:30
Post #3





Group: Members
Posts: 3537
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (Zopfi @ Oct 16 2012, 16:59) *
Hello all!

My DSP application is implemented on a FPGA using VHDL. Basically there are four 16-Bit PCM audio signals with 48k sample rate.
After processing each audio signal separately (one multiplication with a factor that depends on a sensor) i add those four audio signals to get a unified signal.
So the question is now, when i add those four audio signals i get a 18 bit result, but i must reduce the bit depth back to 16 bit to hand it to the audio codec chip (DAC).
Should i dither in this case? Or what is the typical approach when adding PCM audio signals and then want to go back to the original bit depth?
All calculation is done in fixed point.


The global rule is that whenever you reduce the resolution of a digital signal you will have a new quantization error that needs to be randomized (dithered).

When you process each audio signal separately and reduce its gain, the same rule applies unless you are able to carry forward all of the bits generated by the multiplication.
Go to the top of the page
+Quote Post
Dynamic
post Oct 17 2012, 10:18
Post #4





Group: Members
Posts: 793
Joined: 17-September 06
Member No.: 35307



The other option is that if the DAC permits 24-bit audio input and you're not restricted by something like a serial link's data rate, just send that.

Technically, dither is required as Arnold says, and with certain test tones, lack of dither may become audible. The digital multiplication of one signal may also increase the bit depth beyond 18 bits. It would be best practice always to dither.

With real music at normal volumes, in practice, I'm not aware of any sources demonstrating that lack of dither has been shown to be audible in double-blind tests, but it might show up in deep fade outs turned up way beyond normal listening levels, so there can be practical scope to make engineering compromises if resources are tight.

I'm not that familiar with current FPGAs and programming in VHDL, but you can probably get away with a fairly short sequence pseudorandom number generator to sufficiently decorrelate the truncation error from the signal, thereby not requiring huge numbers of gates to be spent on dither architecture if your resources are limited, though I suspect modern FPGAs have so many gates that it's not an issue for most designs, so why not use the best available.

If resources become tight, the engineering choice depends a lot on what you can know about your signals and their noise content. I guess with audio signals, noise is sometimes going to be at or below the 16th bit level, so dither is preferable.

There can also be potential issues with quantization error if there's not sufficient noise on the analogue side in certain types of ADC (not delta-sigma, but potentially SAR), so that's potentially just as important (or just an unimportant!) as DSP dither, depending on your architecture.
Go to the top of the page
+Quote Post
Zopfi
post Oct 17 2012, 19:20
Post #5





Group: Members
Posts: 2
Joined: 16-October 12
Member No.: 103896



Thanks for the answers. So each time i drop bits e.g rounding after mult or add i have to dither because i will do a new quantization.
If the difference is audible or not is not really important because its a university project wink.gif

Go to the top of the page
+Quote Post
pdq
post Oct 17 2012, 19:43
Post #6





Group: Members
Posts: 3311
Joined: 1-September 05
From: SE Pennsylvania
Member No.: 24233



If you are carrying out calculations to a higher precision than the target bit depth then only dither as part of the final stage of bit depth reduction.
Go to the top of the page
+Quote Post
Arnold B. Kruege...
post Oct 18 2012, 00:25
Post #7





Group: Members
Posts: 3537
Joined: 29-October 08
From: USA, 48236
Member No.: 61311



QUOTE (pdq @ Oct 17 2012, 14:43) *
If you are carrying out calculations to a higher precision than the target bit depth then only dither as part of the final stage of bit depth reduction.


Yes. This trades register length for less overall processing. If you've got the register length to pull it off, just add the 4 numbers and divide the result by 4 after adding the dither. Depending on how close to the metal you are programming, you can substitute shifting right 2 bits for dividing by 4.
Go to the top of the page
+Quote Post
Martel
post Oct 18 2012, 14:51
Post #8





Group: Members
Posts: 535
Joined: 31-May 04
From: Czech Rep.
Member No.: 14430



VHDL IS the metal. smile.gif
He has access to all the individual bit "lines" so he can probably just connect those so the former bit 2 becomes bit 0, bit 3 becomes bit 1 etc. and leave former bit 0 and 1 unconnected.

This post has been edited by Martel: Oct 18 2012, 14:54


--------------------
IE4 Rockbox Clip+ AAC@192; HD 668B/HD 518 Xonar DX FB2k FLAC;
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th April 2014 - 10:11