Does lossless have an advantage over lossy formats when using equalization and crossfeed?
post-12479165
Thread Starter
Post #1 of 17

Jon Sonne

Member of the Trade: Lucky Ears
Joined
Dec 9, 2014
Messages
194
Reaction score
80
Joined
Dec 9, 2014
Posts
194
Likes
80
Hi everyone,
 
I was reading the old FLAC vs. 320 Mp3 threads here in the science section and I came across a post by xnor stating the following (link to post): "I personally will take FLAC over MP3 anytime because I'm doing processing like equalization, crossfeeding". I currently lack the knowledge to understand why FLAC (or any other lossless format) would be preferred over Mp3 when using different kinds of processing while listening to music. So does lossless have a clear advantage over lossy formats in this context? And if so, does it relate to the principle in music production where high-resolution music files are used, such as 24-bit recordings, in order get a wider dynamic range, to allow for more room for post processing?
 
I am asking since I mainly listen to music with both equalizer and crossfeed enabled, and most of my library is in 320 CBR (iTunes encoded... Yes I know, not the best choice), and I have recently been doing a few ABX test showing that I could readily distinguish 320 CBR Mp3 from ALAC (although, not enough iterations to tell if the results are significant). I use the equalizer app by audioforge and the TB Isone for crossfeed, FYI. 
 
     Share This Post       
post-12479223
Post #2 of 17

Giupy

100+ Head-Fier
Joined
Aug 9, 2014
Messages
196
Reaction score
38
Joined
Aug 9, 2014
Posts
196
Likes
38
Hey! Here's my two cents on this.

I can understand for equalization because in the compression process information is lost from the original recording. For example during the encoded process the whole spectrum is divided into sections - the number of sections used is determined by the type of encoding. The less sections, the more compressed the sound is, thus the more information is discarded.

Now, the respective sections are have the frequency of their sound analyzed and then discard the sound that is deemed by the encoder as not perceivable to the human ear. The threshold for that is also set by the encoder, but there is no real way to determine a perfect algorithm because everyone hears things differently and the encoder doesn't exactly do a customized compression experience... You could if you wanted to, though.

Anyway, in order to better equalize every frequency, for example every critical band, you need to have the uncompressed sound in order to work on "the whole picture".

Think of it as remastering an old painting. The lossless version is the full painting which just sort of lost its shine due to time, while the lossy version is one with missing sections that have been torn off.

Now, about crossfeed, I don't really get why it would be better to use lossless aside from the obvious difference in overall sound quality. Maybe someone else can help with this bit.
 
 
     Share This Post       
post-12479358
Post #3 of 17

RRod

Headphoneus Supremus
Joined
Aug 25, 2014
Messages
3,371
Reaction score
969
Joined
Aug 25, 2014
Posts
3,371
Likes
969
In theory there could be some audible difference, as the perceptual coder could make different decisions on a file that is already EQed/crossfed versus the original. I constantly run EQ and crossfeed and haven't noticed any difference between lossy and lossless (I use 128 Opus), but I haven't tested that formally; should be easy enough to test, though, if you can hard-code your DSP into the files.
 
     Share This Post       
post-12479411
Post #4 of 17

castleofargh

Sound Science Forum Moderator
Joined
Jul 2, 2011
Messages
9,080
Reaction score
4,416
Joined
Jul 2, 2011
Posts
9,080
Likes
4,416
it would be better to ask xnor somewhere he could answer. but I didn't get his post the way you guys seem to get it. to me he meant that he coded EQ and crossfeed into the file to use on portable DAPs, so he used FLAC as the original file on his computer, to avoid encoding from mp3 to mp3(or aac to aac). as big shot was mentioning using the same itune library at home, I interpret his post that way.
 
no idea if that's what he meant, but that's exactly what I'm doing on the µSD cards for my DAPs ^_^. so my library is in flac except for the already coded stuff I use on my DAPs. plus I change the EQ depending on the IEM so it  would really be a waste of space to have all my library also in mp3.
 
     Share This Post       
post-12479635
Post #5 of 17

gregorio

