cute70.jpg
CuteStudio Ltd.
madeonamac.png
Audio

Fame
Shame
CD clipping
Retro Hi Fi
iTunes
Seedeclip

CD mastering and the music business

What is 'CD Quality'? Are decent CD players worth buying any more?

Visit The CD Hall of Fame and SHAME and the Remaster/Declip CD declipping program

Have you recently invested $1000s or $100s in a top-end CD player? If so, you probably also need SeeDeClip Pro. If you pause for a moment and look at the latest Naim or Usher CD player, you'll notice how much care and engineering goes into these things. The detail of thought and design is simply stunning - surely these must sound absolutely brilliant?

Well, er sometimes not.

cdt-100.jpg

The Shanling CD player

The recording format that CD is based upon has a 44.1kHz sampling rate and a 16bit integer linear magnitude, allowing 65536 discrete levels. If you use them all.. A well mastered CD can still sound pretty good, even though the format is really only 'just good enough' for hi-fi status.

CD sampling rate: 44.1kHz

the CD standard is designed to minimise storage while still giving 20kHz bandwidth. The bandwidth is given just over a 10% guard band for filtering, ending up with 22.05kHz, which is then sampled according to the Nyquist theorem at 44.1kHz.

The 44.1kHz allows the theoretical highest note of 22.05kHz to be produced (see Nyquist theory). This highest note is a suggested sine-wave note, because there is no more information to determine the waveform shape at 22.05kHz - i.e. this is a 'hard limit', there are only 2 sample points, one at the top, the next one at the bottom. The phase of the 22.05kHz tone of course now becomes fixed to the digital sample clock.

If you sample a signal at 22.05kHz that is higher than that frequency, you exceed the Nyquist limit and get aliasing or foldover and the frequency becomes stored as a lower (incorrect) one. So you must absolutely never hit 22.05kHz, and given the 96dB dynamic range of a 16bit CD you need to 'scrub off' 96dB between 20kHz and 22.05kHz - a 2.05kHz band.

This is a very sharp filter and always a compromise, meaning that you always either get low levels of aliasing or a distortion of the 20kHz band. The easiest way to get round this is often to raise the sampling frequency higher and, have a softer analogue filter (like 48kHz DAT tape) but this takes more storage space.

This is one reason why analog can sound better, and why pro-audio generally runs at 48kHz, 96kHz and above, the waveforms are a much more accurate approximation to the music and much easier to build filters for.

However do not believe me, only believe your own ears!. To hear the harsh sound of a CD you need to listen to a modern CD quite loud, and then listen to how your ears are feeling - not the music. If your ears tell you to turn it down and so not like listening to the midrange you have heard the CD signature. Listen to a DVD now, even from a regular film like 'A Life Aquatic' or 'King Kong' and so the same. Chances are the DVD will never make your ears complain. The difference is there if you listen for it, and once you have heard it it's difficult to accept.

References:

CD dynamic range: 96dB

The CD dynamic range covers around 96dB, but the digital scale is linear whereas the ear hears logarithmically. At low sound levels each numerical level of digital output is significant. In fact the lowest resolution is a single bit at 6dB - double the volume!!

Pro-audio uses 24bits, to fit the tune onto a 16bit CD, you lose the least significant 8bits (256 discrete detail levels), which affects the quiet parts most.

CDs sound grainy as you run out of bits

Low bit samples tend to sound grainy (ref1, ref2) and are therefore best avoided. Anything recorded at -48dB on a CD => welcome to 8bit hi-fi.

AmplitudeLevels available
0dB65536
-6dB32768
-12dB16384
-18dB8192
-24dB4096
-30dB2048
-36dB1024
-42dB512
-48dB256
-54dB128
-60dB64
-66dB32
-72dB16
-78dB8
-84dB4
-90dB2
-96dB1
 
In fact if you have a reasonably recorded track at -20dB RMS and a quiet part is -40dB down from that, you are at a total of -60dB or a 64level signal, or 7 bits. The best step being worth 0.14dB, the worst being worth 6dB, so I guess an average resolution of only about 3dB.

For instance, a trailing cymbal sound that goes to -50dB below the normal music level (you can convert between dB and gain/loss here if no calculator is handy) then that sound will use 0.003162 of the DAC scale. If the RMS loudness of the music was -6dB below full scale (0dB) anyway (i.e. the CD is not clipped) then the actual 16bit level will be -56dB or 0.001585 of 65536 levels = 103.87456 levels. This corresponds to slightly less than roughly to 7bits of resolution, in the 24bit world you'd still have almost 15bits at this level.

