Compression Algorithms (FLAC, WAV)

Posted by: allhifi on 02 December 2017

A few weeks back, here on the Naim forum, I asked about my discovery of WAV files sounded much better than FLAC copies (dBpoweramp RECORD, Foobar 200 PLAYBACK).

A wave (oh -no pun) of information was brought forward. As I recently reintroduced myself to copying files onto HDD, is when I noted some rather startling realizations -regarding file format and sound quality. And so I inquired as to 'why'. I thank all who responded.    

As I continue to be a general interest "hi-fi'er -and perhaps discover more about (copying/transferring CD's) we ultimately stumble upon more and more information. One of those times, came by way of one of the various 'audio software' providers.

For example, regarding compression techniques/formula's, the following has been noted:  

5.7 Sparse Sampling of Signals with Finite Rate of Innovation

We don’t need to use standard sampling kernels (Sinc-Functions) to sample and reconstruct a signal.

Bandwidth limited signals, which are a pre-condition for correct sampling (pls. see Chapter 5.6) are of finite rate of innovation.

If a signal has a special property with an even lower degree of innovation then it would be possible to use sampling kernels of a special type like B-Splines (e.g. 0.5; 1; 0.5 for a linear interpolation) instead of E-Splines (exponential kernels).

For audio compression, we could simplify the case further because segments of music can be considered as piecewise super positioned sinusoidal signals plus noise.

