Skip to main content

Topic: filtering, dither, and noiseshaping (Read 52113 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • hellokeith
  • [*][*][*][*]
filtering, dither, and noiseshaping
Would someone be kind enough to summarize how filtering, dither, and noiseshaping are used in SRC and mastering applications? Are they ever used simultaneously?

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #1
Filtering is an awfully big topic. Filters are used for a great many things. If you mean something along the lines of the brick wall filters for playback, that is part of the hardware, not the data. Many kind of filters are used in mastering, mainly to emphasize or reduce particular frequencies or frequency ranges.

Dithering and noise shaping are use together. Dither is noise shaped for best results, mainly so you don’t hear the dithering noise. Dither can be applied at recording time, in the analogue domain prior to the ADC, but is only relevant for 16 bit recording, and probably just about non-existent in professional work these days. Also in amateur and home work I suspect, as I don’t know of any soundcard with the ability to do it.

The only other time dither is used is when reducing the bit depth. Going from 32 or 24 bit to 16 bit results in quantization distortion. Dither eliminates that. The trade off is a higher background noise, which sound a lot better than the distortion. Good noise shaping puts most of the dither in the very high frequency range where few people have any chance of hearing it.

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #2
When changing the sample rate, filters are quite important, at least when going from a higher to a lower sample rate. The filters don’t seem to really make much of a difference when upsampling, but their use is a pretty normal part of the process. Without high frequency cut off before downsampling, there would be a lot of aliasing distortion -- if there were any higher frequencies in the original (beyond the Nyquist limit of the result sample rate) .

  • Woodinville
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #3
For filtering: http://www.aes.org/sections/pnw/ppt/filters/filtutv1.ppt

For quantization, noise shaping, and dithering:  http://www.aes.org/sections/pnw/ppt/adc.ppt

More there than can be discussed in one article here.
-----
J. D. (jj) Johnston

  • knutinh
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #4
The filters don’t seem to really make much of a difference when upsampling, but their use is a pretty normal part of the process.

Try generating a regular 8kHz sampled signal (with 4kHz bandwidth), then upsampling to 96kHz with close to "no filtering": producing pulses 1 sample wide (1/96000 seconds) spaced by 1/8000 seconds...

-k

  • SebastianG
  • [*][*][*][*][*]
  • Developer
filtering, dither, and noiseshaping
Reply #5
The filters don’t seem to really make much of a difference when upsampling, but their use is a pretty normal part of the process.

How do you resample to a higher sampling rate without filters?
Of course there are also filters involved -- even if you do linear interpolation. Linear interpolation corresponds to a filter with a triangular impulse response. These filters arn't used to fight aliasing but imaging.

... 1 sample wide ...

A sample has no width.

Cheers,
SG

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #6
I can’t speak to what in the resampling process may mathematically be called a filter, so I will be more specific. CoolEdit/Audition, which we know does very good resampling, provides pre and post filters as an option. If you select some music, such as a CD track, and upsample from 44.1kHz to 96kHz, it can be shown that there is some difference, depending on whether or not one selects the filters option.

Someone may be able to provide a sample where the difference is readily audible, but in my more general tests with music, the differences were not audible. It was easier to find audible differences when downsampling.

  • Woodinville
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #7
I can’t speak to what in the resampling process may mathematically be called a filter, so I will be more specific. CoolEdit/Audition, which we know does very good resampling, provides pre and post filters as an option. If you select some music, such as a CD track, and upsample from 44.1kHz to 96kHz, it can be shown that there is some difference, depending on whether or not one selects the filters option.

Someone may be able to provide a sample where the difference is readily audible, but in my more general tests with music, the differences were not audible. It was easier to find audible differences when downsampling.


Resampling by its nature must absolutely include filtering, so if CooEdit is doing "very good resampling" then it is unquestionably filtering.

If it is not, there will be a great problem.

Try this.

Take a 3.5 kHz sine wave sampled at 8kHz.

resample it.

if you wind up with a nasty 4.5 kHz image, it doesn't do "very good resampling".  If you do not, it filters.
-----
J. D. (jj) Johnston

  • cabbagerat
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #8
I can’t speak to what in the resampling process may mathematically be called a filter, so I will be more specific. CoolEdit/Audition, which we know does very good resampling, provides pre and post filters as an option. If you select some music, such as a CD track, and upsample from 44.1kHz to 96kHz, it can be shown that there is some difference, depending on whether or not one selects the filters option.
I have never used Audition, but the fact is that unless you apply an antialiasing filter (for rate reduction) or an anti-imaging filter (for rate increase), then the process shouldn't be called resampling at all. Without these filters, the "resampling" operation violates the Nyquist theorem. Basically, you end up with samples of something - but not samples of the original signal.
Simulate your radar: http://www.brooker.co.za/fers/

  • eevan
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #9
CoolEdit/Audition, which we know does very good resampling, provides pre and post filters as an option.
That's right, but I'm not sure why they left it as an option? Perhaps to provide us the ability to create false frequencies as an unusual effect.

Quote
3. Drag the Low/High Quality slider to adjust the quality of the sampling conversion.
Higher values retain more high frequencies (they prevent aliasing of higher frequencies to lower ones), but the conversion takes longer. Lower values requires less processing time but result in certain high frequencies being "rolled off," leading to muffled-sounding audio. Usually, values between 100 and 400 are fine for most conversion needs.

Use higher values whenever you downsample a high rate to a low rate. When upsampling, results from lower values sound almost identical to those from higher values.

4. Select Pre/Post Filter to prevent false frequencies from being generated at the low end of the audio spectrum. Select this option for the best results.
If age or weaknes doe prohibyte bloudletting you must use boxing

  • tgoose
  • [*][*][*][*]
filtering, dither, and noiseshaping
Reply #10
Dithering and noise shaping are use together. Dither is noise shaped for best results, mainly so you don’t hear the dithering noise. Dither can be applied at recording time, in the analogue domain prior to the ADC, but is only relevant for 16 bit recording, and probably just about non-existent in professional work these days. Also in amateur and home work I suspect, as I don’t know of any soundcard with the ability to do it.

Sonic Studio, Pyramix, Waves hardware, and the tc6000 will all dither to 24 bits, as well as probably plenty of other pro equipment. In my book there's never a reason not to dither before ADC or before sample rate conversion or lowering bit depth.

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #11
The reason to use or not use dither is ‘does it make a difference?’ Well, it always makes a difference in the amount of noise in the mix; it is added noise, but does it improve anything? If processing at 24 bit, for anything except resampling to a lower bit depth, the only audible difference it can make is -- more noise. The quantization errors are so small that they can’t be heard, so dither helps nothing.

There are a lot of superstitions in audio, but maybe 24 bit integer does need some help. Floating point is definitely superior to integer math for audio processing. I’ve never used any of those dinosaur programs that still process with integer math, so I can’t say from experience. I have heard rumors that mixing and mastering in 24 bit integer clearly sounds worse, so maybe dithering transforms would buy something there. The proof of the pudding is always successful ABX tests; I predict no one will accomplish that with 32 bit floating point transforms, probably not even with test tones. If someone can do it with integer math processing, that just shows they should not be using it.

  • Vitecs
  • [*]
filtering, dither, and noiseshaping
Reply #12
The only other time dither is used is when reducing the bit depth.

Is there any sense to dither+NSH while saving material with the same bit-depth? I have weird example: 16 -> reduce volume on 6.02 dB (shift one bit) -> save 16. We probably end-up with dithering "dithered" material in this case?
  • Last Edit: 03 March, 2008, 07:19:21 AM by Vitecs

  • knutinh
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #13
The reason to use or not use dither is ‘does it make a difference?’ Well, it always makes a difference in the amount of noise in the mix; it is added noise, but does it improve anything? If processing at 24 bit, for anything except resampling to a lower bit depth, the only audible difference it can make is -- more noise. The quantization errors are so small that they can’t be heard, so dither helps nothing.

On the other hand, usually whenever one introduces quantization, you get the choice between correlated distortion, or non-correlated dithering. I think that in cases when quantizing distortion cannot be heard, then typically dithering cannot be heard.

Substituting something that sounds bad with something that sounds less bad seems like a good thing, even if both are at levels where they cannot be heard?

-k

  • pdq
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #14

The only other time dither is used is when reducing the bit depth.

Is there any sense to dither+NSH while saving material with the same bit-depth? I have weird example: 16 -> reduce volume on 6.02 dB (shift one bit) -> save 16. We probably end-up with dithering "dithered" material in this case?

This is in essence a bit depth reduction. Dividing the values by 2 results in a 17 bit value which must be reduced to 16 bits, therefore dithering is called for.

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #15
I seem to have mis-spoke on that. I don’t often think about processing at 16 bits, but it is essentially the same as recording at 16 bit. The quantization errors with 16 bit transforms (such as amplification) are much larger than when using 24 or 32 bit. It is common to dither the transforms to prevention distortion and increase the dynamic range.

If you take most modern pop music and do some such manipulation, the dynamic range is already so low that dither vs non-dither is unlikely to make an audible difference in that respect. Being that the low dynamic range is achieved at very high levels, the quantization errors at high bit depth are unlikely to be audible even without dithering. However, the general rule is to dither.

If one does a few such transforms in sequence, there will soon be enough dither in the mix to self dither any further calculations. Adding more dither then does not reduce distortion, it just adds more noise. Again, good noise shaping can probably ameliorate that. Some programs do not provide for dither options such as depth, type, and shape when preforming transforms. With these, at least, it is easy to verify that the dither quickly becomes audible (i.e. after a few applications) if one uses music with some fairly quiet passages.

  • pdq
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #16
If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?

  • Woodinville
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #17
If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?


Take a look at the "adc" powerpoint deck mentioned above. This is the essence of oversampling using noise shaping.
-----
J. D. (jj) Johnston

  • pdq
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #18

If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?


Take a look at the "adc" powerpoint deck mentioned above. This is the essence of oversampling using noise shaping.

I was actually hoping for a yes/no answer so I wouldn't have to install powerpoint.

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #19
The bit depth is a matter of format. A 16 bit file is a 16 bit file, dithered or not.

In general, one can remove only some dither by low pass filtering; all the dither is not at high frequencies. Also, in general, one is likely to also remove some of the music.

There is a technique, or a set of techniques, of adding dither prior to the ADC that can be digitally subtracted from the data after the ADC. This result in a SNR more or less equal to the original analogue signal instead of the decreased SNR otherwise obtained by dithering. Whether this is actually in use with any of today’s superior  24 bit ADCs, I have no idea. Certainly it isn’t available in any soundcard I ever read about.

  • knutinh
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #20
I am guessing that as long as current ADCs are 24 bit or more, while their "precision" is typically limited to 19-20 bits at best, the noise present at the input is sufficient to avoid quantising distortion?

pdq:
Adding noise prior to quantisation, then lowpass-filtering is essentially "encoding" more amplitude information into the high-frequency parts of the signal. A single ("DC") 32-bit number can easily be represented by a 1-bit stream if sufficient amount of noise is added prior to quantisation and the signal is then lowpassfiltered.

I think that your question cannot be answered by a simple yes/no. When one deals with oversampling, noise-shaping systems, it is probably better to view the overall information (i.e. bitrate) of a system as a property that can be spent for bandwidth or amplitude-precision in different ways, but always limited by the bitrate.

-k
  • Last Edit: 04 March, 2008, 02:28:11 AM by knutinh

filtering, dither, and noiseshaping
Reply #21
If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?
A low-pass filter will reduce the bandwidth of the signal, and thereby increase the total SNR.
The use of a low-pass filter requires modification (DSP) of the original signal data so you will either end up with an increased wordlength (e.g. 24 or 32 bit) or have to re-dither, but that's probably not what you want because the purpose was to get rid of the dither noise.
There's no such thing as a free lunch I'm afraid.

  • Woodinville
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #22


If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?


Take a look at the "adc" powerpoint deck mentioned above. This is the essence of oversampling using noise shaping.

I was actually hoping for a yes/no answer so I wouldn't have to install powerpoint.


Well, the answer isn't that simple. You're better off doing a bit of study.
-----
J. D. (jj) Johnston

  • AndyH-ha
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #23
I don’t know if a "precision" of less than 24 bits is the proper expression. There are lower limits on circuit noise (without cryogenic cooling), so the electronic noise masks any lower level signals. I think it is more correct to say that the ADC itself  is really 24 bits, but the lowest level bits just are not useful in the real world; they are produced and recorded but they can contain only noise.

Whether or not self dithering is responsible for the lack of (audible) quantization distortion when recording with a decent 24 bit soundcard is an interesting question. It is always the case that such errors are essentially irrelevant at higher bit depths. While I can observe the results on screen at higher signal levels when working with 16 bit data, the highest level at which I can hear the distortion is somewhere around -75dB. That is, it is only audible for the least most significant 3 or 4 bits. Operating at 24 bits, the lower  3 or 4 bits are unavailable. Does the “audible” distortion region move down 8 bit under 24 bit operation, or is it just too small to matter, period?

I have no good software that works on 24 bit data (except to open or save as), so I can’t say if it is different. Experimenting on computer generated floating point audio (thus no masking electronic noise included), I find that quantization distortion is irrelevant, even after many transforms. I can’t hear it and I can neither see it nor measure it with any tools I have available.

  • pdq
  • [*][*][*][*][*]
filtering, dither, and noiseshaping
Reply #24



If one takes a file with noise shaped dither and then low-pass filters it to filter out most of the noise introduced by dithering, has one then potentially increased the bit depth of the resulting file?

Take a look at the "adc" powerpoint deck mentioned above. This is the essence of oversampling using noise shaping.

I was actually hoping for a yes/no answer so I wouldn't have to install powerpoint.

Well, the answer isn't that simple. You're better off doing a bit of study.

Okay then let me rephrase the question. Isn't this exactly what the human auditory system does with dithered signals? When you sum a low-level signal in the audible range with a dither signal that is mostly supersonic, doesn't your ear/brain combine the two in such a way as to regenerate the part of the low-level signal that would have been lost to quantization? And isn't this essentially low-pass filtering?