So compute dB amplitude levels the simple formula: 20 x log(ratio) is used, so to see how loud a digital level of A is compared to B, you simply compute 20 x log(A÷B) as the dB change in audible level.

At the limit of a signal -90dB you have only got one bit of music, the effect is merely digital noise. Analog would probably have a much smaller noise floor of -70dB at best, but the analog signal is gently superimposed upon the noise. Digital quantisation noise has a different and more onjectionable character however. Again, do not take my word for it, listen to some quiet stuff on CD (perhaps some classical music that has not been compressed too much) and see what you can year - after all only your ears count!

Dither

Another 15dB or so of detail can be 'preserved' by using 'dither', at some of the lower frequencies.

Dither is a mastering operation - once it's on the CD the sound is fixed. At 5kHz you'll have 4 samples to pin down that inter-bit level, at 22.05kHz you have 1, and you're relying upon statistical averaging. It's a form of single bit noise that improves the sound on most cases, by statistical averaging. However the very fact that dithering makes an audible difference tells us that 16bits is not enough for true hi-fi.

The Loudness War/Loudness race

The process of making everything sound as loud as possible, all the time.

In the beginning, CD mastering was in it's infancy and the sound was criticized for being harsh, but as filtering improved, dither was used and mastering methods developed around the medium the sound actually got rather good by the early 90's.

Pink Floyd - "In The Flesh", from The Wall.
cd-intheflesh.png
Viewed on Audacity under Linux.

A well mastered CD with good dynamic range. This is one reason why people appreciate 'Floyd! The music has an extra secret dimension, missing in overcompressed CDs of today.

'Hot' masters

With careful mastering a CD can sound very good. In fact Naim have their own label of correctly mastered CDs, and they do sound very good. The problem appears if you want to listen to stuff that has been produced by the big record companies.

Frankly most popular CDs today are faulty. The modern steps to creating a popular song goes like this:
  1. A songwriter writes a brilliant song. Lets face it, some modern songs are extremely well written.
  2. Highly skilled musicians, and often skilled vocalists came together in a recording studio. The studio uses gold-sputtered electret condenser microphones, top of the line mixers, effects, recording technology.
  3. The mix is created by weighting and emphasising the separate musical performances into one artistic whole, checked by some quite reasonable studio monitors.
    Occasionally resampling and compression kills the sound here, but in general the music isn't in too much danger. There are loud bits, quiet bits and recognisable voices.
  4. Down-conversion, scaling from 24bits (16,777,216 levels) to 16bits (65,536 levels), and usually resampling from 192kHz, 96kHz or 48kHz down to 44.1kHz. We can still hear the music at this stage, it's lost quite a bit but with dither the midrange can still be good.
    This is the CD 44.1kHz 16bit standard, it would be nice it the CD was released at this stage.
  5. Over-mastering: Now the CD is compared to the other clipped and compressed CDs, to see if it has reached the final magic CD sound. If it still sounds like music, quite unlike the modern CD, the mix is turned up, the dynamics are compressed even more and the signal is brick-wall limited into clipping. Once the super 'sound killer' compressor-limiter is then kicked into action the music dies, the 96dB range of the CD strangled to about 3dB and half of the potential customers will no longer enjoy it.

The Clipping damage can now be counted - and heard, observation shows about 6dB (1 bit) appears to be cut off at the clipping stage, so we are now down to 15bits (32768 levels) with extra odd-order harmonic clipping artifacts (raising THD with loudness).

Certainly the music sounds harsh and unpleasant to many people, depending upon how the users DACs handle clipping and the CD loses a great deal of it's appeal. It's quite possibly why bass-bins are so popular, when the user boosts the bass he is keeping the volume but ditching a lot of the harsh screechy treble and mid too.

Modern music, created by genius, mastered by muppets.

Garbage - "Can't cry these tears", a typical 'hot' master

cd-tears.png

Viewed on Audacity under Linux.

This track has 3444 clips on the left channel (max 1ms) and 2709 clips on the right channel (max 0.61ms).

Digital Clipping Distortion

However much compression is squeezed in, and consequent life is squeezed out of the humble CD, the medium should still not 'lose' any information. MP3 is a lossy compression - you can never recover the signal. Ogg is much better but is still throws bits away. The problem with copying CD's as a digital medium (claims the record companies) is that the copy is perfect - nothing is lost. Sadly the original if often far from perfect...

