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: Mihail Zenkov
Subject: Re: [fluid-dev] Purpose of dither?
Date: Thu, 10 May 2007 14:30:53 +0300

On Wed, 9 May 2007 15:24:12 -0700 (PDT)
Z F <address@hidden> wrote:

> 
> --- Mihail Zenkov <address@hidden> wrote:
> 
> >  
> > 1. Dynamic gain just fake. I can change velocity curve in midi and
> > get
> > something similarities gamma-correction. This sounds like cheap
> > hardware synth. I need _full_ emulation real piano (and want better
> > then real, with greater dynamic range :). Just play and compare
> > classic
> > music and pop. First have dynamic range 70-80 dB, second - 20-30 dB.
> > For expression real emotions we need huge dynamic range!
> 
> Well, as far as I understand, velocity curve is translation of the
> velocity (or strength of the key press) to the amplitude of generated
> note. What I am talking about is the amplitude of the total signal of
> all notes which are ON.
>
> The dynamic range should always be set to 16 bits (which you translted
> to ?? dB). The question is how this dynamic range is used. Ideally, the
> output of fluidsynth should be linear thus the output should be a
> simple
> sum of all amplitudes of the notes. Unfortunately, this may not be
> possible because of 16 bit output constraint. (Ideally, all
> comminucation between modules should be done in floats untill the data
> goes directly to the audio hardware).

Fluidsynth already can works with float (jack) or 24bit - as i say
before, with good result.

 So, to compress high dynamic
> range
> into a small one, the gamma-correction is needed.
> 
> It will give a relatively high portion of DAC dynamic range to low
> volume sounds and small portion of DAC dynamic range to high-volume
> sounds. This is possible because humans differentiate change in volume
> of low-volume soounds very well and do not do so well on high volume
> sounds. This very doable. The price to pay is that there will be
> non-linear distrotions of high-volume sounds, but it will not be
> clipping which is horrible. Once again, we will substitude one
> distortion for another which is less noticable to humans. There is no
> way around it, a distortion must happen due to limited dynamic range.
> (as with dithering).
> 
> This gamma-curve is fixed which is different from automatic
> gain-control.
> The goal of automatic gain-control is to have the same level of output
> given a range of levels on input. The goal of gamma-curve is to reduce
> the gain if the input is high compared to the gain when the input is
> low. See the difference? The shape of the curve can, of course, be
> changed manually or with some other method, but this is not the point.
> 
> To envoke the "herd" argument, this is done in all good analog audio
> amplifiers and I hope in many others too. Your TVset has it. This is
> the difference between the linear(line) output and the speaker output.
> Speaker output goes through the non-linear amplification, linear output
> - does not.

:) Where are you read this? I six years do amplifiers (mainly on tubes)
and acoustics. All amplification strongly linear. Otherwise, we have
big THD and IMD.

> 
> Absence of such facility in fluidsynth combined with intermediate 16
> bit samples cased the problem you described which was fixed with
> dithering. In my opinion, the dithering solution is suboptimal because
> it introduces noise. It should not be necessary to reduce the gain to
> 0.1 for sound not to clip.

1. Dithering not fix any gain problem. It just clean sound and we get
full dynamic range of 16 bits (96dB vs 60db!!!).

2. Dynamic gain and gamma correction just do mezzo piano from my
pianissimo and mezzo forte from fortissimo.

In case dynamic gain - we have floating volume without any control (but
we need total control!)

In case with gamma correction - we have dirty sound. Better do same
with midi velocity curve - it don't damage sound.

But in any case it just compress dynamic range. It good for cheap
equipment with self dynamic range less 60dB.

I have equipment with self dynamic range more 100 dB. I want use
fluidsynth in home recording studio and need maximum quality.

Currently i hear many problems in it. But can't fully describe it. Few
last years i work on some program. It analyze signal and i can measure
FR/THD/IMD/DR and see all spectrum. I want add to it some functionality
to test fluidsynth. But it just hobby and i don't have enough time :(

My experience work with audio tell that much better use some dynamic
compression tool to prevent overload cheap equipment, than any other
way. It easy implement (any audio editors have this), all people, who
work with sound, can easy use it (it have same options in mostly all
variations). It verified way - it used every day by every sound
engineer. And we have many how-to use it.

For professional use, we need dithering for 16 bits (done), 24 bit
output (todo), float output (done), rendering to file in 16/24/float
bits (todo), 24bit sound fonts (todo). And many bug fix.
 
> > > Well, unfotutanely, as far as I know, it is a common misconception
> > in
> > > engineering. Truncation with or without dithering produces new
> > > harmoncis
> > > just in a different way. I call them distortions. 
> > 
> > I don't see harmonics after dithering ... Only noise.
> > Look at this:
> >
> http://www.users.qwest.net/~volt42/cadenzarecording/DitherExplained.pdf
> > 
> > In any case with dithering i don't hear any distortion, without - it
> > _very_ annoying me.
> > 
> 
> Well, it depends on what you call harmonics or noise. To me harmonic
> is magnitude at any frequency (in this content) basically the spectrum.

Harmonics - any magnitude at any frequency _correlated_ with signal!
Any other - just noise.
 
> As such, no matter what you do, with or without dithering, you damage
> the spectrum. The difference is that with dithering, our brain is less
> sensitive to it that is why you do not hear the spectral distrotion.

No. You can measure THD and IMD - without dithering it very bad. With
dithering it _very_ good. All digital conversions need  dithering. It
not psychoacoustics artifact. It just solution for fix one problem in
digital theory. Mostly all digital converter in scientific devices
applies it, it just can't right work without it.





reply via email to

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