fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: [fluid-dev] Purpose of dither?


From: Mihail Zenkov
Subject: Re: Fwd: [fluid-dev] Purpose of dither?
Date: Wed, 9 May 2007 21:52:55 +0300

On Wed, 9 May 2007 09:16:35 -0700 (PDT)
Z F <address@hidden> wrote:

> 
> --- Miguel Lobo <address@hidden> wrote:
> 
> > ---------- Forwarded message ----------
> > From: Miguel Lobo <address@hidden>
> > Date: May 9, 2007 3:02 PM
> > Subject: Re: [fluid-dev] Purpose of dither?
> > To: Mihail Zenkov <address@hidden>
> > 
> > Admittedly I have forgotten a lot about signal processing, but I'm
> > not sure
> > I agree with everything you're saying.
> > 
> > Roughly, dither convert harmonic distortion to noise.
> > 
> > 
> > That much is clear.
> > 
> > If we just add
> > > noise (random) to signal, distortion gone but noise will by
> > modulated
> > > by signal (correlate with signal). This noise not fully random.
> > 
> > 
> > So, let's consider the sequence a[n] = rand() / (float)RAND_MAX -
> > 0.5.
> > 
> > How is each value in this sequence not "fully random" and completely
> > uncorrelated to all other values?  AFAICS, this sequence is white
> > noise and
> > if you add it to your audio, you get no modulation.
> > 
> > This is rectangle dithering.
> > 
> > 
> > Certainly the probability distribution of each a[n] is uniform
> > between - 0.5and
> > 0.5, so it is rectangular.
> > 
> > To prevent this modulation and get pure white (fully random) noise
> > (it
> > > much better for human ears) not correlated with signal, we consider
> > > previous dither value.
> > 
> > 
> > If I'm not mistaken, we are in effect getting a new sequence:
> > 
> > b[n] = a[n] - a[n - 1]
> > 
> > And we are using this sequence for our dither.  Now, this is in
> > effect
> > applying a high pass filter to a[n], so if a[n] was white noise, b[n]
> > will
> > not be.
> > 
> > And, most certainly, each element of b[n] is not independent from the
> > previous one.  For example, if you have b[n0] = 1, you know for a
> > fact that
> > a[n0] = 0.5 and a[n0 - 1] = -0.5.  Therefore, b[n0 + 1] = a[n0 + 1] -
> > a[n0]
> > = a[n0 + 1] - 0.5 < 0.  Therefore, b[n0] = 1 implies b[n0 + 1] < 0;
> > these
> > two elements are correlated and b[n] is not white noise.
> > 
> > What am I getting wrong here?
> 
> 
> This is exactly my complaint about current implementation of dithering.
> The noise is correlated drawn from a triangular distribution. My
> understading, I could be wrong, that the design was that noise is drawn
> from triangular distribution, but samples are uncorrelated. In the
> latter case two calls to rnd are needed. But I could be mistaken in the
> design goal.

>From 
>http://www.soundslogical.com/support/resample/documentation/english/documentparts/resamplehelp-29.html

Another commonly used dither signal is that with a triangular pdf and a
peak-to-peak amplitude of 2 LSB. Its use is motivated by the fact that
it is theoretically optimal, and, moreover is simple to generate in the
digital domain by summing (or differencing) two rectangular dither
signals (each with a peak-to-peak amplitude of 1 LSB). In fact, the
preferred method in audio applications is to create the triangular
dither sequence by differencing successive values of a rectangular
dither sequence. This results in an automatic highpass filtering of the
dither signal, which, depending on the sample rate, can result in a
reduction in the perceived additive noise without affecting the
underlying performance of the dither on the quantizer.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]