Headphoneus Supremus
Joined
Feb 14, 2008
Messages
4,058
Reaction score
2,095
Joined
Feb 14, 2008
Posts
4,058
Likes
2,095
  II currently lack the knowledge to understand why FLAC (or any other lossless format) would be preferred over Mp3 when using different kinds of processing while listening to music. [1] So does lossless have a clear advantage over lossy formats in this context? [2] And if so, does it relate to the principle in music production where high-resolution music files are used, such as 24-bit recordings, in order get a wider dynamic range, to allow for more room for post processing?
 
1. No, no clear advantage, just a potential advantage. Let's say you want to boost frequencies with an EQ which were partially masked and may have been discarded/partially discarded by the lossy codec, you could end up with less than an ideal results. As a general rule, it's better to process with a lossless original, although in some/many cases you won't hear any difference.
 
2. That principle you are referring to does NOT exist. We don't use 24bit because it's higher resolution (because it's not, it's the same resolution) and we don't use it "in order to get a wider dynamic range". We use it for recording because 24bit has a huge, unnecessary dynamic range, which means there's a whole lot more of it we can afford to throw away! In other words, when recording, we can afford to record with peak levels of -20dB, essentially throwing that 20dB of dynamic range away, without having to worry about causing noise issues at the other (quiet) end. Processing/mixing is a different issue again and for this we commonly employ significantly more than 24bits but again, nothing which translates to or affects the consumer, even a consumer who is adding EQ or some other DSP.
 
G
 
     Share This Post       
post-12479643
Post #6 of 17

MindsMirror

1000+ Head-Fier
Joined
May 9, 2014
Messages
1,012
Reaction score
251
Joined
May 9, 2014
Posts
1,012
Likes
251
Here is one way of looking at it. Say you have a headphone with a peak in the frequency response around 6KHz and you use an EQ to remove that peak by lowering those frequencies. If you encode that EQed audio with lossy compression, the algorithm may see that those frequencies around 6KHz are low enough level that they can be removed. However when you listen with your peaky headphone, those frequencies are returned to the normal level, and now the encoder has removed information that it probably should not have. So basically, if you use EQ to correct your headphone or playback equipment, it should be applied post-lossy compression. If you use EQ to correct the recording or modify it to your liking, it should be done pre-lossy compression. This way the lossy encoder will receive the audio as it will be perceived, so it's perceptual based algorithms can work as effectively as possible.
 
     Share This Post       
post-12479661
Post #7 of 17

Jon Sonne

Member of the Trade: Lucky Ears
Joined
Dec 9, 2014
Messages
194
Reaction score
80
Joined
Dec 9, 2014
Posts
194
Likes
80
  it would be better to ask xnor somewhere he could answer. but I didn't get his post the way you guys seem to get it. to me he meant that he coded EQ and crossfeed into the file to use on portable DAPs, so he used FLAC as the original file on his computer, to avoid encoding from mp3 to mp3(or aac to aac). as big shot was mentioning using the same itune library at home, I interpret his post that way.
 
no idea if that's what he meant, but that's exactly what I'm doing on the µSD cards for my DAPs ^_^. so my library is in flac except for the already coded stuff I use on my DAPs. plus I change the EQ depending on the IEM so it  would really be a waste of space to have all my library also in mp3.
 
I asked xnor about it on the hydrogen audio forum. Let us see what he thinks. I also think you are right about xnor using it to hardcode EQ and crossfeed into the music files. In that way I can see why he would use FLAC instead of mp3. Actually coding processing into the music files is a really cool idea, how do you apply and save EQ settings on your music files?
 
     Share This Post       
post-12479732
Post #8 of 17

Jon Sonne

Member of the Trade: Lucky Ears
Joined
Dec 9, 2014
Messages
194
Reaction score
80
Joined
Dec 9, 2014
Posts
194
Likes
80
  Here is one way of looking at it. Say you have a headphone with a peak in the frequency response around 6KHz and you use an EQ to remove that peak by lowering those frequencies. If you encode that EQed audio with lossy compression, the algorithm may see that those frequencies around 6KHz are low enough level that they can be removed. However when you listen with your peaky headphone, those frequencies are returned to the normal level, and now the encoder has removed information that it probably should not have. So basically, if you use EQ to correct your headphone or playback equipment, it should be applied post-lossy compression. If you use EQ to correct the recording or modify it to your liking, it should be done pre-lossy compression. This way the lossy encoder will receive the audio as it will be perceived, so it's perceptual based algorithms can work as effectively as possible.
