Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
Different Genre Compression Ratios - Why Is Softer Better?
post Jan 10 2014, 00:42
Post #1

Group: Members
Posts: 2
Joined: 9-January 14
Member No.: 113916

I'm pretty sure this has been discussed before, but different genres of music I have consistently compress better or worse than other genres, across a variety of codecs. Softer music in general compresses much better than harder music, on spectrum of piano on the soft end and metal on the hard end. I tried three different codecs (FLAC, wavpack, and Monkey's Audio), three genres (voice and a piano, soft rock, metal), and four samples per genre. I started with a bunch of wav files in my directory and ran the following commands (note that MAC is through wine):

flac -8 *.wav
wavpack -h *.wav
for i in *.wav; do MAC "$i" "$(basename "$i" .wav).ape" -c5000; done

To print the ratios, I ran
for type in {flac,ape,wv}; do for i in *.$type; do echo "$i" $(echo "scale=3;" "$(du -b "$i" | head -c 8 | xargs)" "/" "$(du -b "$(basename "$i" .$type ).wav" | head -c 8 | xargs)" | bc); done; done

Try it yourself, it prints the ratios of the files, as long as you kept the wav files.

I noticed that every time, the voice and piano stuff compressed in the 0.3 range, the soft rock compressed in the 0.5 and 0.6 range, and heavy metal compressed in 0.7 and 0.8 range. I've noticed this as a general rule with FLACs in my collection, so I decided to make my test more scientific. However, it seems that even with the same artist, if the song is softer, it compresses better. Look at a very versatile band: Pink Floyd. Let's see how some softer songs compress versus harder songs:

Vera.flac .417
Empty Spaces.flac .436
Echoes.flac .467
Atom Heart Mother Suite.flac .506
Set the Controls for the Heart of the Sun.flac .508
Eclipse.flac .519
Wearing The Inside Out.flac .531
Wish You Were Here.flac .532
Another Brick in the Wall, Part 2.flac .546
In The Flesh.flac .547
Waiting For The Worms.flac .557
Brain Damage.flac .576
Have a Cigar.flac .583
What Do You Want From Me.flac .642

Everything from "Wish You Were Here" upward is softer and everything from "Another Brick in the Wall, Part 2" downward is harder. "What Do You Want From Me" has a ratio far above everything else and it's one of Pink Floyd's harder songs. Same goes for "Have a Cigar." "Echoes," "Empty Spaces" and "Vera" are definitely on the softer side. The notable exceptions are "Brain Damage" and "Eclipse" which look like they should be swapped, but no heuristic argument works 100 percent of the time.

So, it's clear that softer songs compress better, but why is this? Can someone give me an objective explanation?
Go to the top of the page
+Quote Post
post Jan 10 2014, 00:44
Post #2

Group: Members
Posts: 4844
Joined: 2-September 02
Member No.: 3264

Lots of zeros mean good compression.
Go to the top of the page
+Quote Post
post Jan 10 2014, 05:34
Post #3

Group: Members
Posts: 206
Joined: 22-July 12
Member No.: 101637

Simply put, softer music generally has less digital information than harder music. Thus it's easier to compress more tightly.
Go to the top of the page
+Quote Post
post Jan 10 2014, 06:47
Post #4

Group: Members
Posts: 755
Joined: 12-May 06
From: Colorado, USA
Member No.: 30694

When it's LPCM encoded (WAV/AIFF), the audio data takes up a specific amount of space per unit of play timeóno more, no less. But when it's FLAC or MPEG encoded, the data for quiet, tonal music is less complex, so it compresses more compactly, and it may also just naturally take up less space than the audio data for loud, noisy music (noise & noise-like signal being distortion, snare hits, reverb, background hiss, etc.). Different compression codecs work in different ways, but they are similar in this regard; just bringing the volume down can improve compression. Also, the closer to mono it is, the less space it needs.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 23rd July 2014 - 10:06