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: to dither or not in WaveGain (Read 4837 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

to dither or not in WaveGain

I am re-ripping all my CD's in AAC/192 to play on my iPod. Apple's idea of Replay Gain (Sound Check) is screwed, and I don't trust ripping accuracy in iTunes. So I'm ripping using PlexTools and then using WaveGain (with Speek's excellent frontend) on the WAV files in album mode, before dropping the WAV's into iTunes for encoding.

In the WaveGain frontend, there is an option for dithering, which is currently disabled. Should I enable dithering when I WaveGain, and if so what setting should I use? Will it make an audible difference when playing back the tracks on an iPod using Sennheiser MX300 earbuds, or is it a waste of time?

The AAC tracks are only used on my iPod, all my home listening (through my PC home entertainment system) is from MPC insane encoding.

to dither or not in WaveGain

Reply #1
The "WaveGain vs. MP3Gain" thread should answer all your questions and more.

I'll add it to the FAQ soon.
"To understand me, you'll have to swallow a world." Or maybe your words.

to dither or not in WaveGain

Reply #2
OK, I read through the entire 5 pages of lengthy discussion, but I still don't have a clear answer to my question regarding dithering during WaveGaining. It seems most of the discussion was in relation to the affect on bitrate and filesize and sfb21 in MP3 files.

I'l re-read it all again today and see if I can find the right grain of sand...


to dither or not in WaveGain

Reply #4
OK... <WARNING> I did some very subjective listening tests using my iPod. First, I decoded two FLAC tracks to WAV that I know very well and are also very well recorded (Rush - YYZ and Limelight). Next, I WaveGained the files using:

- 16 bit, no dither
- 16 bit, dither, no noise shaping
- 16 bit, dither, light noise shaping

I then encoded the resulting six WAVs in iTunes 4.1.1.54 to AAC, 192kbps. I created a playlist and dumped the files to my iPod. I listened using Sennheiser MX300 earbuds, since that is what I use everyday with the iPod.

I have to say the difference between no dither and dither, with or without noise shaping, is quite noticeable. Especially when listening to the "bells" at the start of YYZ. With dithering, they sounded clearer and more open than without dither. The guitars in Limelight sounded better, hard to describe, but definitely better. I could not really hear any difference between dither without noise shaping and with light noise shaping. Dynamics also seemed slightly improved on the dithered tracks.

I may load some of the test tracks into Cool Edit and take a look, but I'm pretty tired at the moment, so not tonight. I would also like to do an ABX test in the near future. I will difinitely use dither when WaveGaining my tracks prior to AAC encoding.

OK, end of my violation of the TOS for tonight...

to dither or not in WaveGain

Reply #5
Quote
I have to say the difference between no dither and dither, with or without noise shaping, is quite noticeable. Especially when listening to the "bells" at the start of YYZ. With dithering, they sounded clearer and more open than without dither. The guitars in Limelight sounded better, hard to describe, but definitely better. I could not really hear any difference between dither without noise shaping and with light noise shaping. Dynamics also seemed slightly improved on the dithered tracks.

I've alway used dither w/ medium noise-shaping.  I never did ABX testing or even subjective comparisons, though, but I've always been curious to know what such results would be.  And I haven't seen a sound quality comparison between the dither/no-dither/NS-modes, either.  The thread that dev0 linked is a great resource for the analysis of exactly how "lossy" WaveGain is, how it's treated by using dither, and it's relationship with SFB21 and --scale in LAME.

But I'd like to know as well if dither with medium noise shaping is what should be used.  I think it's the concensus that dither is good when modifying gain, but which noise-shaping to use I've never seen an answer for specifically.  And I think I have a decent understanding of dither, but noise-shaping I know nothing about.

If no one else posts ABX results using each of the noise-shaping modes, I'll try to find the time to do it myself.  (I'll have to struggle to find the time before the end of the year. though.)

to dither or not in WaveGain

Reply #6
It can be unhelpful to use noise-shaped dither when you're going to lossy encode the file. The extra high frequency noise can waste bits. (Speeking from a theoretical stand-point, rather than practical experience!).

Normal dither, at the correct level, is a good choice.

Cheers,
David.

to dither or not in WaveGain

Reply #7
Quote
It can be unhelpful to use noise-shaped dither when you're going to lossy encode the file. The extra high frequency noise can waste bits. (Speeking from a theoretical stand-point, rather than practical experience!).

Normal dither, at the correct level, is a good choice.

Thanks for the reply, David.

How about if I'm encoding to FLAC?

How will the different types of noise-shaping affect sound quality, or would any differences likely be inaudible?

And would noise-shaped dither significantly affect bitrates for lossless encoding compared to normal (no-NS) dither?  (I could actually test this one myself, but it'll be later today......fading away......must....sleep...)

to dither or not in WaveGain

Reply #8
In theory, noise shaped dither will give you a lower noise floor than flat dither, so it's a good thing for lossless.

Not sure about the lossless bitrate - it could go either way - try it and see!


Re: lossy...

I've just remembered the contents of those threads, and why they do answer the question: With lossy, it's better to use wavgain to calculate the gain change value, but use --scale in the encoder (if the encoder --scales using floating point) to apply the gain change. No dither (noise), and no rounding (distortion). Best of both worlds! Use 24-bit decoding (then dither if you have a 16-bit sound card) on playback to maintain the dynamic range (if the lossy codec maintained it!).

Cheers,
David.

to dither or not in WaveGain

Reply #9
Quote
Next, I WaveGained the files using:

- 16 bit, no dither
- 16 bit, dither, no noise shaping
- 16 bit, dither, light noise shaping

...

I have to say the difference between no dither and dither, with or without noise shaping, is quite noticeable.

It's quite possible that this was just placebo effect. Dither in 16-bit audio makes a tiny difference in practice, hardly noticeable under usual listening conditions. In order to be sure, you can use fileABX utility ( http://www.kikeg.arrakis.es/fileabx ) in order to generate blind copies of the files with and without dither, and try to identify them (pass an ABX test) with your iPod.

to dither or not in WaveGain

Reply #10
KikeG

Yes, I know it is very possible it is placebo, which is why I mentioned I'd like to ABX test. I just don't know when I'll have the time in the near future. Real Life ™, you know.

2Bdecided

I understand what you are saying about the high frequency noise increasing the demand for bits in the upper frequencies. But, I noticed a strange thing when I checked the file sizes of all the test tracks; the 3 versions of each track were identical in size after encoding in AAC. Strange, I had expected to have some variation in file size. I'll have to re-run the test and generate some new test files, since I deleted them already. It's what I get for working while I was so tired...

to dither or not in WaveGain

Reply #11
Quote
But, I noticed a strange thing when I checked the file sizes of all the test tracks; the 3 versions of each track were identical in size after encoding in AAC. Strange, I had expected to have some variation in file size.

I think that would be expected with CBR (in reference to your first post about AAC/192)
"Something bothering you, Mister Spock?"

to dither or not in WaveGain

Reply #12
[span style='font-size:11pt;line-height:100%']The Effects of WaveGain with Dither/Noise Shaping on Compression Efficiency with FLAC[/span]

[span style='font-size:10pt;line-height:100%']--- Software and Settings Used[/span]

Exact Audio Copy v0.95prebeta3 (secure mode)
WaveGain v1.0.3 (89.0dB nominal, dither on, 16-bit signed PCM, album gain)
FLAC v1.1.0 (compression level: 8, defaults for all other settings)
Tag&Rename v3.0(final) (to show nominal bitrates of FLAC files for reference)

[span style='font-size:10pt;line-height:100%']--- Test Subject[/span]

The Beatles ~ Rubber Soul (1965)

Recommended Album Gain: -3.25dB (Scale: 0.6879)

I did WaveGain in each group on all 14 tracks on the album, but I only subsequently encoded the first 5 tracks into FLAC from each results set in the interest of brevity.  Note that dither was used in all WaveGained test groups.

[span style='font-size:10pt;line-height:100%']--- Resulting File Sizes[/span]

Original WAV Files
25,886KB --- 01 Drive My Car.wav
21,607KB --- 02 Norwegian Wood (This Bird Has Flown).wav
34,902KB --- 03 You Won't See Me.wav
28,305KB --- 04 Nowhere Man.wav
24,003KB --- 05 Think For Yourself.wav

(..and of course, the filesizes of WaveGained files using different noise-shaping were all the same as the original WAVs.)

FLAC Compression without WaveGain
[span style='font-size:7pt;line-height:100%']Filesize --- Compression Ratio --- Nominal Bitrate --- Track[/span]
15,504KB --- 59.893% --- 846kbps --- 01 Drive My Car.flac
12,583KB --- 58.236% --- 824kbps --- 02 Norwegian Wood (This Bird Has Flown).flac
34,902KB --- 62.618% --- 886kbps --- 03 You Won't See Me.flac
28,305KB --- 61.569% --- 870kbps --- 04 Nowhere Man.flac
24,003KB --- 62.750% --- 887kbps --- 05 Think For Yourself.flac
Average Bitrate of All Five tracks: 862.6kbps
Average Compression Rate of All Five Tracks: 61.013%

FLAC Compression after WaveGain (Dither, No Noise-Shaping)
[span style='font-size:7pt;line-height:100%']Filesize --- Compression Ratio --- Nominal Bitrate --- Track[/span]
14,732KB --- 56.911% --- 804kbps --- 01 Drive My Car.flac
11,913KB --- 55.135% --- 780kbps --- 02 Norwegian Wood (This Bird Has Flown).flac
20,779KB --- 59.535% --- 842kbps --- 03 You Won't See Me.flac
16,529KB --- 58.396% --- 825kbps --- 04 Nowhere Man.flac
14,293KB --- 59.547% --- 842kbps --- 05 Think For Yourself.flac
Average Bitrate of All Five tracks: 818.6kbps
Average Compression Rate of All Five Tracks: 57.905%

FLAC Compression after WaveGain (Dither, Light Noise-Shaping)
[span style='font-size:7pt;line-height:100%']Filesize --- Compression Ratio --- Nominal Bitrate --- Track[/span]
14,765KB --- 57.039% --- 806kbps --- 01 Drive My Car.flac
11,932KB --- 55.223% --- 781kbps --- 02 Norwegian Wood (This Bird Has Flown).flac
20,813KB --- 59.633% --- 844kbps --- 03 You Won't See Me.flac
16,549KB --- 58.467% --- 826kbps --- 04 Nowhere Man.flac
14,306KB --- 59.601% --- 843kbps --- 05 Think For Yourself.flac
Average Bitrate of All Five tracks: 820.0kbps
Average Compression Rate of All Five Tracks: 57.993%

FLAC Compression after WaveGain (Dither, Medium Noise-Shaping)
[span style='font-size:7pt;line-height:100%']Filesize --- Compression Ratio --- Nominal Bitrate --- Track[/span]
14,872KB --- 57.452% --- 812kbps --- 01 Drive My Car.flac
12,004KB --- 55.556% --- 786kbps --- 02 Norwegian Wood (This Bird Has Flown).flac
20,917KB --- 59.931% --- 848kbps --- 03 You Won't See Me.flac
16,630KB --- 58.753% --- 830kbps --- 04 Nowhere Man.flac
14,355KB --- 59.805% --- 846kbps --- 05 Think For Yourself.flac
Average Bitrate of All Five tracks: 824.4kbps
Average Compression Rate of All Five Tracks: 58.299%

FLAC Compression after WaveGain (Dither, Heavy Noise-Shaping)
[span style='font-size:7pt;line-height:100%']Filesize --- Compression Ratio --- Nominal Bitrate --- Track[/span]
15,383KB --- 59.426% --- 840kbps --- 01 Drive My Car.flac
12,428KB --- 57.518% --- 814kbps --- 02 Norwegian Wood (This Bird Has Flown).flac
21,517KB --- 61.650% --- 872kbps --- 03 You Won't See Me.flac
17,196KB --- 60.750% --- 858kbps --- 04 Nowhere Man.flac
14,748KB --- 61.442% --- 869kbps --- 05 Think For Yourself.flac
Average Bitrate of All Five tracks: 850.6kbps
Average Compression Rate of All Five Tracks: 60.157%

[span style='font-size:10pt;line-height:100%']--- Comparative Analysis[/span]

Comparing the baseline of FLAC compression (-8) without using WaveGain at all to...
> WaveGain with Dither, No Noise-Shaping = -44.0kbps (nominal), -3.108% compression ratio
> WaveGain with Dither, Light Noise-Shaping = -42.6kbps (nominal), -3.020% compression ratio
> WaveGain with Dither, Medium Noise-Shaping = -38.2kbps (nominal), -2.714% compression ratio
> WaveGain with Dither, Heavy Noise-Shaping = -12.0kbps (nominal), -0.856% compression ratio

Regarding sound quality variances, I have not done ABX testing of these outputs, but no audible problems "jumped out at me" with casual listening of all the encoded tracks.

The difference in compression ratios between no-NS, light-NS and medium-NS seem marginal (<0.5%), but the step between using medium-NS and heavy-NS is more significant, with a difference in compression rate of close to 2%.  Hence, if the use of noise-shaped dither with WaveGain prior to lossless compression is recommended, and there are not audible sound quality differences between light, medium and heavy noise-shaping, then dither with light noise-shaping can be considered the most efficient WaveGain mode to use for maximum compression using FLAC with the music tested.  I would think these results would carry over to any not-overly-compressed older rock&roll masterings.  Efficiency of noise-shaped dither on newer and more harshly compressed rock music, or on other music types would likely have to be determined seperately.

I've always personally used WaveGain with dither and medium noise-shaping, so rather than re-ripping/encoding what I've already done, and since the difference in compression efficiency between light and medium is only marginal, I think I'll just stick with medium noise-shaping for my own use.

Now, if anyone else can post (ABX) test results of a sound quality analysis, then perhaps we could associate those results with these compression efficiency results to determine a "recommended noise-shaping method" to use with WaveGain, based on certain music types anyway.  I can do a sound quality test myself, but it may be a while before I have enough time (and before I can get rid of the migraine I've had for days now).  Plus my ears are not well artifact-trained, so someone with "better ears" than mine should do a sound quality test anyway.

to dither or not in WaveGain

Reply #13
ScorLibran,

it's great that you tested this properly!


There's just one more thing to say, about that particular album. The original doesn't have noise shaping (and is from analogue masters) so its noise, at best, is ~90dB down from digital full scale, and will actually be much higher than this.

The album gain of -3.5dB would not lose any information from such an album (even without dithering, except during any digital fades, if present), and dithering would not really "add" perceptable noise, because the dither noise would be swamped by the noise on the recording.

So, in terms of quality, I can't imagine there would be any difference between the options.


Where noise shaped dither may (theoretically) be useful is where the original recording has a low noise floor (e.g. it is a digital recording, and/or it uses noise shaped dither) and/or the ReplayGain value is very negative.

If the noise floor of the original recording will be pushed below the noise floor of the replay gained version, using noise shaping can keep the noise floor after wavgain below the noise floor before wavgain. In practice, it's rare to find a CD with such a low noise floor, and it typically wouldn't have a very negative ReplayGain value anyway.

What I'm trying to say is that it's not really an issue with pop music!

Cheers,
David.