I understand the overall concept, except that if you use EQ to correct the recording or modify it to your liking and do it prior to lossy compression, then wouldn't you run into the same problem mentioned with the algorithm throwing away the wrong data, when you convert this lossless EQ'ed file into a lossy file? The way I see it, the only solution would be to avoid converting files to lossy format and instead listen to the EQ'ed lossless files? 
 
     Share This Post       
post-12481058
Post #9 of 17

Giupy

100+ Head-Fier
Joined
Aug 9, 2014
Messages
196
Reaction score
38
Joined
Aug 9, 2014
Posts
196
Likes
38
  I understand the overall concept, except that if you use EQ to correct the recording or modify it to your liking and do it prior to lossy compression, then wouldn't you run into the same problem mentioned with the algorithm throwing away the wrong data, when you convert this lossless EQ'ed file into a lossy file? The way I see it, the only solution would be to avoid converting files to lossy format and instead listen to the EQ'ed lossless files? 
Why would you EQ before the compression if you knew that you were going to do it anyway? That's counter-productive. If you know that you're going to compress, then just compress first and EQ after. The compression will alter it anyway regardless of being equalized or not. Sure, it may not alter the exact things you wanted to change when equalizing in a manner that you would perceive, but why go through the trouble of doing them in that order anyway?
 
     Share This Post       
post-12481307
Post #10 of 17

castleofargh

Sound Science Forum Moderator
Joined
Jul 2, 2011
Messages
9,080
Reaction score
4,416
Joined
Jul 2, 2011
Posts
9,080
Likes
4,416
 
  it would be better to ask xnor somewhere he could answer. but I didn't get his post the way you guys seem to get it. to me he meant that he coded EQ and crossfeed into the file to use on portable DAPs, so he used FLAC as the original file on his computer, to avoid encoding from mp3 to mp3(or aac to aac). as big shot was mentioning using the same itune library at home, I interpret his post that way.
 
no idea if that's what he meant, but that's exactly what I'm doing on the µSD cards for my DAPs ^_^. so my library is in flac except for the already coded stuff I use on my DAPs. plus I change the EQ depending on the IEM so it  would really be a waste of space to have all my library also in mp3.
 
I asked xnor about it on the hydrogen audio forum. Let us see what he thinks. I also think you are right about xnor using it to hardcode EQ and crossfeed into the music files. In that way I can see why he would use FLAC instead of mp3. Actually coding processing into the music files is a really cool idea, how do you apply and save EQ settings on your music files?

good old foobar let you add VSTs for the conversion. it's not perfect, for a few cases you have to do the setting of the VST when you add it in the processing section, as it wouldn't always just copy whatever is in use when playing music. and on rare occasions, some stuff just won't stick (like I struggled with some phase settings going back to a default value when I tried fooling around, so I had a hard time creating files for an ABX without using a DAW). all in all, no big deal.
personally I go with EQ, crossfeed, replay gain. why replay gain functions aren't on 100% of the manufactured DAPs always amazes me. encoding the actual change in digital volume instead of just the metadata is not a great idea when it comes to SNR and overall HIFI, but no replay gain when shuffling songs is just so annoying to me.
 
     Share This Post       
post-12482165
Post #11 of 17

gregorio

Headphoneus Supremus
Joined
Feb 14, 2008
Messages
4,058
Reaction score
2,095
Joined
Feb 14, 2008
Posts
4,058
Likes
2,095
  I understand the overall concept, except that if you use EQ to correct the recording or modify it to your liking and do it prior to lossy compression, then wouldn't you run into the same problem mentioned with the algorithm throwing away the wrong data, when you convert this lossless EQ'ed file into a lossy file?
 
