fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Purpose of dither?


From: Z F
Subject: Re: [fluid-dev] Purpose of dither?
Date: Wed, 9 May 2007 09:44:11 -0700 (PDT)

--- Z F <address@hidden> wrote:

> 
> --- Mihail Zenkov <address@hidden> wrote:
> 
> > 
> > > > Yes, I hear.
> > > > 1. 16bit accuracy give 96 dB resolution. Human limit 120dB.
> > > > 2. For mostly purpose 96 dB enough. But when we truncate audio
> to
> > 16
> > > > bit, we get new harmonics (distortion) with -60 dB level.
> > > > 3. When i play on midi keyboard, i set gain 0.1-0.2 to prevent
> > > > clipping. It narrows dynamic range. Without dithering i got
> only
> > > > 40-46
> > > > dB dynamic range when play one note.
> > > 
> > > The points 1 and 2 are interesting and improtant. This tells me
> > that
> > > the
> > > 16 bit sampling was used as a trade-off and is not good enough
> for
> > > high quality audio. I was under the impression that audio CDs
> were
> > > adequate. Apparently not, thanks for this clarification.
> > > 
> > > Your point 3, however, indicates a problem somewhere else, which
> > can
> > > not and should not be solved by dithering. My feeling is that
> this
> > > problem
> > > should be solved by a non-linear aplification process.
> > 
> > With dithering i don't hear any distortion, it enough for me. I
> also
> > try sound card with 24 bits (108 dB dynamic range)  - it slightly
> > better then dithering.
> 
> Yes, this confirms my statement. This problem should not be solved
> by dithering, but rather by dynamic range adjustments. This is not
> easy to do, but what is relatively easy to do is to introduce
> exponential gain function. I do not know the audio terminology here,
> but
> in image processing, I think it is called gamma-correction.
> 
> The idea is that there should be a mapping between the sound level
> computed by the sythesizer and the actual audio output level. This
> fucntion, roughly should have a shape of 
> 
> out_volume =( 1- exp(-in_volume))
> 
> in_volume is the signal amplitude computed by the sythesizer and
> out_volume is what should be pushed to the audio card. Now, this is
> simply the rought shape can be adjusted to anything one wants. I
> think
> that this is how your problem needs to be fixed, not dithering. This
> way
> you will use the dynamic range of the audio card DAC more
> efficiently.
> The fluid synthesizer may have this already. If it does, this is the
> place to fix your problem. If not, that this module has to be added.
> 


I would also like to know if there is this feature in fluidsynth that
the gain depends on the average signal intensity in the way I outlined
above. Again, ideally this job should be done by the end-point hardware
connected to the speakers. All other intermediate steps should be
linear. Unfortunately, many computer audio cards have only a line
output. Correct line output (and line input for that matter) is linear.
Connecting speakers directly to it is not correct but is often done (I
do that).

My understanding that Mihail introduced dithering into the synthesizer
because of the gain issue which he outlined above. I think that that
issue can and should be solved differently. If the output of
synthesizer is connected directly to the speaker than gain-control
feature which I outlined should be implemented, possibly with
dithering. If output of synthesizer is used as input to jack (or other
module) than the synth output should be linear and no dithering should
be used. It is the job of the following modules to do the gain-control.

Implementing gain-control is not simple. It should react on average
volume not instantaneous. No matter what you do, since the module will
perform a non-linear operation, it will introduce non-linear
distortions
into the signal. That is why all audio modules opearate (or should
operate) using linear input/outputs, and the last stage will do the
non-linear thing. Many hardware audio amplifiers have the non-linear
thing build-in, but I am not sure that you can control the shape of the
curve.

This is how I understand the audio processing chain.

Oh, even though I made such a long speach.. this discussion is very
educational to me. So, I hope to hear more, even though people are
probably tired of that...

All the best

ZF

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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