Head-Fi.org › Forums › Equipment Forums › Sound Science › Impulse response convolver: to dither or not to dither?
New Posts  All Forums:Forum Nav:

Impulse response convolver: to dither or not to dither?

post #1 of 8
Thread Starter 

Recently thanks to this thread

http://www.head-fi.org/t/671936/how-i-turned-a-bass-iem-into-a-balanced-clearer-iem

 

I happened across a fully featured signal processing suite for android, including an impulse convolver

http://forum.xda-developers.com/showthread.php?t=2191223

 

Which, as you sound science guys should know, allows you to basically put in any kind of linear signal processing possible, including any kind of EQ, reverb, etc.  Apparently it even processes the left and right channels independently.  But no cross-channel processing, so no crossfeed or copying your Smyth Realizer PRIRs to your Android just yet tongue.gif

 

Now, a minor question I have:  I made an impulse response in Audacity using Electri-Q and saved it as a 16-bit stereo wav.  (Not sure whether higher bit depths are supported; if 32 bit float is supported this whole discussion would be moot)  Upon re-opening the file I noticed that the waveform is slightly different from before saving.  I realized that this is probably due to dithering being used.

 

Now, the advantage of dither in the normal case of music playback is a bit beyond me already, so I'd like to defer to you experts to explain to me whether it's a better idea to have dither or not have dither for an impulse response to be used in a convolver? confused.gifconfused_face(1).gifblink.gif

post #2 of 8

Note that Audacity has a buggy dither code that adds higher than normal amount of noise (~-80 dBFS, I do not remember the exact number) when writing stereo files. So, with Audacity, no dither is obviously preferred. For an impulse response, I recommend using float format if supported by the software, since the file is small anyway.


Edited by stv014 - 7/13/13 at 12:42am
post #3 of 8

Audacity uses a 1st difference TPDF noise that trades higher peak noise at the top of the audio spectrum where we don't hear so good for lower perceived noise where our hearing is more sensitive

 

did you do the integral of noise, use the typical A-weighting function? - the frequency shaped noise should sound less noisy than flat 2 lsb TPDF

 

 

the question of what dither does in a filter design algorithm's input isn't obvious to me, at a guess the frequency shaping would be the wrong thing

 

but its unlikely a home measured acoustic impulse response ever drops to -80 dB

 

and frequency response variations in the final filter should be inaudible bellow 0.1 dB (~= -40 dB variations from unity)


Edited by jcx - 7/13/13 at 7:48am
post #4 of 8
Quote:
Originally Posted by jcx View Post

Audacity uses a 1st difference TPDF noise that trades higher peak noise at the top of the audio spectrum where we don't hear so good for lower perceived noise where our hearing is more sensitive

 

I know that, and even use the same algorithm in the programs linked in my signature. However, Audacity is buggy, and uses the same internal state for filtering the dither noise on both channels when processing stereo audio. In the case of the above simple dither algorithm, it just makes the spectrum white and adds some crosstalk, but the default "high quality" dither in Audacity is actually noise shaping, and with the bug, that is what adds the ~-80 dB noise (-81.4 dB A-weighted at 44100 Hz):

Mono:

    Noise (RMS):         0.0000870 ( -81.210 dBr)
    Noise (A-weighted):  0.0000323 ( -89.818 dBr)
    Noise (R468 wtd.):   0.0000323 ( -89.822 dBr)

Stereo:

    Noise (RMS):         0.0000879 ( -81.121 dBr)
    Noise (A-weighted):  0.0000850 ( -81.410 dBr)
    Noise (R468 wtd.):   0.0002505 ( -72.025 dBr)

This was tested with Audacity 2.0.0 on Linux, but the bug seems to have been there for a long time. For comparison, here is also the triangular dither:

Mono:

    Noise (RMS):         0.0000214 ( -93.381 dBr)
    Noise (A-weighted):  0.0000135 ( -97.383 dBr)
    Noise (R468 wtd.):   0.0000376 ( -88.504 dBr)

Stereo:

    Noise (RMS):         0.0000215 ( -93.332 dBr)
    Noise (A-weighted):  0.0000164 ( -95.723 dBr)
    Noise (R468 wtd.):   0.0000475 ( -86.458 dBr)

 

Noise in an impulse response basically adds a low level "reverb". It is probably not a real audible issue, but the extra disk space used by floats is insignificant with a short file like a typical impulse response.


Edited by stv014 - 7/13/13 at 10:24am
post #5 of 8

Ah, just looked "High-quality Conversion" dither is new, does seem to have problems

 

I agree that Audacity can have problems, the programmers can get stuck in bad conceptualizations, don't always take even straight forward technical input gracefully

 

 

for the OP, thread topic - the general principle I have read is to only use perceptual shaped dither at the last possible processing step - if substantial processing will happen later and you absolutely must reduce to 16 bit then flat/white TPDF dither should be used

post #6 of 8

I'd try stv014's advice as well. Convolution is usually done in floating point, so try to save your IR as 32-bit floating point (IEEE) WAV. Dithering should be done after that and additional processing is done, if needed at all.


Edited by xnor - 7/13/13 at 2:08pm
post #7 of 8
Thread Starter 
Quote:
Originally Posted by xnor View Post

I'd try stv014's advice as well. Convolution is usually done in floating point, so try to save your IR as 32-bit floating point (IEEE) WAV. Dithering should be done after that and additional processing is done, if needed at all.

 

Thanks guys.  The highest bit depth I've been able to output from this old version of Audacity is 32bit signed PCM.  The Viper4Android app read that with no problems.  I'll try outputting 32bit float on a new version of Audacity later but I can't see myself hearing the difference between 32bit signed and 32bit float lol.

 

Another minor issue is that I found that the "tail" of the impulse response extends much further than I thought and the app apparently supports up to 16384 taps.  That far down the impulse the residual response is negligible, but as an academic question:  is it better to tail off the response to zero manually or is it fine to leave it as is?

 

Either way, this app has brought new life to my phone as a player! biggrin.gif It's pushing my best open air full size cans like a champ biggrin.gif

post #8 of 8

If you just cut it off you will get ringing in the frequency domain, but the amount will be extremely small if the IR decayed far enough. If you cannot apply window functions then just try a smooth fade out and compare the FR before/after.

New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Sound Science
Head-Fi.org › Forums › Equipment Forums › Sound Science › Impulse response convolver: to dither or not to dither?