Not really. You're missing the fact that lossy codecs are specifically designed not to throw away the "wrong data", although obviously as you compress down to lower and lower bit rates more "wrong data" does inevitably get thrown away. Testing the better codecs at 256vbr or 320cbr has demonstrated that it's somewhere between extremely difficult and physically impossible to hear any difference. In other words, extremely little or no "wrong data" is being thrown away. Maybe, just maybe, it's possible to EQ in a way which fools these perceptual lossy codecs into partially (and audibly) changing what you've done but, it's at least unlikely. However, it is potentially worth EQ'ing a lossless file, just to "play it safe".
 
... why replay gain functions aren't on 100% of the manufactured DAPs always amazes me.
 
Ah, replay gain isn't as simple as it sounds. This is because it incorporates (or should incorporate) a measurement for relative loudness, not just peak (or rms) levels. In the TV broadcast world (in many countries) a standard has been agreed and implemented, actually by law in some countries. But so far there has been no such agreement in the music business, so Apple's replay gain may not be (and probably isn't) the same as the replay gain (or equivalent) of any other music or music hardware distributor. Once there is an agreement, then I'm sure we'll see it implemented more ubiquitously both in hardware and in the music recordings themselves, which would kill the "loudness war" stone dead. This *might* be an interesting topic of discussion but is probably OT for this thread.
 
G
 
     Share This Post       
post-12490436
Post #12 of 17

Jon Sonne

Member of the Trade: Lucky Ears
Joined
Dec 9, 2014
Messages
194
Reaction score
80
Joined
Dec 9, 2014
Posts
194
Likes
80

   
Maybe, just maybe, it's possible to EQ in a way which fools these perceptual lossy codecs into partially (and audibly) changing what you've done but, it's at least unlikely. However, it is potentially worth EQ'ing a lossless file, just to "play it safe".
 
Thank you for your input, now I worry a bit less. 
  Why would you EQ before the compression if you knew that you were going to do it anyway? That's counter-productive. If you know that you're going to compress, then just compress first and EQ after. The compression will alter it anyway regardless of being equalized or not. Sure, it may not alter the exact things you wanted to change when equalizing in a manner that you would perceive, but why go through the trouble of doing them in that order anyway?
Is there a way to add EQ (or other VST plug-ins) after compression to lossy when converting files, (if the file is to be encoded with the processing)? I want to make a library with files that have encoded EQ and other VSTs like castleofargh suggested. 
good old foobar let you add VSTs for the conversion.
Thanks for the tip. I am setting up foobar now :) Maybe you can also help answer my question above regarding adding EQ post compression.
 
     Share This Post       
post-12490552
Post #13 of 17

castleofargh

Sound Science Forum Moderator
Joined
Jul 2, 2011
Messages
9,080
Reaction score
4,416
Joined
Jul 2, 2011
Posts
9,080
Likes
4,416
Is there a way to add EQ (or other VST plug-ins) after compression to lossy when converting files
the compression is part of the conversion, it's all in the mp3 codec, so no.
 
     Share This Post       
post-12490651
Post #14 of 17

Jon Sonne

Member of the Trade: Lucky Ears
Joined
Dec 9, 2014
Messages
194
Reaction score
80
Joined
Dec 9, 2014
Posts
194
Likes
80
  the compression is part of the conversion, it's all in the mp3 codec, so no.
Ok thanks. Another (stupid) question: Does it make any sense to do the conversion and processing of lossless to lossless first and then convert the processed lossless files to lossy? Or should I just convert with processing directly from lossless to lossy? 
 
     Share This Post       
post-12491034
Post #15 of 17

MindsMirror

1000+ Head-Fier
Joined
May 9, 2014
Messages
1,012
Reaction score
251
Joined
May 9, 2014
Posts
1,012
Likes
251
In doing a direct lossless to lossy conversion with processing, your computer will automatically do the intermediate step of decoding the original lossless format to PCM. There's no reason for you to do the extra step yourself.
 
A foobar component called Dynamic DSP might interest you. It can specify different DSP chains based on tags. You could essentially use it to do post conversion processing on a per track basis. It doesn't modify the audio so it won't do anything outside of foobar, but if foobar is all you use then that's not a problem.
 
     Share This Post       

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top