• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Dithering is a Mathematical Process - NOT a psychoacoustic process.

OP
j_j

j_j

Major Contributor
Audio Luminary
Technical Expert
Joined
Oct 10, 2017
Messages
2,267
Likes
4,758
Location
My kitchen or my listening room.
I wrote an article a few years back surveying common windows and discussing their pros and cons for different measurement goals. AudioXpress put it on line here.

Just a minor gripe. "Hanning" is the process of applying a Hann window (proposed by Dr. von Hann) to a stream of data. Since it adds to 1 exactly with a 1/2 overlap, that process acquired a name. But the name of the window is "Hann" window.

Also long plot of the far-frequency response along with linear plot of the peak are quite helpful. :)
 

SIY

Grand Contributor
Technical Expert
Joined
Apr 6, 2018
Messages
10,383
Likes
24,749
Location
Alfred, NY
Just a minor gripe. "Hanning" is the process of applying a Hann window (proposed by Dr. von Hann) to a stream of data. Since it adds to 1 exactly with a 1/2 overlap, that process acquired a name. But the name of the window is "Hann" window.

Both terms are used in texts and the literature. See, for example page 11 of this NI tech note. Or this tutorial from Stanford. The dislike of "Hanning" (which you are far from alone about!) probably comes from the ease of confusion with "Hamming." And I fully understand the objection of verb vs noun, but still use either term interchangeably, depending on where my brain is scattered at the moment. I do note that the Hann vs. Hanning argument is not exactly new... (and Harris is a superb reference)

See, you're not the only grumpy gray-haired guy here!:cool:
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
Not some old, grumpy, grey-haired curmudgeon????

Nah, you come across as entirely jovial. :)

hann(N)= sin( 2*pi* (2n+1)/4/N))^2 (0<=n<N) You may see other expressions that go to zero at the ends. That is making the window unnecessarily short for analysis. It can also be written as .5 - .5 cos(...) Same thing.

Well, that seems to work...

1581039405627.png


To answer your question about Hamming window, the + centers the window around zero.

Ahh... thanks--"mystery" solved. :)
 

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,626
Likes
10,202
Location
North-East
Nah, you come across as entirely jovial. :)



Well, that seems to work...

View attachment 48924

Kaiser, Chebyshev, and variations on sum of cosines windows all the way up to 20+ terms are my go to windows in DeltaWave. Others, like the 7 term Blackman-Harris are also pretty good.
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
Whilst we're on this windows business, how about a discussion on FIR filter impulse response windowing...

(I've mostly used Kaiser.)
 
Last edited:

DonH56

Master Contributor
Technical Expert
Forum Donor
Joined
Mar 15, 2016
Messages
7,834
Likes
16,496
Location
Monument, CO
One often does not have that choice in the real world of audio, so yes, windows are then necessary. For test signals, there is often a good reason to have a prime wrt analysis length, too. Depends on what you're doing.

Rectangular/no window is great when you can perfectly match the FFT size to the signal period (aside from low-level noise). Sometimes that's possible, but often it's not, and then the best choice, as JJ said, depends on what you need.

I often use Dolph-Chebyshev since it easily allows pushing the side lobes below the noise level, even when there's very little noise. If you're only interested in features above the level of the side lobes, another window may do just as well or better.

Yes, and why I mentioned the other windows. I was lucky; as a designer of ADCs and DACs, I got to choose my test signals. Sometimes...
 

xr100

Addicted to Fun and Learning
Joined
Jan 6, 2020
Messages
518
Likes
237
Location
London, UK
I used Kaiser in DeltaWave filter calculations.

Forgive me if I've missed something, but isn't DeltaWave used for measuring signals rather than filter design? (i.e. For high quality audio processing applications, where the output signal will be ultimately "received" by the human auditory system.)
 

pkane

Master Contributor
Forum Donor
Joined
Aug 18, 2017
Messages
5,626
Likes
10,202
Location
North-East
Forgive me if I've missed something, but isn't DeltaWave used for measuring signals rather than filter design? (i.e. For high quality audio processing applications, where the output signal will be ultimately "received" by the human auditory system.)

Actually, DeltaWave is designed for me to play with audio :) It doesn't design filters for the user, but it constructs them on the fly when requested.

There are various selectable filters in DW so you can compare portions of spectrum, or eliminate specific frequencies with notch filters. Here's an example white noise filtered with a band-pass filter constructed by DW (blue line is the original signal, pink is filtered). You can see I selected a 5kHz low pass and 3kHz high-pass filter on the comparison waveform.

1581043004667.png
 

exaudio

Member
Forum Donor
Joined
Jun 11, 2018
Messages
46
Likes
75
Assume we have a signal of unknown origin... price, temperature, coordinate of some movement, index of happiness in population...

...does anybody apply dither, say, before rounding financial data, which is a type of quantization?)...

If I wanted to treat financial data like an analog signal that I needed to digitize, and I was limited to a certain number of bits to represent each sample, then yes I would want to apply dither.
 

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,579
Likes
38,274
Location
Gold Coast, Queensland, Australia
If I wanted to treat financial data like an analog signal that I needed to digitize, and I was limited to a certain number of bits to represent each sample, then yes I would want to apply dither.

If you add dither to my finances, will my bank account go up and down by a few cents every time I look at the balance?
 

restorer-john