Unfortunately for us, most popular songs have a lot of the information thrown away when it was mastered. Most popular songs are mastered so loud that great big lumps of them are lost forever, in digital clipping distortion. Would you expect the waveform to look like this?

Garbage - "Can't cry these tears", segment of clipping distortion on the original CD

cd-tears-seg.png
Viewed on Audacity under Linux.

The large clip is 44 samples long, or 1ms. I like Shirley Manson and her intrepid band of musicians - I'm just using this track as an example. By modern CD terms it's not actually that bad!. However the mastering is still appalling, a clear case of garbage in, garbage out..

Garbage segment with less gain (as it should have been mastered)

cd-tears-seg-normalised.png
Viewed on Audacity under Linux.

Garbage segment with clipping areas reconstructed

cd-tears-seg-declipped.png
Viewed on Audacity under Linux.

It's not hard to appreciate that this track could sound better!

Why digital clipping sounds so bad

Firstly digital clipping is the same as any other clipping, the only difference is that the highest clip frequency is limited to 22.05kHz on a CD, whereas analog can reach 120kHz at times.

  1. The first audio fact you need to be aware of is that all distortion is not created equal, and within this, odd harmonics sound much worse than even ones. Lynne Olsen discusses the effect here.
  2. The Second audio fact is that clipping, or squaring off the waveform creates a great deal of odd harmonics.

Square waves contain all of the odd harmonics from the fundamental (depends on the length of the clip) right up to the highest frequency in the system - on a CD that is 22kHz. For instance a clip of a few points forming a fundamental of 2kHz will create a harmonic at 6kHz, 10kHz and 17kHz.
These harmonics are fleeting and vary on clipping pulse width, but they are there. When listening to a track containing hundreds of clips per second, this forms a random noise field everywhere in the sound spectrum except the lowest notes (unless they beat with other notes to form new tone products, which is quite likely).

As the sound level increases, so does the clipping, and therefore so do the odd order harmonic distortion products, dancing arond the mid and high frequencies as a mass of shifting harmonic distortion that increases steeply with volume.

The increasing noise of the loudness war

The mass of harmonic distortion not only makes MP3s bigger but also makes stuff unpleasant to listen to, because the swirling odd-harmonic noise is objectionable to the human ear. This turns a reasonable Hi-Fi format into a dynamic HF noise generator and the effect can only be one thing - people turn down the volume and switch off.

This effect is parallel to the effect of over-compression, which renders all songs into uniform level blocks of sound, however this distortion is not merely boring and tedious to listen to, it actively works to be switched off (Times Online article). It is this proven scientific hearing phenomena that in the authors opinion is the real cause behind declining CD sales.

Fixing digital clipping distortion with Declip/Remaster

The free digital declipping program is HERE

Listening without clipping...

Most clips in modern CD tracks are very short, and you'd not notice one or two. Thousands however have an effect, and can sound awful. With the Garbage track above, the effect of restoration had a subtle effect, as the sound itself was just sounding rough.
  • Much better stereo image
  • More air to the sound, like you were there
  • Clean transients, smooth vocals


Garbage - "Can't cry these tears", declipped waveform

cd-tears-declipped.png
Viewed on Audacity under Linux.

How bad mastering is killing the music industry

Lots of record companies blame file sharing for killing CD sales, instead of welcoming the free advertising. However:
  • CD sales are actually rising, although prices are stabilising.
  • People share MP3s rather than WAV CD tracks. They do this because MP3s are smaller, and sound the same (sometimes actually better because they may sound less harsh) then the poorly mastered CD. Because of the compression, clipping and expense, the practice of using filler track to pad out the good ones and the lack of jukebox features it is not surprise that people are opting for the MP3s.
  • People master CDs loud so they are noticed on the radio and on jukebox plays. Well the "All Saints" first single "Never Ever" didn't need loudness, and nor do many today. The radio station will of course just level down the sound so the music all comes out at the same volume anyway - so the mastering compression is entirely wasted anyway. It's good for pub jukeboxes, that is all.
    With clipping and without dynamics a CD sounds just like a continuous noise at home, on the Hi-Fi. So the owner just turns it down and doesn't think much of the CD.


The Blacks Eyed Peas monster clip session:

cd-bep-whats-goin.png

Viewed on Audacity under Linux.

So 'What's goin down' in the Black eyed peas mastering stdio? Simple - it's the quality! Unplayable on Hi-Fi, this track even sounds rough in a car!!. It's like that ALL THE WAY THROUGH!!!!! I have to assume this is just a mistake, but the entire album is very very poor. The only way to listen to this CD is if you wear decent earplugs. Or run DeClip first (listen to sample clips below).