In general, it would be possible to approximate these segments with polynomials or indirect as wavelets (https://en.wikipedia.org/wiki/Wavelet) which would allow us to just transmit the polynomial or the low-pass wavelet coefficients to implement a linear compression.

BUT, there is noise which is part of the music!

Even robust sparse sampling algorithms are only able to reduce the residual error in the presence of noise and therefore we lose valuable information to reconstruct the time domain signal.

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- 

Can this somehow be related to FLAC vs. WAV  comparisons?

From what I'm able to ascertain,  it appears previously (or currently) believed compressions scheme (lossless/lossy) may NOT be the exact  (sound quality) replication of for example, a native WAVE file.  Naturally there are various (and compounding) factors influencing our SQ perceptions.

Indeed, it has proven foolish to discredit what more than a few have consistently stated/argued  via subjective SQ Interpretations.  Although some may have been tinkled pink with CD's introduction in 1982, I assure you, sensitive (critical) listener's were horrified; the very dark days of early digital replay was nothing short of an abysmal attempt at replicating recorded music naturally, authentically, enjoyably. 

 

If it was not for vocal opponents, why would any further research have been undertaken (that ultimately resulted in newly-discovered phenomena to be uncovered, addressed, and corrected) ?  To appease the tinkled-pink crowd ? To satisfy those thrilled by early digital CD sound ? Of course, no to all; it was undertaken to learn, discover and implement techniques that proved critical to natural-sounding music replay.

Further research shall surely  present some interesting findings moving forward. Such 'discoveries' are always propelled by the simple premise known as "the human experience". Notoriously difficult to put in words.  And, (thus far) even more difficult to quantify.

 peter jasz 

 

Posted on: 02 December 2017 by Innocent Bystander

Here we go again. You started a thread on this subject a week ago, to which I responded:

It has all been explained to you before: flac IS bit perfect, Full stop. Period. End.

You have produced no evidence whatsoever to indicate to the contrary. DId you try what I suggested and listen to wav, then use dBPoweramp to convert that wav file to flac, and then reconvert back to wav, and compare that with the original wav file? (Of course blind listening to avoid bias)? If not, why do you persist with this hypothesis that flac degrades the data, rather than accept that the difference heard is purely due tothe renderer, as numerous people on the forum have explained?

You still haven’t responded to that....

Posted on: 02 December 2017 by jon h

I dont know what you are smoking, but can i have some it please?

Posted on: 02 December 2017 by Huge

No, the theoretical discussion posted in section 5.7 is NOT related to FLAC / WAVE comparison.  That discussion relates to approximation of analogue signals by lossy compression methods.

So no point in discussing it in respect of FLAC.

I have also previously posted my response to your aspersions about my (and many other peoples) opinions about CD replay at its introduction (and for the record, no, you're NOT the only person who realised that the players were not perfect).


Lastly, you still owe me and all the rest of the people on this site a FULL apology for your previous insults.

Posted on: 02 December 2017 by Simon-in-Suffolk

FLAC and WAV resolve to the same thing.... this has absolutely  nothing to with sample theory and sinc functions (which model in a discrete data stream infinitely small points in time with infinite energy). You could encode machine code that is executed that has been stored/transmitted in either FLAC or WAV...  you really are mixing two unrelated things....

Posted on: 02 December 2017 by Huge
jon honeyball posted:

I dont know what you are smoking, but can i have some it please?

I wouldn't...  it seems to be quite toxic! 

Posted on: 02 December 2017 by allhifi

Hmmm. Yes, I better check the ingredients in those 'smokes' !

pj

Posted on: 03 December 2017 by Mike-B

Holy Herb aside:   Looking back through publications & forum inputs from around www, I don't believe there is a definitive answer as to why - or even if - WAV, FLAC or any other lossless PCM file sounds different from another. I believe Naim said at one time that WAV has a lower noise floor on their players than with FLAC,  something similar was put out by MinimServer.   But I'm not sure this can be said as true with all as the subject is full of uncontrolled variables; different DSP, DAC, software implementation & hardware configuration across the makes & models;  then add the variables of amplifiers, cables, speakers, headphones. Other factors such as room acoustics & music genre are part of the equation, then finally the infinitely variable of the human ear/brain function.  All this means a definitive analysis is impossible. I know what sounds better in my system, and that's as far as I need to go.

Posted on: 03 December 2017 by Eoink

This may already be obvious to you all hifi, but to try to make clear the confusion in the area, there are two different “compressions” being talked about. The article you quoted is about taking the analogue music system and encoding it into 1s and 0s. So we could imagine a very short burst of music that was digitised to 00000000. Both FLAC and WAV will,take that sample (ignoring padding  to minimum length for the sake of the example), apply a wrapper to it and tags. WAV being uncompressed will store the 00000000 as written, FLAC being a compressed format will note the repetition and compress it. The FLAC algorithms are lossless compression (think zip on PCs), so  when it’s extracted and presented to the player the sample will again be 00000000. 

Again apologies if this has been bleeding obvious to you and you feel'patronised, that wasn’t  my intention, just knowing that in the IT game we use the same word in different contexts I thought I’d try to make it explicit what was meant.

Then moving in from that, back on Mike’s point above, it isn’t clear why people hear differences. The basic point about noise floor is that if the FLAC decompression is done on the streamer, then it’s working harder and the noise floor raises, but as Mike suggests there are many many more factors. 

Personally I went for WAV as the price difference between a 2TB and a 4TB NAS was negligible (in the sale),so I didn’t see the point of using a compressed format which might make a difference. 

Posted on: 03 December 2017 by Simon-in-Suffolk
Mike-B posted:

Holy Herb aside:   Looking back through publications & forum inputs from around www, I don't believe there is a definitive answer as to why - or even if - WAV, FLAC or any other lossless PCM file sounds different from another. I believe Naim said at one time that WAV has a lower noise floor on their players than with FLAC,  something similar was put out by MinimServer.   

Hi Mike, I am not sure how definite you can be (processing noise from wav and FLAC decoding) as the sound differences will vary from implementation to implementation. Certainly algorithmic switching noise into ground plane, powerline and even EM interaction will produce system coupling .... and cross talk is well defined in system design and theory. When I was at university as undergraduate engineer  I had a whole ‘systems’ module on such matters... the maths got quite interesting... whether it’s like rocket science or not, I couldn’t tell you... but was certainly intuitive to me and played a part in my final disitation. This area goes well beyond Hi-Fi and home audio.

In recently talking with the somewhat renown Mr Watts recently, he was also rather mindful to algorithmic processing noise signatures and cross talk... it was quite jinteresting.

Posted on: 03 December 2017 by Mike-B
Simon-in-Suffolk posted:

In recently talking with the somewhat renown Mr Watts recently, he was also rather mindful to algorithmic processing noise signatures and cross talk... it was quite jinteresting.

 'jinteresting' a new word has been struck. Bottom line is there is no definitive answer to the premise, if there was then everyone would agree, the forum would have nothing to discuss & all the brands would work to a common design standard & we would be at risk of everything sounding the same;  that is until the human ear/brain interface & its inherently dodgy OS is brought into the equation.               

Posted on: 03 December 2017 by jon h
Mike-B posted:

I believe Naim said at one time that WAV has a lower noise floor on their players than with FLAC,  something similar was put out by MinimServer.   

Then they can show me a graph from an Audio Precision or Prism analyser demonstrating just this then, cant they? Oh, wait...

Posted on: 03 December 2017 by Huge

Mike, Jon,

I'm with Simon on this.  The maths of coupling effects is well understood, even if it does get a little complex (pun intended  ) when you simultaneously look at both the frequency and amplitude domains (necessary for analysis).  However, when dealing with systems involving a larger amount of digital processing that can be affected by statistical variance (such as those that can occur through variances in the input feed timing that arise through network operation), the exact nature of the signal being coupled into other parts of the system becomes more difficult to predict exactly, hence the result of the coupling becomes less deterministic.

To measure these effects with certainty you are most likely to need to look at the internal circuitry of a product, as the output signal is heavily modified by the subsequent analogue amplification, and hence there may be considerable uncertainty when trying to separate out the different root causes of the noise signals detected.

Posted on: 03 December 2017 by Mike-B

Leave me out Huge,  I’m not with anyone, as I said before, there is no difinitive answer,  only hypothesis   

Posted on: 03 December 2017 by Huge

I'm not going to leave you out, it's winter and you'd get cold!

See, I even think about your welfare! 

Posted on: 03 December 2017 by Simon-in-Suffolk
Mike-B posted:
Simon-in-Suffolk posted:

In recently talking with the somewhat renown Mr Watts recently, he was also rather mindful to algorithmic processing noise signatures and cross talk... it was quite jinteresting.

 'jinteresting' a new word has been struck. Bottom line is there is no definitive answer to the premise, if there was then everyone would agree, the forum would have nothing to discuss & all the brands would work to a common design standard & we would be at risk of everything sounding the same;  that is until the human ear/brain interface & its inherently dodgy OS is brought into the equation.               

I agree on the forum it’s good seemingly for some to go around and around, in the real world it’s not much of an issue or mysterythank goodness... I guess if it was there would be many of us out of a job....

Talking of which I was looking into the intricacies of DSL vectoring the other day, which uses this phenomenon to get more throughput from densely packed twisted copper pairs of varying power densities by predicting algorithmic cross talk and compensating... fascinating stuff... got to hand it to the scientist and engineers on that one.. incredible engineering.

Posted on: 03 December 2017 by Mike-B

............  cold !!!  cold !!!,  not today Huge,  I'm chief chef, commi, cook & bottle washer today & it ain't 'arf 'ot in the kitchen.   Talking of which,  its time to baste the long low & slow shoulder of lamb, then crank up the other oven for my prize winning crispy roast spuds.      That's all something that does have a definitive answer - delectably delicious.   

Posted on: 03 December 2017 by Simon-in-Suffolk
jon honeyball posted:
Mike-B posted:

I believe Naim said at one time that WAV has a lower noise floor on their players than with FLAC,  something similar was put out by MinimServer.   

Then they can show me a graph from an Audio Precision or Prism analyser demonstrating just this then, cant they? Oh, wait...

Jon, it’s a shame you are not nearby we could have a pint or two and I could share my charts with you (I have shared with Naim) , as I undertook  some personal investigation in this area. My controlled variable was inter frame timing on the steamer Ethernet subsystem of the NDX. I found a correlation between interframe timing variability and specific subtle sound signatures.

This is I believe why some people find a preference for the sound signature of certain media servers/NAS/operating systems.

Needless to say, just as with FLAC and WAV, by following my basic closed systems feedback principles, by physically decoupling the streamer board from the DAC, it appeared to lessen the effect. Therefore I concluded what I was experiencing with interframe timing (and TCP processing) was not dissimilar to the effect of WAV and FLAC decoding.

The output from what I use as my spectrum analyzer (tuned RF bandscope) is too noisy from other extraneous noise sources here... and in my case was not a useful tool in pursuing this... so I used other techniques.

Posted on: 03 December 2017 by jon h

All interesting stuff, SIS, but modern audio analysers can go down to some -120dB or more, so spotting changes to noise floor (as we used to see due to different dither algorithms on the -96dB noise floor ramping up and down due to modulation) should be easy to see. 

Yet noone has come up with any proofs. I have the full Prism system,  which has SPDIF in/out on optical and wired, so i might give it a go on my Core (not much else I can do with it otherwise at the moment). I know Naim have AP, which has an equal or even lower noise floor and similar IO.

Posted on: 03 December 2017 by jon h

And huntingdon is not far from suffolk :-)

Posted on: 03 December 2017 by Simon-in-Suffolk

give me a shout when you are planning to be over this way Jon - with some notice I could book a says leave - perhaps you can bring one of your analysers - I'm sure they are better than my Icom RF bandscope - and we can run through the interfame timing tests - and see if you can see anything on the NDX ground plane. We also have a very nice village pub for a spot of lunch 

S