Grand Contributor
Joined
Mar 1, 2018
Messages
12,579
Likes
38,274
Location
Gold Coast, Queensland, Australia
For test signals, there is often a good reason to have a prime wrt analysis length, too. Depends on what you're doing.

Perhaps you can clarify why certain test discs (CD) of mine use different (to one another) digitally generated (not from analog sign gen) prime frequencies for the high precision THD testing tracks?

The Denon uses (small excerpts- not complete) 1001/3149/6301/9999/15999Hz etc. The CBS-CD1 uses 997/4001/7993/19997Hz etc The Philips test disc 3 uses 997/10007/16001Hz etc. My Sony test discs use even figures (1KHz,10KHz etc)

I've seen and read various explanations about hitting absolute 16 bit values or correlation with the sampling frequency but the only one that lines up with that is the Denon disc (1982) and it would have been a 44,056 sample rate on a Umatic based source (via a PCM-xxxx adapter at the time I assume), which makes no sense as the frequencies are spot on at 44,100.

Way back in 1984, Louis Challis compared the Sony YEDs with the Denon 99 track test disc and found a big difference in the 5th harmonic. Were/are digitally generated sines synthesized from lookup tables? Is the difference in 5th to do with the chosen frequency or a flaw in the generated sine itself?

(The Sony is a misprint, the frequency is 1000Hz)
1581055671404.png


I tried 997,8,9 1000 and 1001,2,3 generated sines on loopback (ARTA) and could repeatedly get better (very tiny amount) residual THD than the 1KHz. That was with either 24/44.1 or 24/48. I couldn't do 16/44.

Anyway, I'll be perfectly honest, I'm confused about it all and have been for years.

And the Denon disc gives lower THD than the CBS CD-1 test disc (which was the test standard for years at all the audio magazines) on many of its high precision tracks too. Not only that, the Denon is balls accurate (benchtop freq counter) on all the spot frequencies, whereas the CD-1 isn't.
 
Last edited:

mansr

Major Contributor
Joined
Oct 5, 2018
Messages
4,685
Likes
10,700
Location
Hampshire
Perhaps you can clarify why certain test discs (CD) of mine use different (to one another) digitally generated (not from analog sign gen) prime frequencies for the high precision THD testing tracks?

The Denon uses (small excerpts- not complete) 1001/3149/6301/9999/15999Hz etc. The CBS-CD1 uses 997/4001/7993/19997Hz etc The Philips test disc 3 uses 997/10007/16001Hz etc. My Sony test discs use even figures (1KHz,10KHz etc)

I've seen and read various explanations about hitting absolute 16 bit values or correlation with the sampling frequency but the only one that lines up with that is the Denon disc (1982) and it would have been a 44,056 sample rate on a Umatic based source (via a PCM-xxxx adapter at the time I assume), which makes no sense as the frequencies are spot on at 44,100.

Way back in 1984, Louis Challis compared the Sony YEDs with the Denon 99 track test disc and found a big difference in the 5th harmonic. Were/are digitally generated sines synthesized from lookup tables? Is the difference in 5th to do with the chosen frequency or a flaw in the generated sine itself?

(The Sony is a misprint, the frequency is 1000Hz)
View attachment 48940

I tried 997,8,9 1000 and 1001,2,3 generated sines on loopback (ARTA) and could repeatedly get better (very tiny amount) residual THD than the 1KHz. That was with either 24/44.1 or 24/48. I couldn't do 16/44.

Anyway, I'll be perfectly honest, I'm confused about it all and have been for years.

And the Denon disc gives lower THD than the CBS CD-1 test disc (which was the test standard for years at all the audio magazines) on many of its high precision tracks too. Not only that, the Denon is balls accurate (benchtop freq counter) on all the spot frequencies, whereas the CD-1 isn't.
If you rip the discs and post the tracks, we can perhaps figure something out.
 

Serge Smirnoff

Active Member
Joined
Dec 7, 2019
Messages
240
Likes
136
For example, here is a 1kHz sine wave at -40dBr, truncated to 16-bits: (rescaled so that the 1kHz sine wave is at 0dBr in the plots.)
Why you choose truncation and not rounding? May I ask you to repeat your example with rounding?
 

Serge Smirnoff

Active Member
Joined
Dec 7, 2019
Messages
240
Likes
136
Yes, one could do wider band noise, but I'm pretty sure that the statistical approach to detection will require endless explanations.
The question is whether the human auditory system can perform that statistical analysis for the detection.
 

Serge Smirnoff

Active Member
Joined
Dec 7, 2019
Messages
240
Likes
136
It does work universally. My first exposure to dithering was in the 1970s in capturing photoacoustic interferograms, decidedly nonperiodic.
Then probably rounding operation, routinely used everywhere, is not the most correct and we should use some more sophisticated method for that?
 

SIY

Grand Contributor
Technical Expert
Joined
Apr 6, 2018
Messages
10,383
Likes
24,749
Location
Alfred, NY
Then probably rounding operation, routinely used everywhere, is not the most correct and we should use some more sophisticated method for that?

Yes, we dither. That's the "sophisticated" method used nearly universally in discrete sampled quantized systems.

I'll suggest one more time that you try to understand what dither is and how it works- your protests notwithstanding, the stuff you say strongly indicates that you don't.
 
Top Bottom