'What's goin down' has 87300 clips, the longest of which is 186 samples pinned to the rail. 10.3 seconds is completely missing from that single track, sound lost as the signal waits at the clip rail.
They beat the single maximum clip with a 238 sample one (that's 5.4ms of silence) in "Rock My Shit" as a special UK bonus example of shit mastering - but 'Goin is the overall clear winner. 'Goin has an average clip rate of 270.6Hz.

Listen to it here for yourself:

DeClip restored waveforms - CD digital declip

This is the first odd 30 seconds of this track, declipped with SeeDeClip Pro version finds (it also spots and fixes 1 and 2 point clips)
DeClip ProV2.3-0 written by Graham Wilkinson
 Copyright (c) CuteStudio Ltd. 2004-2008, All Rights Reserved.
 Licensed to Cutestudio February 19, 2008, 10:36 pm
Reading 'bep-shit-original.wav', fmt: 2ch 44100:16, c1, data: len 0m:30.251746s [1334102].
[0] RMS -10.49dB (9789.52/32768.00), peak -0.10dB (32395.00/32768.00)
[1] RMS -11.51dB (8711.18/32768.00), peak -0.10dB (32395.00/32768.00)
Scanning [0] max +ve: max 32394, -ve: -32395
 1785 clips found, max gap 4.717ms [208] at 0m:22.571111s [995386], 191.202ms [8432] lost.
Scanning [1] max +ve: max 32394, -ve: -32395
 928 clips found, max gap 4.195ms [185] at 0m:22.570703s [995368], 82.268ms [3628] lost.
Totals
 2713 clips (44.82Hz), 273.469ms [12060] lost (max gap 4.717ms [208] at 0m:22.571111s [995386])
 threshold 100/min(1.67Hz) vs 2713 (89.68Hz) (track len 0m:30.251746s [1334102]), verdict -> declip
 FIXED: 2233 simple, 251 copied, 0 inflated, 244 shifted, 0 left.
Writing 'bep-shit-declip-pro.wav', fmt, data.

This shows that we had a threshold from peak value of 100 (the whole waveform is 65536) to detect a clip, we found a total of 1135 clips (an average of 18 per second) losing nearly 30ms in total, the longest clip is 208 samples long at 22.571111s into the track.

  • 2233 clips were simple enough to fix by interpolation,
  • 251 were repaired by copying the data from the other channel,
  • 244 clips were so serious (on both channels) that waveform information from time before and after the clip was used to reconstruct the waveform. This prevents the clip and allows the higher frequency stuff (cymbals, vocals etc) to continue through the track, because of course when a signal is clipped, all the music stops.


Examples of before and after (30sec samples, fair use, educational, short clip):
The original signal may cause your DAC to saturate - and so may sound worse than the quieter one anyway. The quieter track is actually only about 2dB quieter, however you need to compare the quieter and declipped to see how a the actual quality is affected, because louder usually sounds initially better, even if it isn't. In particular listen for high freqency noise and smoothness.
  1. Original track section (5.2MB)
  2. Quieter original track section (5.2MB)
  3. Fixed with DeClip Pro V2.3 (5.2MB)



Notes
For listening tests you may like to listen on a computer connected to a hi-fi, or burn all 3 of the above samples to CD and try them out in your CD player, or save them to disk and plug your PC into the nearest Hi-Fi system. The quieter track wil probably sound better than the original track anyway because the DAC can no longer saturate, but is supplied so you can listen to both quieter (before declip) and after declip at exactly the same volume.

If you have the track, please try it. You'll find that the vocals now sound clear, the bass is well defined and stops disrupting the midrange, and the treble is sweet and unaffected by the bass now. You'll find yourself listening to the track, and the music - instead of wondering what that coarse thashing sound is (it was actually the tops of the squared off clipped signal).

The waveform change from the original to the declipped version is seen here:
Rs 1 Pre (298.2kB)
Rs 1 Pre (298.2kB)
 

It's not Hi-Fi of course, but it's a lot better that the distorted track sold by the record company.
Try DeClip out for yourself, it could be the first time you've actually listened to your CDs without large amounts of digital clipping distortion on all the loud parts. This song was missing 5seconds of sound, clipped out.

The Halls of CD mastering heaven and hell


Digital clipping and mastering links

Copyright © 2007-2009, CuteStudio Ltd.
Page generated in 0.420s, Powered by Silk V1.1-1 from Cutestudio