Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: filtering, dither, and noiseshaping (Read 74238 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

filtering, dither, and noiseshaping

Reply #50
Common terminology consistent with the works of Lipshitz, Vanderkooy and Wannamaker:
dither = the signal you add right before quantization
quantization errors = another noise source due to the quantizer
overall/total error = the sum of both above.
Proper dithering makes the 2nd noise source (quantization errors) a source of white noise.
The noise shaping technique can alter the spectral shape of the overall/total error.

The wikipedia article on noise shaping is worth a read.

Of course there's colored dither out there. But a proper colored dither is just colored dither. It doesn't affect the spectral shape of quantization errors -- only the spectral shape of the overall/total error to some very limited extent. That's why "spreading the noise around" (quote from the wikipedia article) is kind of a misnomer, IMHO.

In case of the UV22 dither you still get a lot of noise in the base band due to the quantizer that adds white noise. Colored dither doesn't help you when you want the the noise floor (total error) to drop by more than 4.7 dB in some frequency band (compared to white TPDF dither). No matter what kind of crazy dither you are using.

Well SebastianG is obviously not on the same wavelength as I am on this, no pun intended.

It may also be a terminology issue.

I presume from this that the answer to my question is 'no', even a 20KHz low amplitude signal can benefit from dither in a 44.1KHz PCM environment, as much as a lower frequency source signal can benefit?

Sure, if by "benefit" you mean that your signal doesn't get lost like in undithered quantization.

What I don't understand is "ultrasonic" "dither" like UV22. It "claims" to leave the quantisation noise level in the audio band unchanged (i.e. same RMS level as with no dither), adds dither noise only at ultrasonic frequencies, but still manages to decorrelate the quantisation noise from the signal (...) What I don't understand is how a couple of high frequency sine waves (which is all UV22 appears to be) can work as correctly decorrelating dither.

Good question! UV22 seems to be just "filtered iid-RPDF-noise". The paper by Wannamaker et al also covers this kind of dither noise (see theorem 7 at page 40) but I have to admit that I'm not sure about its implications and how this exactly relates to UV22 assuming it fits the mentioned category of filtered nRPDF noise. For example: What exactly means "the total error will be wide-sense stationary and independent of the system input"? This can't be true in case of n=1, c_1=0.1 c_2=-0.1 for example, can it?. So, I was missing some more constraints on the c_is' magnitudes.

One last quote from the linked Wannamaker paper from the conclusion section:
"The use of spectrally-shaped dither will usually be superseded, however, by the powerful technique of noise shaping."

More you ever wanted to know about this is probably here (Robert Wannamaker's PhD thesis).

Cheers,
SG

filtering, dither, and noiseshaping

Reply #51
EDIT: this is in reply to MLXXX, post 50.

Why did you use noise shaped dither?

If you push all the noise above ~16kHz, then it'll probably hide a 20kHz signal!

I've attached the frequency plots for 20kHz, -100dB (generated the same way as you), converted to 16-bit without dither, and with 1LSB triangular dither (no noise shaping).

The 20kHz tone survives, distortion-free, as expected.

Cheers,
David.

 

filtering, dither, and noiseshaping

Reply #52
Why did you use noise shaped dither?

If you push all the noise above ~16kHz, then it'll probably hide a 20kHz signal!


Yes probably a bad idea.  I've redone it with 1LSB triangular dither no noise shaping (in Cooledit).
[Edit - results below at #55]

Did you notice that your graphs are showing -60dB rather than -100dB?

I think you did not reduce the signal amplitude sufficiently.

filtering, dither, and noiseshaping

Reply #53
2Bdecided, are you sure the signal was at -100 dBFS ?
I wouldn't expect it to show up at all after truncation to 16 bits (without dithering).

filtering, dither, and noiseshaping

Reply #54
Since my previous post I have used Cooledit to:
[blockquote]1.  Generate a mono 44.1KHz/32 bit (float) waveform with a single tone at -80dB
2.  Reduce the amplitude by 20dB
3.  Do a mixdown at 16bits wih 1LSB triangular dither (no shaping), and save.[/blockquote]

I then examined the saved mixdown:
(a) using the frequency analysis graph cooledit provides
(b) by listening to the file but playing it back at a sample rate of 8KHz instead of 44.1KHz.

Results I obtained were:

1.  The tone could be identified in the cumulative frequency analysis graph of the whole clip (slightly above the noise), but was more readily identified by observing the instantaneous frequency analysis, by setting Cooledit to play the waveform.  A 20KHz -100dB tone was as prominent in the graph as a 2KHz -100dB tone.

2. The higher the frequency of the tone, the more difficult it was to hear it above the dither noise.  In particular, the 20KHz tone tended to blend in with the dither, despite the whole file being played back at less than 1/5th speed, bringing the 20KHz tone into a more readily audible range.  [It became a 3628Hz tone as a result of the slow playback.]

I was surpised that the 20KHz tone showed up at a similar intensity level in the frequency analysis graph to lower frequency tones I tried.  On the other hand, I could not fail to notice how much more difficult it was to hear the 20Khz tone above the dither noise compared with lower frequency tones

For example, the 20KHz tone did not benefit from the dither as much as a 2KHz tone.

I did not experiment with other varieties of dither.  I suspect all forms of dither would struggle to make a low amplitude 20KHz waveform audible above dither/quantisation noise, where the format is 44.1/16 PCM.

filtering, dither, and noiseshaping

Reply #55
2Bdecided, are you sure the signal was at -100 dBFS ?
I wouldn't expect it to show up at all after truncation to 16 bits (without dithering).
It was +/- 0.33 LSB peak amplitude.

Whether this toggles the LSB in the output or not (without dither) depends entirely on the rounding used in the software. In Cool Edit, it does.


Did you notice that your graphs are showing -60dB rather than -100dB?

I think you did not reduce the signal amplitude sufficiently.
I did the test correctly. The frequency analysis dB scale is uncalibrated. You can reproduce the exact same graph using the FFT length, range and offset values shown in my image.


2. The higher the frequency of the tone, the more difficult it was to hear it above the dither noise.  In particular, the 20KHz tone tended to blend in with the dither, despite the whole file being played back at less than 1/5th speed, bringing the 20KHz tone into a more readily audible range.  [It became a 3628Hz tone as a result of the slow playback.]

I was surpised that the 20KHz tone showed up at a similar intensity level in the frequency analysis graph to lower frequency tones I tried.  On the other hand, I could not fail to notice how much more difficult it was to hear the 20Khz tone above the dither noise compared with lower frequency tones

For example, the 20KHz tone did not benefit from the dither as much as a 2KHz tone.

I did not experiment with other varieties of dither.  I suspect all forms of dither would struggle to make a low amplitude 20KHz waveform audible above dither/quantisation noise, where the format is 44.1/16 PCM.
This is entirely false.

The high frequency fall off you are hearing is due to your sound card, windows internal wave handling, and maybe your ears. The former two will fall off around the Nyquist frequency, whatever sample rate you choose for playback.

The frequency graphs show you what is actually there - 2kHz, 20kHz and even 200Hz - all are equally helped by dither. There is no frequency dependent effect.


If you look at the FAQ, you can find other threads where people join HA to explain why universally held theories are wrong, and proceed to prove this by incorrect use of hardware or software.

It's quite amusing, but we already have enough of these threads!

Please trust the frequency analysis: it is, in this case, correct.

Cheers,
David.

P.S. I'm not trying to be rude or harsh, but when you realise what you're claiming, you'll be surprised at the arrogance of it!

filtering, dither, and noiseshaping

Reply #56
The high frequency fall off you are hearing is due to your sound card, windows internal wave handling, and maybe your ears. The former two will fall off around the Nyquist frequency, whatever sample rate you choose for playback.

I was reluctant to perform the exercise that you suggested I could do in under a minute. I downloaded Cool Edit Pro only a week ago and have barely used it.  I anticipated there would be variables I would be unfamiliar with.  And you have listed a few potential variables I did actually consider and I'm sure there are more.

I see now that you in fact changed the scale on your frequency analysis plot by 40dB by changing the reference level.  When I change the various settings to match yours, I do not get the clear graphs you get, but ones showing the noise at a much closer level to the signal.  Anyway that is a detail I will not worry about.

I will concede that the 20KHz response is definitely there, and this differs from my intuitive hypothesis that it might hardly be present at all.

I also acknowledge that the intensity level shows up as at least approximately the same as for lower frequencies.  Whether under ideal conditions it is as easy to hear above the dither noise (something about which I still entertain doubts), becomes less important with 44.1KHz as we are moving away from that to 48KHz as a minimum sampling rate.

Although my hearing extends to about 21KHz, the response is much less than at lower frequencies.  This is a further reason for the topic to be moot, as most of us will not be able to hear higher frequency content that is commensurate with quantisation error.

On the whole I've found material I've read in HA quite stimulating, and I anticipate I will stick around a bit longer.

Regarding an attitude of arrogance I suppose it may have been presumptuous of me to query your graphs [though they do look so different to mine] but I have to say that as a newcomer I have received almost a barrage of negative remarks in this particular thread.  My initial purpose was to clarify that you can usefully reduce higher frequencies in the dither/quantisation noise in instances where the target signal is at lower frequencies; something that is at once almost self-evident but on the other hand probably difficult to explain mathematically.

And it is something pdq had requested an answer to.

His question has been answered in the affirmative, subject to the proviso that you cannot do the filtering in the digital domain (traditional 16 bit PCM) without retaining the result of the filtering at a greater precision.  This proviso to some people (even pdq himself) was sufficiently obvious not to need mentioning.

filtering, dither, and noiseshaping

Reply #57
I see now that you in fact changed the scale on your frequency analysis plot by 40dB by changing the reference level.  When I change the various settings to match yours, I do not get the clear graphs you get, but ones showing the noise at a much closer level to the signal.  Anyway that is a detail I will not worry about.
I generated a 1 second long tone, I selected the entire waveform, and clicked "scan" in the frequency analysis window. This averages the results of the analysis windows across the selection, rather than just showing you the result from one analysis window (the middle one).

Even with the reference changed from -40dB to 0dB, you shouldn't trust the graph 100%. It's nearly correctly for some settings, but not "calibrated". It'll jump around by a few dB if you change the window function, for example.


Quote
Regarding an attitude of arrogance I suppose it may have been presumptuous of me to query your graphs
No, it wasn't that - I don't mind people disagreeing with me! What you're doing by questioning whether dither "works" is questioning decades of work by people far more qualified than you or I. It's fair enough to question, and lots of "qualified" people have been wrong before, but the evidence in this case is overwhelming.

Cheers,
David.

filtering, dither, and noiseshaping

Reply #58
What you're doing by questioning whether dither "works" is questioning decades of work by people far more qualified than you or I. It's fair enough to question, and lots of "qualified" people have been wrong before, but the evidence in this case is overwhelming.

I was not questioning whether dither 'works'.  It has been apparent to me for some years that it does.

What I was querying is how effective it is for a signal approaching the Nyquist limit.  Intuitively for me that is where a weakness could lie.  But I also realise it is where a weakness could be least noticeable.

Cheers,
1080


filtering, dither, and noiseshaping

Reply #60

What I was querying is how effective it is for a signal approaching the Nyquist limit.

What do you mean by effective?

1. THD comes to mind, e.g. I would speculate that a low amplitude 10KHz tone would give more 2nd order harmonic than a 5Khz tone, after conversion to 44.1/16.  I know  this would depend on the particular dither protocol used, but as a general statement does this speculation have any validity?

2. S/N ratio comes to mind.  I presume that you cannot dither a 20KHz tone without using noise at around 20KHz or beyond.  So inevitably noise will encroach.  In contrast, for frequencies much lower than Nyquist, you can place the dither noise above the frequencies of interest.  Particularly with noise shaping it seems that the frequency range just below Nyquist may become quite noisy.  I suspect that if you are trying to hear a frequency of interest, it is distracting to hear noise concentrated at around the same frequency.  (So distracting, the frequency of interest may cease to be audible.)

3. IMD only came to mind this evening when I was listening to dithered -100dB signals.  The 20KHz signal seemed to intermodulate with the dither noise creating spurious sounds.  Sorry this is a bit vague but I almost felt I could hear a lower frequency tone as well as the actual 20KHz tone.  I guess this could also occur with a low frequency signal.

filtering, dither, and noiseshaping

Reply #61
In the case of the small 20 kHz signal, if one applied low frequency dither (i.e. send it through a low-pass filter before applying it) then the 20 kHz signal would sometimes be not present and other times present as a 1 lsb signal. On average, though, wouldn't it be present and in the correct amplitude and audible over the low-frequency dither?

filtering, dither, and noiseshaping

Reply #62
1. THD comes to mind (...)
3. IMD (...)

Properly dithered quantization --> No THD, no IMD, no nothing except for some noise.
Doing it properly is soooo easy: Just use white TPDF-noise with "2 bits peak-to-peak" as dither.
End of story.

2. S/N ratio comes to mind ....

If you're not happy with the white noise floor you'll be getting you could use noise shaping as well and/or use a higher bit depth. Note: Noise shaping is not the same as using a colored(*) dither.

.... I presume that you cannot dither a 20KHz tone without using noise at around 20KHz or beyond.

If you're interested in constraints about dither in order to be "effective" you should check Wannamaker's dissertation. Anyhow, why do you still tackle those questions when there's a simple, effective, and proven method available to do things the right way?

edit: (*) colored = opposite of white = not a flat power spectrum.

filtering, dither, and noiseshaping

Reply #63
1. THD comes to mind, e.g. I would speculate that a low amplitude 10KHz tone would give more 2nd order harmonic than a 5Khz tone, after conversion to 44.1/16.  I know  this would depend on the particular dither protocol used, but as a general statement does this speculation have any validity?



No,it wouldn't.

Neither would give you any harmonics IF YOU DITHER CORRECTLY. White, TPD dither.

Try it, you'll like it.
-----
J. D. (jj) Johnston

filtering, dither, and noiseshaping

Reply #64
Here's something I've been thinking about regarding white versus colored dither. Maybe anyone knowledgable can verify and comment on it. If I'm right colored dither can outperform white dither. Please read on:

An interesting question is IMHO if it's actually worth using non-white dithers especially in the light of the noise shaping technique. To check this my idea was to compare plain "white TPD dither" with Wannamaker's "high pass TPD dither" (page 37). According to Wannamaker et al this kind of dither is also appropriate which I presume means decorrelated moments of signal and error for the first two orders. To compare the performance we could use noise shaping to compensate for the colored error and then check how this relates in terms of power to the error we get by using plain white TPD dither.

According to Wannamaker the autocorrelation of the error using this "high pass dither" is
[... 0 0 0 -1 3 -1 0 0 0 ...]  (normalized so that the center coefficients corresponds to the variance in multiples of LSB^2/12)
The autocorrelation of the error using the plain white TPD dither is
[... 0 0 0 0 3 0 0 0 0 ...]  (normalized as above)

The noise transfer function for whitening the colored error should be N(z) = 1/(1 - r z^-1) where r is the root inside the unit circle of the polynomial x^2-3x+1, approximately 0.38197. To get the autocorrelation of the whitened error we can simply apply this filter bidirectionally on the original autocorrelation:
filtfilt(1,[1 -r],[... 0 0 0 -1 3 -1 0 0 0 ...]) --> [... 0 0 0 2.61803 0 0 0 ...]
The result is a scaled unit impulse (white). Incidently the scale is the other root of the polynomial from above -- (3+sqrt(5))/2=2.61803 -- and is equivalent to the error's variance in terms of LSB^2/12 which is lower than 3.

So, in case I didn't make any mistakes the use of the "high pass dither" is preferable because the noise floor is lower by log10(3/2.61803)*10 = 0.59 dB. Of course, the 0.59 dB improvement is hardly noticable but it sure was a big surprise for me!

Can anyone confirm this or point out any mistakes I possibly made?
I think I'm going to run some simulations...


Cheers,
SG

filtering, dither, and noiseshaping

Reply #65
I generated a 1 second long tone, I selected the entire waveform, and clicked "scan" in the frequency analysis window. This averages the results of the analysis windows across the selection, rather than just showing you the result from one analysis window (the middle one).

Even with the reference changed from -40dB to 0dB, you shouldn't trust the graph 100%. It's nearly correctly for some settings, but not "calibrated". It'll jump around by a few dB if you change the window function, for example.

Thanks for that.  I have now been able to replicate your graphs.

But I have come up with an anomaly.  When I use my version of cool edit pro (2.00 build 2095) to generate a stereo sine wave it seems to generate the right channel differently.  This is apparent when looking at the frequency distribution of the 32 or 24 bit wave immediately after it is generated: the right-hand channel has a 'fatter' distribution.

And after dithering to 16-bits, odd order harmonics are visible, but only in the right channel. I do not know whether others have encountered this.  Here is what the frequency distribution looks like for a 5 second clip recorded at -50dB using a triangular pdf dither (set to 2 bits). This was all done in Cool Edit and the result was the same on an old pc running XP and a newer pc running Vista:-

Tone Generator Query

The difference is real. After separating the channels, I was able to successfully ABX them.  [Interestingly, the channel with the harmonics actually sounded 'purer' to my ears than the one without.]

I have to assume that I have used an incorrect setting, or the version of cool edit had a minor bug.

Although I know that some forms of stereo encoding use L+R in one channel and a difference signal in the other channel (e.g. FM radio), I do not think that is the method for standard 16 or 24 bit stereo PCM at 44.1KHz. When I used other software (Audacity) to generate a 4KHz stereo sinewave, both channels were the same.

Can anyone confirm this or point out any mistakes I possibly made?
I think I'm going to run some simulations...

Hi Sebastian.  I have read the paper, but its mathematics are well beyond my current comprehension.  I can only offer an intuitive comment, and it is that the lower frequency components of dither are probably redundant.  This may be why it can be slightly more efficient to start with coloured noise.

filtering, dither, and noiseshaping

Reply #66
In the case of the small 20 kHz signal, if one applied low frequency dither (i.e. send it through a low-pass filter before applying it) then the 20 kHz signal would sometimes be not present and other times present as a 1 lsb signal. On average, though, wouldn't it be present and in the correct amplitude and audible over the low-frequency dither?

I am probably one of the least qualified people of those contributing to this thread to comment on this but I will try.

First off, if ordinary triangular probability distribution function (TPDF) dither is used, the frequency components of the dither can exceed the Nyquist limit.  I say this because the TPDF is typically generated with random numbers.  It is possible that from one sampling instant (say 44.1KHz sampling) to the next, the dither can vary in instantaneous amplitude from +1 (least significant bit) to -1.  [Here I think is where I fell into error with my own intuitive analysis. I had assumed the dither would need to be filtered to half the sampling frequency.  In fact that filtering (necessary to avoid aliases) can occur after the dither is applied.]

Your suggestion of filtering the dither before it is applied would dramatically reduce its maximum frequency components.  I do not see how if so constrained it could be at all effective for signals at high frequencies. For example, if you limited the dither to a maximum component frequency of 10KHz I am sure it would be insufficient to rescue a low amplitude 20KHz signal from quantisation error.  However others may have more specific (and informed!) comments to make.

Handy software for simple real time experimenting with dither can be found on the following webpage: ditherer

filtering, dither, and noiseshaping

Reply #67
First off, if ordinary triangular probability distribution function (TPDF) dither is used, the frequency components of the dither can exceed the Nyquist limit.
No. Any samples you can generate do not exceed the Nyquist limit, by definition. The analogue signal is recovered from the samples by a bandlimited process, which by definition cannot produce frequencies about fs/2. Perhaps what you mean is that the noise will no longer be white (that is, have a flat PSD) - and here you are still mistaken. Provided there is no correlation between samples, the PSD of the produced spectrum will be flat - whether the PDF of the noise is triangular, Gaussian, or any other.

filtering, dither, and noiseshaping

Reply #68
Cabbagerat, I have been wrong so many times previously in this thread it is not surprising to me that you commenced your post immediately above with the word 'No'.

However, did you read my post carefully, particularly the part in italics?  I referred to the fact that filtering could be applied after the dither process.

I do not understand your use of the phrase 'by definition'.  If you generate a set of random numbers at 44.1KHz you will generate instantaneous slew rates beyond what a low amplitude continuous 22.05KHz wave would involve.  Theoretically you could have a series of numbers as follows: +1, -1, +1, -1. [although the probability of that exact series would be extremely low]

Intuitively [for me anyway], you need freedom of the dither to change its value as fast as possible, and not to be filtered down to 22.05KHz.  A low amplitude continuous 22.05KHz wave (or a little below 22.05KHz) could lead to the following instantaneous samples at 44.1KHz sampling: +1, 0, -1, 0, +1, 0, -1, 0

But if someone can confirm dither is filtered down before it is combined with the signal, I will have to reconsider my intuitive understanding.

filtering, dither, and noiseshaping

Reply #69
I do not understand your use of the phrase 'by definition'.

I think I can answer this one. A series of samples at 44.1 khz cannot be used to represent any frequency above 22.05 khz because there will be a perfectly valid frequency below 22.05 khz which also goes through those exact same samples. Therefore 'by definition' all of the resulting frequencies are below the Nyquist limit.

filtering, dither, and noiseshaping

Reply #70
Cabbagerat, I have been wrong so many times previously in this thread it is not surprising to me that you commenced your post immediately above with the word 'No'.
Please don't think I was being rude 
I do not understand your use of the phrase 'by definition'.  If you generate a set of random numbers at 44.1KHz you will generate instantaneous slew rates beyond what a continuous 22.05KHz wave would involve.  Theoretically you could have a series of numbers as follows: +1, -1, +1, -1. [although the probability of that exact series would be extremely low]

Intuitively [for me anyway], you need freedom of the dither to change its value as fast as possible, and not to be filtered down to 22.05KHz.  A low amplitude continuous 22.05KHz wave (or a little below 22.05KHz) could lead to the following instantaneous samples at 44.1KHz sampling: +1, 0, -1, 0, +1, 0, -1, 0
A continuous sine wave at 22.05KHz, sampled at 44.1KHz, could produces the samples [0, 0, 0, 0, 0, .....] or [1, -1, 1, -1, 1, -1, ......], or something inbetween - depending on the phase difference between it and the carrier. In fact, a sine wave at fs/2 Hz, sampled at fs Hz produces the samples [-sin(theta), sin(theta), -sin(theta), sin(theta), .....], where theta is the phase offset between the wave and the carrier. But that's just an aside. Critical sampling is a bit of a complication, and can be avoided entirely by defining your sampling theorem to require the signal to be bandlimited to less than fs/2 Hz.

The issue of "by definition" is that you cannot break the sampling theorem in any single rate digital system. Any (finite-valued) set of samples you can produce correspond to samples of a function bandlimited to half the system sampling rate. Be careful here, though - they might not correspond to samples of the bandlimited function  you intended them to. This sounds like an arbitrary distinction, but I think it's fairly important. This is what I meant by "by definition": "by definition, all sampled signals are bandlimited".

As long as noise is generated digitally, bandlimiting doesn't matter.

Consider sampling an infinite bandwidth white gaussian noise source, without using an anti-aliasing filter. Clearly, the frequencies about fs/2 (where fs is clearly the sampling frequency) will be aliased back into that band. But because the noise source is infinite bandwidth, the same amount of energy will end up being aliased into every frequency of the sampled signal - the samples will stay white. Note that this is only true for white noise, but should be true for white noise with any PDF.

So, as long as dither is white - bandlimiting doesn't matter.

Complications start coming up when the noise used is coloured, sampling rates are changed, and because of the way data converters are actually made. But those are different issues for a different time (and I'm hardly an expert on dither, noise shaping or ADC/DAC hardware).


I do not understand your use of the phrase 'by definition'.

I think I can answer this one. A series of samples at 44.1 khz cannot be used to represent any frequency above 22.05 khz because there will be a perfectly valid frequency below 22.05 khz which also goes through those exact same samples. Therefore 'by definition' all of the resulting frequencies are below the Nyquist limit.
Thanks, that's a lot clearer than what I wrote.

filtering, dither, and noiseshaping

Reply #71
I have come up with an anomaly.  When I use my version of cool edit pro (2.00 build 2095) to generate a stereo sine wave it seems to generate the right channel differently.  This is apparent when looking at the frequency distribution of the 32 or 24 bit wave immediately after it is generated: the right-hand channel has a 'fatter' distribution.
Check the settings (all of them) in the tone generator. IIRC there's a difference between the left and right channels in the "default" settings. I can't remember what it is though (might be phase?), or why it would cause harmonics in the downconversion.

If it is phase, that's why the initial frequency analysis looks "fatter" - it starts on a non-zero sample on the phase shifted channel only.

Cheers,
David.


An interesting question is IMHO if it's actually worth using non-white dithers especially in the light of the noise shaping technique. To check this my idea was to compare plain "white TPD dither" with Wannamaker's "high pass TPD dither" (page 37).

...

So, in case I didn't make any mistakes the use of the "high pass dither" is preferable because the noise floor is lower by log10(3/2.61803)*10 = 0.59 dB. Of course, the 0.59 dB improvement is hardly noticable but it sure was a big surprise for me!
I'm glad you're coming around to my way of thinking...
http://www.hydrogenaudio.org/forums/index....st&p=514491
However, I don't claim to understand the theory at all.
Cheers,
David.

filtering, dither, and noiseshaping

Reply #72
A continuous sine wave at 22.05KHz, sampled at 44.1KHz, could produces the samples [0, 0, 0, 0, 0, .....] or [1, -1, 1, -1, 1, -1, ......], or something inbetween - depending on the phase difference between it and the carrier. In fact, a sine wave at fs/2 Hz, sampled at fs Hz produces the samples [-sin(theta), sin(theta), -sin(theta), sin(theta), .....], where theta is the phase offset between the wave and the carrier. But that's just an aside. Critical sampling is a bit of a complication, and can be avoided entirely by defining your sampling theorem to require the signal to be bandlimited to less than fs/2 Hz.

No offence taken. Yes I was aware of that phase issue and that is why I stated 'or a little below' 22.05KHz.

The issue of "by definition" is that you cannot break the sampling theorem in any single rate digital system. Any (finite-valued) set of samples you can produce correspond to samples of a function bandlimited to half the system sampling rate. Be careful here, though - they might not correspond to samples of the bandlimited function  you intended them to. This sounds like an arbitrary distinction, but I think it's fairly important. This is what I meant by "by definition": "by definition, all sampled signals are bandlimited".

I think I understand what you are saying here.  But I am not referring to the final product of a sampling process, but to an intermediate step, the addition of dither.

The point I wish to concentrate on is simply this: is dither intended for use for a signal sampled at 44.1KHz pre-filtered to 22.05KHz or is it allowed to roam freely as generated.  I understand that TPDF dither can be generated wth two random number generators each creating +- 0.5 LSB, so that in combination (addition of the outputs) they produce +- 1.0 LSB of dither, concentrated around 0 and tapering off at the outer limits of +1 and -1 which are extremely improbable.

Actually I was hoping to get a sample of raw TPDF dither, but I have not come across a sample on the net.  Or at least a little bit of software that generates TPDF dither in isolation.  I was then going to add that dither to a 24-bit signal in a relatively 'manual' dithering process, and save the mix to 16 bits without [further] dither.

Check the settings (all of them) in the tone generator. IIRC there's a difference between the left and right channels in the "default" settings. I can't remember what it is though (might be phase?), or why it would cause harmonics in the downconversion.

If it is phase, that's why the initial frequency analysis looks "fatter" - it starts on a non-zero sample on the phase shifted channel only.

Cheers,
David.

Seemed odd that the cooledit software would produce the same anomaly on different pc's.  I've subsequently downloaded a version of Audition and it is free of the error.  So I am using Audition for the moment.  But I'll go back and check the cooledit settings when I have a spare moment.  Thanks.

filtering, dither, and noiseshaping

Reply #73
Also, IIRC, the "correct" dither settings in CEP are dither depth = 1 bit Triangular, because of the way it defines the dither depth. Selecting 2 bits gives you 2 bits RMS - this is double what you want (1 bit RMS, 2 bits peak-to-peak).

Cheers,
David.

filtering, dither, and noiseshaping

Reply #74
The point I wish to concentrate on is simply this: is dither intended for use for a signal sampled at 44.1KHz pre-filtered to 22.05KHz or is it allowed to roam freely as generated.

"As generated", assuming it was generated digitally with the same sample rate, the dither is already bandlimited to between 0 and fs/2 Hz. Assuming the generator isn't horribly broken, you don't need to filter the dither at all.

This description slightly oversimplifies the mathematical point - but is not misleading. As long as you generate the dither digitally, and the samples match the required spectrum (or PSD, or autocorrelation, etc.) and PDF, then you don't need to worry about filtering.
Actually I was hoping to get a sample of raw TPDF dither, but I have not come across a sample on the net.  Or at least a little bit of software that generates TPDF dither in isolation.  I was then going to add that dither to a 24-bit signal in a relatively 'manual' dithering process, and save the mix to 16 bits without [further] dither.

Somebody please correct me if I am wrong, but as far as I can see you should be able to do something like this in GNU Octave (freely available on Windows, Linux and Mac) or MATLAB to get what you want:
Code: [Select]
seconds = 1;
rate = 44100;
sz = seconds*rate;
x=(rand(1,sz)+rand(1,sz)-1)/32768;
wavwrite('out.wav', x, rate, 24);