Saturday, 3 October 2020

HOW-TO: CD Pre-Emphasis & Using SoX De-Emphasis. (And the decline of physical media with vinyl revenue > CD now.)


Have you ever ripped or downloaded an old music CD that just sounds way too harsh? Sounding like the EQ is accentuated with too much treble?

Back in the day, a number of CDs were processed with pre-emphasis used and we can see at least a partial list of pre-emphasized albums here. Typically these would be early CDs from the mid-'80s although as per the list there are also a number from the late '80s and even early '90s.

In those early years, DACs were incapable of true 16-bit resolution and noisy analogue brick-wall filters added high-frequency distortions. As a means of improving signal-to-noise, they boosted the high frequency content and corrected the tone on playback (see this Hydrogen Audio FAQ on Pre-emphasis). As you're probably aware, a CD doesn't just contain the 16/44.1 audio data but have encoded within each "frame" 8 bytes of CIRC error correction and another byte of "subcode" data which can be thought of as "control data"; like a precursor to today's much more complete metadata. One of the subcodes is the "pre-emphasis flag". When activated, a CD player will engage its "de-emphasis" circuitry/filter. These days, DAC chips themselves can implement digital de-emphasis as part of basic functionality.

Fast forward a few decades and we're now at a time of ubiquitous digital audio. Bit-perfect CD ripping into a computer can allow us to create the digital data from the CD into .wav and .flac files, but unless we pay attention to it, the pre-emphasis flag can be easily lost. If we are to rip the whole CD into .bin/.cue format, we can see this "PRE" flag turned on for such pre-emphasized CDs. For example, here's a snip of a .cue from an old Pink Floyd Dark Side Of The Moon.


While I believe some ripping software like iTunes will apply the correct de-emphasis filter, most ripping programs I've seen will ignore the flag, leaving you, the audio lover, to try to deal with these unfiltered files. Sometimes, as with dBPowerAmp, the ripper can at least write a metadata tag for the file and hopefully you can use the playback software like foobar to play with de-emphasis DSP when it sees that tag (see this thread). Although this is a solution, it does require extra work on the playback set-up and personally, I would prefer that I just process once and keep the "proper" sounding version on my music server.

To make matters worse, there are CDs that appear to have pre-emphasized content but did not bother to turn on that PRE flag! This results in highly "tinny" and harsh playback... One wonders if in some instances, this might represent a subset of the complaints around early CDs sounding too "thin".

I was inspired to write this because a couple weeks ago, a friend wrote to me that he finally got around to ripping some old CDs and he had an old Spandau Ballet Truth CD that just "didn't sound right" when copied to his music server. He sent me some samples and to me, the tonality was that of pre-emphasis applied yet when I checked with him and the .cue file, the CD did not have that "FLAGS PRE" turned on!

For the sake of education ("fair use"), here's a ZIP file containing 45 seconds of the original song, what I believe is the pre-emphasized "Truth", compared to a de-emphasized version for your listening comparison:


While the synthesized parts already sound a bit shrill without processing, it's the vocals that particularly stand out as being overly bright and unnatural in the original "pre-emph" file. To be honest, I don't know if Truth is supposed to be so bright sounding but I think the de-emphasized version is much more tolerable. I would not be able to sit through the unprocessed album from start to finish! Furthermore, the processed version sounds closer to the 2003 remaster which adds to the idea that my friend's early pressing was missing the flag.

Remember that pre-emphasis basically applies an EQ curve which boosts the high end and needs to be reversed by the de-emphasis process. Here's a graphic of the de-emphasis filter from an old Sony CD/SACD player I found online:


As you can see, this EQ curve is very significant with a -4.5dB attenuation by 5kHz and goes up to -9.5dB at 20kHz.

As for the demo track above, we can compare the original and the processed de-emphasized versions with the FFT of those 45 seconds:


There are a number of ways you could de-emphasize. You could create your own EQ in an audio editor - here's a great post showing the target formula and a table of the amounts. As touched on above, in foobar, there are components you could use for de-emphasis as well.

My favourite however, which I believe is the highest resolution method, is by using SoX and its built-in de-emphasis filter. Here's what I would do:

1. Download the latest SoX. The Windows 32-bit binaries can be found here. Current version 14.4.2 works well.

2. Extract that download to a convenient location. I put it in my C:\ drive. You should see the sox.exe file in that directory.

3. Open up a command prompt and cd into the SoX directory you extracted the binary files to. (As you can see, I just issued "cd \sox-14.4.2".)


This makes it so that if we issue C:sox.exe, we should run the SoX program without doing anything fancy with paths.

4. Now copy this line and put it into a file in your directory with the pre-emphasized music; I call it "SoX De-Emph.cmd" (the exact name doesn't matter of course):

FOR %%A IN (*.flac) DO C:sox "%%A" -b 32 "%%A.wav" deemph

 [Thanks Bennet for the -b 32 flag instead of floating-point as per comments.]

So for example, using my friend's Truth with tracks ripped into individual FLAC files, the little batch file will be in its midst:


5. Now issue the "SoX De-Emph.cmd" command and you should see that it'll go through each *.flac file in the directory, processing them to create 32-bit 44.1kHz .wav as the de-emphasized output:


6. Congrats, you now have high precision 32-bit de-emphasize .wav files to work with.


7. I leave it to you what you want to do with these 32-bit files. The simplest is just to delete or move the .flac original and convert the de-emphasized files straight back to 16-bit FLAC with something like dBPowerAmp. TPDF dither is good - remember these CDs originated at a time when true 16-bit resolution was either rare or simply unobtainable so don't feel like you're losing any resolution by converting back to 16-bits!


If you want to be even more fancy, you can check the maximum amplitude for the album and use software like iZotope RX 7 to add extra gain and perform the dithering with settings as desired (similar to what I do with "hi-res audio" in general).

For those who don't want the fuss of the 32-bit files, in the batch command file (step 4) use this line instead:
FOR %%A IN (*.flac) DO C:sox "%%A" "%%A.wav" deemph
This will create standard 16-bit .wav output that can just be converted to whatever lossless format you prefer, tagged, and be done with it.

As discussed a few years back, I'd like to emphasize proper tagging of one's albums. So for example with this Spandau Ballet album, I'll call it something like "True (De-Emph'ed First Pressing, FLAC)" so I can remind myself that the data was altered with de-emphasis filtering applied.

That's pretty well it. Thankfully, pre-emphasized albums are rare especially these days unless you're seeking out some old "first press" CDs. If you have a large CD collection gathered over decades, I suspect you might already have a few. Since I've ripped all my old CDs years ago, it has been awhile since I've had to do this.

I hope this can be helpful and as reference if you ever come across such a scenario. Remember to think about that "pre-emphasis" feature if you run across strange-sounding old CDs from the '80s and '90s with weirdly "sharp" and "harsh" tonality.

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

In other news, as reported a couple weeks back, I see that vinyl from a dollar perspective is now outselling CDs in the first half of 2020 in the US. Considering the cost of new vinyl these days, how cheap CDs have become, and digital audio revenue being now 85% from streaming services, I guess it's no big surprise that physical digital products are well on its way out (I suspect this includes video formats like Blu-Ray and UHD Blu-Ray). Other than a few dinosaurs like myself, my non-audiophile friends, my wife, and kids are just streaming lossy audio and seem very satisfied.

I'm not sure I see this vinyl news as worth cheering about from a sound quality perspective. As far as I can tell, most new LPs are sourced digitally anyway, and it's not like vinyl is capable of better playback resolution as discussed years ago although the mastering might be better. To me it's just a reflection of LPs being a novelty for some, others are building a collection, and probably companies pricing the product how they can as people are paying little for digital music these days (deflationary cost pressure digitally and inflation on the analogue side). Who knows, perhaps the pandemic is allowing music lovers to spend more on vinyl instead of attending concerts.

As I highlighted in italics above, the news is about "dollar sales" comparing LP to CD. Let's look at a couple of graphs to put things into perspective straight from the RIAA:


The headline news is basically that the blue "LP/EP" amount has now overtaken the orange "CD" bar. Notice that things were pretty close by the end of 2019. Notice the rise of the green streaming amounts accounting for the vast majority of revenue. In 2019, sales of "LP/EP" + "CD" physical product together was only 10% of the total music sales revenue.

What's even more interesting I find is this:


These are sale volumes of music media. As you can see, when we exclude streaming, actual sales of "owned" products which include downloads have been dropping to the lowest volume ever since 1973! Basically as I wrote in the chart - "Ownership down, rental up!" for music. This graph also illustrates the importance of thinking in volume, not just dollar amounts. Notice that although in 2019 "LP/EP" revenues were close to "CD" revenue as in the first graph, the actual volume of LPs sold is very low in the second graph. This again is a reflection of that price differential... LPs simply sucking in more money from the consumer for fewer units of music "consumed".

According to the Guardian article, in 2020, vinyl sales reached "$232M" or "62%" of total physical revenue (thus leading CD sales). This means the total physical revenue was $374M in the first half of 2020. Consider that the total LP+CD sales in 2019 was $1112.1M, this means sales of physical media in the first half (50%) of 2020 is just shy of 34%! Hmmm, unless sales pick up in Q3/Q4, it looks like another year of losses for physical music media. Physical media volume has been in decline for basically 20 years straight.

From my perspective, this is not necessarily a bad thing...

As one who is trying to keep my energy expenditure and "carbon footprint" low for the last number of years, I'm reminded of vinyl as a type of plastic and has environmental impacts even if only a small global contributor. Likewise, CDs are made of plastic as well but less material used than an LP. Every little bit adds up, right?

Finally, remember that there are regional differences when it comes to music consumption. For us Canadians with a sagging dollar over the last few years, vinyl sales have dropped by >20% in 2020 compared to 2019. This will in all likelihood be the first down year for LPs after about 9 years of growth here in the North. It will be interesting to see if this is a "slump" or the bursting of a bubble.

Hope you're all doing well and enjoying the music as we enter October...

42 comments:

  1. I enjoy your consistent and gentle trolling of vinyl as a respectable high-fidelity playback medium, in part because I usually feel that you don't really lay a glove on my favorite music format in a way that weakens my affection for it. What I mean is that my reading of your mild vinyl dismissiveness and good-natured condescension is that it's mostly directly at the hyperbole and dubious technical claims of vinyl zealots. The other factor is your objectivist dedication to verifiable accuracy and fidelity, and impatience for dealing with extraneous noise, as dominant criteria. Thus your deck is firmly stacked against vinyl, and even when you're offering a fair-minded critique of the pleasures and attractions of vinyl it comes off as damning with faint praise.

    Which is fine! I benefit from everything else you so fruitfully explore in the pursuit of good sound and am perfectly willing to tolerate vinyl's second-class citizenship in the kingdom of Archimago. And if I tried to debate you about vinyl, I would do so more on subjective experiential and aesthetic grounds, rather than on competing fidelities, along with the anger I feel about the way that album art, credits, liner notes, and package design have be degraded and largely stripped from the non-physical-media streaming music marketplace. But even on the basis of fidelity and accuracy, my main criticism of your criticism of vinyl sound quality is that you overemphasize limitations that don't matter all that much and underplay the euphonious and pleasing sense of presence that vinyl, whether AAA or not,can offer, in some cases better than digital.

    ReplyDelete
    Replies
    1. Hi Hal,

      Thanks for the comment. I offer my observations on vinyl in the hopes of being reasonably fair. Remember, in my "kingdom", I have hundreds of LPs as well and will never part with many of them through this lifetime! There is definite intrinsic personal value locked up in the memories of the music contained within them. :-)

      Having said this, as an audiophile who places value in fidelity, examining products like hi-res DACs and evaluating amplifiers for low distortion, it would be grossly inconsistent if I did not, as a "format", consistently speak of LPs to be inferior to digital because that's simply what it is. To speak of it otherwise would simply be untrue.

      From my experience of the audiophile media, local stores, audio shows, there are already legions of vinyl lovers who will tout the format. Some are openly "evangelistic" and would never admit that maybe there are more than a few sonic issues inherent in the medium. The zeal and at times unrealistic hype some of these people create IMO will result in disappointment for many music lovers when these expectations become unrealized especially given the expense. You are right, much of what I state is in the hopes of targeting those appearing to be worked up into a religious fervor.

      Speaking of evangelism, check out this post recently:
      https://www.analogplanet.com/content/letter-australia

      Compared to that, I trust that my criticisms of vinyl objectively and from an environmental perspective do not seem unfair or misguided.

      Yes, I too miss the quality of the artwork, booklets, notes these days. I am however OK with reading PDFs and seeing album art on a nice tablet for the most part. Roon is great for credits and having access to the interconnected metadata serves a function that liner notes would not provide so it's both good and bad. In general, I already feel I have too much "stuff" in my life so unless truly a special album, I'm OK with finding serenity in keeping my music "virtual".

      As for the euphonic aspects of vinyl, I don't think this is anything that cannot be captured with a vinyl digital rip. I've done many where I have no need to play the album again on the turntable. People like Cookie Marenco's studio technique running the digital recordings through an analogue process to capture those putative euphonic changes seems to work for her. Whatever sound the artist intended (including lo-fi, compression...) can be conveyed through digital already, and more consistently since playback variation would be much less than an analogue system with all kinds of factors including the pressing, vinyl quality itself, turntables, cartridges, phono preamps; each of which potentially affecting fidelity in significant ways.

      Delete
  2. For those who prefer easy and automatic de-emphasis solution there is music converter and CD ripping software called EZ CD Audio Converter available.

    It detects pre-emphasis by scanning the CD subcodes in case the CD does not provide pre-emphasis flag properly in TOC. It also notifies this inconsistency in ripping log. Setting allows to apply automatic de-emphasization or alternatively creation of FLAC/CUE with pre-emphasis flag properly set.

    ReplyDelete
    Replies
    1. Wow, nice Steve,
      I haven't tried it but that's great to see an all-in-one solution that can do the job!

      Delete
  3. Interesting about the formats. I have a record player/stand alone phono stage plugged in to my DAC3 HGC which I use regularly, but I haven't used a CD or DVD player in several years. I have a couple, but they are in a closet somewhere. I ripped all my CDs to the PC, and use that as a front end. LOL

    ReplyDelete
    Replies
    1. Yup mp4,
      I was "sold" on computer audio since the early 2000's and ripped all my CDs out by the time I bought my first Squeezebox (3) by 2005.

      Other than spinning up to rip CDs on my workstation computer, the only disks I bother with now are Blu-Rays and UHD Blu-Rays.

      Delete
  4. Interesting point about environmental footprint of different media types, but it seems to ignore an aspect of the downloadable media and streaming: internet server farms use a rather enormous amount of electrical power. I think many people fail to recognize this as an environmental impact of online digital media. I would be curious to see an objective analysis of environmental/carbon footprint of downloaded or streamed media, although I would guess this would be almost impossible to parse down into a meaningful assessment of average footprint per play.

    ReplyDelete
    Replies
    1. Yeah, I was thinking the same thing. There's certainly a trade-off between the manufacturing and use of plastics, vs the (huge) energy needed for large-scale streaming services. Here's a link from the BBC: https://www.bbc.com/future/article/20190207-why-streaming-music-may-be-bad-for-climate-change

      It claims that if you listen to a CD more than 27 times, the CD could be better than streaming.

      Personally, I'm old school. Occasionally I use a Spotify free account, but usually I play my own ripped CDs from a computer, and still play physical SACDs. When/if Qobuz comes to my country, I will probably give it a try.

      And, by the way, nice usage of Sox!

      Delete
    2. Good points TJAB, and thanks for the link Freddie,
      Regardless there is give and take here. Imagine all the hard drives manufactured for folks with terabytes of storage plus the aforementioned need for electricity, replacement and backup drives, etc...

      Interesting stat about listening to a CD >27 times. Hmmm, how many albums produced these days I wonder would be listened to from start-to-end even 27 times? I suspect this would be a vast minority of those purchased.

      Delete
  5. Hi Archimago...

    You must have read my mind telepathically, as I thought to propose this CD pre-emphasis/de-emphasis topic to you several months ago.

    While early to mid 1980s pre-emphasis/de-emphasis was intended to be accomplished in the analog filter domain, hence inherently possessed significant degrees of imprecision from the beginning to the end of the process and on a CD to CD basis, would you be interested in a deeper exploration of the frequency response -- and phase response -- accuracies of available digital de-emphasis methods?

    I have several vintage test CDs -- The Digital Domain, Pierre Verany, Stereophile -- with pre-emphasis sweeps/tones that would be ideal for digital de-emphasis testing. I started down this exploratory path myself but could use your insight.

    AJ

    ReplyDelete
    Replies
    1. Hi AJ,
      Yeah, not sure I'd be able to add much to the exploration of the de-emphasis accuracy. I know over the years this has been part of the test suite for CD players like this recent archive post on Stereophile:
      https://www.stereophile.com/content/california-audio-labs-tercet-mkiii-cd-player-measurements

      Looks like the California Audio Labs player might have <0.5dB error out at 10kHz so no big deal even in a device from the early 1990's. Obviously these days in the face of ubiquitous 24-bit DACs and such, this is a legacy feature/characteristic of digital playback.

      Delete
    2. Interesting about the de-emphasis assumed to be applied in the analog domain. The intention was probably to do something similar to Dolby for tape hiss by suppressing high frequencies thereby making brickwall filters a little gentler.

      In terms of accuracy, both the SoX and the Roon variant below are within 0.06 dB of what is considered to be the spec for pre-emphasis. Given the massive correction this puts into the high frequencies, I would deem that discrepancy irrelevant.

      Delete
  6. Bis and Supraphon were still using pre-emphasis up to about 1992. Also Hyperion to a lesser extent, and even some CBS CDs (Glen Gould Goldberg Veriations, for example).

    You can set dBPoweramp in settings so it will write a tag, Pre-Emphasis=Yes, but it still only checks the TOC AFAIK, not the subcode, and they do disagree now and then. CueRipper, part of CueTools, seems to do a more thorough check.

    Here's my de-emph script that checks for that Pre-Emphasis tag (sorry, don't know how to format code in blogger):

    #!/bin/sh

    for flc in *.flac
    do
    is_preemp="$(metaflac --show-tag=Pre-Emphasis "$flc")"
    if [ "$is_preemp" = "Pre-Emphasis=Yes" ]; then
    mkdir -p pre-emphasized
    echo "Applying de-emphasis to '$flc'."
    deemph_flc="${flc%.flac}_deemph.flac"
    sox "$flc" -b 24 "$deemph_flc" deemph
    metaflac --remove-tag="Pre-Emphasis" \
    --set-tag="Pre-Emphasis=No" "$deemph_flc"
    metaflac --set-tag="De-Emphasis By=$(sox --version)" "$deemph_flc"
    mv "$flc" pre-emphasized
    else
    echo "'$flc' does not have tag 'Pre-Emphasis=Yes'."
    fi
    done

    zip -r pre-emphasized.zip pre-emphasized && rm -rf pre-emphasized

    ReplyDelete
    Replies
    1. Fantastic Dave,
      Excellent code for reference!

      Delete
  7. I have been a big fan of vinyl (shellac) since I played 78's for my ailing father in 1953 on an old RCA fliptop record player with a swell 8" duo-cone speaker in the front of the cabinet. I collected 45's as a kid (and wish I had kept them all ), then went to viyl when it was basically the only format. The few prerecorded R2Rs never moved me accept to own a Pioneer RT 707 for my own use after buying a Teac 350 for my first cassette deck to make tapes for the car.

    The issue with vinyl is that it is a finicky format with many, many hands in the soup, starting with Mastering, the master disc cutting, plating, quality of the vinyl used for pressing, cleanliness of the plant etc. So much matters and then the weight of the vinyl chosen for release that can change the VTA for 120 gram to 180 gram releases. Who changes that from LP to LP? The cartridge choices and phono stage choices are as great as there are cable possibilities. I haven't even talked about the turntable yet and how many don't spin at the right speed or are consistent? IT IS AMAZING THAT THE LP FORMAT SOUNDS AS GREAT AS IT OFTEN DOES CONSIDERING THE ENGINEERING AND MECHANICAL ISSUES.

    So I do like LPs, but digital has come such a long way and 2496 is my favorite format and sounds great, and I am a huge fan of SACD and sorry it never really caught on with the masses. It always comes down to convenience and streaming is winning the game today, just not in my house. It is all OK with me.

    I find little to complain about the redbook CDs given the state of DACs today. I would love to own a Weiss 502, but that is not happening, but there are so many sub $1K dacs that are superb, what is the point? Most CD players approaching $1K are excellent.

    I do regret letting my Technics SP-10 get away with the SME arm. That was a mistake for sure.

    ReplyDelete
    Replies
    1. Wow Jim, shellac eh?

      Actually, I have never owned any of those 78's (nor to be honest am I all that curious to try any out!). I do have a few 45 singles in my collection including the Beatles box set (original release not the new remasters) given to me by a dear old friend.

      Indeed:
      "IT IS AMAZING THAT THE LP FORMAT SOUNDS AS GREAT AS IT OFTEN DOES CONSIDERING THE ENGINEERING AND MECHANICAL ISSUES."

      To me, what is remarkable is also that the human ear/mind is a very forgiving mechanism! Within "reasonable" tolerances, we can extract all that we need to achieve joyful experiences from the music seasoned with those imperfections like noise, pops, inner groove distortions, minor balance issues.

      This is to me also part of the irony of audiophilia! On the one hand we have biological mechanisms that can find high levels of enjoyment out of the imperfect (easily objectively demonstrated!).

      And then you have audiophiles (including vinylphiles) who insist $$$ cables make a difference, yet objectively not demonstrably present and then they insist that the human perception system is *so good* to the point of almost "infinite" resolution!

      Clearly there are cognitive/intellectual dissonances in this hobby :-).

      Yup. If the music is recorded well and the whole production chain can maintain accuracy to the 24/96 standard, that would be awesome!

      Delete
    2. "This is to me also part of the irony of audiophilia! On the one hand we have biological mechanisms that can find high levels of enjoyment out of the imperfect (easily objectively demonstrated!)."

      Yes, this is part of the audiophile conundrum.

      Many audiophiles chase better sound as a way of enjoying music "more." So we spend all sorts of money on ever more expensive components. But the two goals of the audiophile tend to be at odds. Many audiophiles want to be swept away by the music produced by their system. So that it is a purely "Musical" experience "I'm in it for The Music! I want to forget about the equipment."

      Basically, they want equipment that makes them forget about the equipment.

      And yet, to the extent one IS swept up purely by "the music" one is no longer concentrating on analyzing the sound of his equipment. Which then seems to make all this concentrating on one's system moot. You pay tons of money for equipment and the more you forget about your equipment, the better.

      Well, this is essentially where non-audiophiles are most of the time! My wife, my kids, and any other non-audiophiles I know are TRULY just "music lovers." They get swept away purely thinking of the music, whether through ear buds, a smart speaker, car stereo, a laptop or whatever. If that's the state of pure musical bliss we want to reach, why all this distraction on equipment?

      It's this conundrum that audiophiles often face when they find themselves moved by music on lesser or non audiophile systems. Say, when just the right song comes on during a nice drive through even a modest car stereo. You wonder "do I really need all that high end gear?"

      Ultimately I think it makes sense not to fool ourselves that we are really "Just music lovers." We are (typically) dudes attracted to gear, like crows to shiny objects. It turns our crank to geek out to one degree or another. Most of us like some form of technical story, even if we don't happen to have much technical knowledge (which is why virtually all reviews of audio gear tell us a technical story, usually first, before the sonic impressions are described).

      I often think that the most blissful state is the one that got many of us in to the hobby. That one where you were surprised upon hearing music on an excellent audio system and it grabbed you, had you mesmerized. It's the perfect state where you are in to the music, and the experience is emotionally elevated by the "holy cow!" of the sound quality, and they have merged perfectly to elevate your enjoyment of the music. You may in those early experiences finally decide "I have to have something like this myself." But those initial experiences are when you are innocent, before all the research, before the comparing, before developing likes and dislikes and more "refined" selective ideas about sound. It's just pure joy. And audiophiles tend to chase that type of experience, which can be ever harder to come by the more you learn about gear while trying to "forget" the equipment.

      My guests, some musicians some not, often listen to some music on my high end system and they are in awe. I envy them because I can see they are having that "first timer" experience, that combination of musical bliss and awe at the presentation, without any distracting knowledge about the gear.



      Delete
  8. Hi Archimago,

    The command line based SoX program uses integer internally, so writing to floating point format won't benefit from floating point processing (clipping protection and low-level details). Replacing "-e floating-point" with "-b 32" will make it output 32-bit integer files if desired.

    https://hydrogenaud.io/index.php?topic=101850.0

    Some SoX-powered programs, like Audacity and foobar's resmapler do support floating point though. In the case of foo_dsp_resampler, the author of the plugin even added SIMD support, that's why it is so fast.

    ReplyDelete
    Replies
    1. Awesome Bennet,
      Thanks for the tip and insight into the workings of SoX! Great, even more resolution for that ultimate extra bit of resolution from de-emphasis :-).

      Delete
  9. For an implementation in Roon using the High Shelf filter, check out:

    https://community.roonlabs.com/t/de-emphasis-curve-was-parametric-eq-functions/123336/11?u=miguelito

    ReplyDelete
    Replies
    1. Nice work miguelito! Great seeing the accuracy verification.

      This certainly does bring up the question raised by AJ above regarding accuracy of the de-emphasis process.

      As per the SoX documentation, the deemph filter will:
      http://sox.sourceforge.net/sox.html

      "Apply Compact Disc (IEC 60908) de-emphasis (a treble attenuation shelving filter).

      Pre-emphasis was applied in the mastering of some CDs issued in the early 1980s. These included many classical music albums, as well as now sought-after issues of albums by The Beatles, Pink Floyd and others. Pre-emphasis should be removed at playback time by a de-emphasis filter in the playback device. However, not all modern CD players have this filter, and very few PC CD drives have it; playing pre-emphasised audio without the correct de-emphasis filter results in audio that sounds harsh and is far from what its creators intended.

      With the deemph effect, it is possible to apply the necessary de-emphasis to audio that has been extracted from a pre-emphasised CD, and then either burn the de-emphasised audio to a new CD (which will then play correctly on any CD player), or simply play the correctly de-emphasised audio files on the PC. For example:
      ...
      The de-emphasis filter is implemented as a biquad and requires the input audio sample rate to be either 44.1kHz or 48kHz. Maximum deviation from the ideal response is only 0.06dB (up to 20kHz)."


      Looks good... Maximum 0.06dB deviation.

      Delete
    2. One thing I like is not having to create new files, just need to turn on that filter in Roon. Presumably this could be applied to any parametric filter.

      Also, my theoretical curve is the one from the spreadsheet in your link.

      Delete
  10. Just want to point out that most reissues do not have the pre-emphasis applied (as far as I can tell!). Spandau Ballet’s “True” being one case.

    ReplyDelete
    Replies
    1. Some Brilliant Classics re-issues -- Alfven Symphonies from Bis, for example -- have the pre-emphasis of the original issues.

      Delete

  11. Archimago,

    Good info on the de-emphasis!

    I've always used itunes to rip (no emphasis or normalizing), which I presume is why I've never noticed any problems.

    BTW, note when the subject of listening to vinyl comes up, when a vinyl-lover mentions also liking digital it's because "Digital has come such a long way" and now sounds "good."

    I wonder what you think of this extremely common view in the audiophile world: that digital has made these amazing advances since the introduction of the CD, and sounds so much better now.

    I'm dubious about this. Not that there haven't been various "advances" that show up in fine technical measurements. But in terms of audibility, how far do you really think digital has advanced since the introduction of the CD?

    Again, a few reason's I am skeptical is because from early on CD players were putting out signals that seemed close to the promised levels of audible transparency. For instance, these measurements of a sony cd player circa
    1993 seem pretty good don't they?:

    https://kenrockwell.com/audio/sony/cdp-x303es.htm

    Further, blind testing of digital codecs and even "hi res" digital seem to suggest differences that are mostly subtle, if even audible.

    I use a benchmark DAC because it's a reliable piece of gear from a technically straight-shooting company (and for it's versatile features). But could I tell it apart in a blind test from a well designed CD player like that old Sony? Maybe. Maybe not.

    ReplyDelete
    Replies
    1. I have been using for years 4 Sony DVP NS 755V DVD/CD/SACD players from 1993. The first one I bought retail for $300 and the others off EBay for all under $50 each. They are excellent players of all formats and have a 12 bit 108 MHZ video chip which played DVDs great. I also bought a Yamaha S-1800 (also a DVD/CD/SACD player) in 1997 which is a big step up from the Sony players.

      I then bought a Project Audio Systems S2 DAC well reviewed in Stereophile and I was shocked and pleased at how much better a little $299 DAC improved the playback of the Sony players. It was not subtle and the fact that you have 5 filter choices gives one the chance to see if they can hear the difference. The S2 is slightly better than the Yamaha player, but it is better. It has a 14 bit 216mhz video chip and improves DVD playback over the Sony, but not by a great amount.

      There are so many excellent DACs in the market for under $500 that if you have a player that is7-10 years old I would urge you to make the plunge and buy one. The S2 can even play back usb DSD downloads and is a crazy bargain as a USB dac for $299. For $399 it comes with a headphone amp built it.

      Delete
  12. Yes, I do think that digital has made great advances and one has to look no further that 2496, 24192 and DSD to know that there are very bright people working to make digital the best, like the folks at Benchmark.

    The have also worked to make it more affordable unlike the LP where everything has risen to rediculous levels and $50K phono stages and the like. If you need a $100K turntable to make an LP sound great there is something wrong.

    It is all OK as try and make informed decisions when I spend my money and not listen to snake oil.

    ReplyDelete
  13. I wonder if you could make the batch file and place in on a hard drive, which is connected to an Oppo, and hear the de-emphasis in work like that? I doubt it...

    ReplyDelete
  14. Wondering if anyone can explain the ins&outs of ripping on a mac with pre-emphasis detection.

    XLD indicates it detects pre-emphasis both in the TOC and subcode info, but it is unclear to me what happens after - I presume at least the cue sheet will indicate this, but I wonder if there’s the option of creating an ID3 tag for it.

    Additionally, I read not all CD drives are able to retrieve this info. Wondering how to know if that is an issue in my setup.

    Thx.

    ReplyDelete
  15. Out of curiosity, I ran MusicScope on the files you provided (True) as well as one obtained by running xACT on the pre-emphasis file. I get a result close to theoretical with xACT but your deemph file seems to have have been boosted by 2dB - the relative drop between frequencies is the same but your deemph file is "louder" by 2dB.

    Here are the numbers:

    /Users/miguelito/Desktop/Screen Shot 2020-10-11 at 6.12.31 PM.png

    ReplyDelete
    Replies
    1. f [kHz] Pre-Emph [dB] xACT deemph [dB] Archigo [dB] xACT-Pre-Emph Archi-Pre-Emph Archi-Pre-Emph-2 Theoretical [dB]
      1 -33.70 -34.00 -32.00 -0.30 1.70 -0.30 -0.37
      2 -36.80 -38.10 -36.10 -1.30 0.70 -1.30 -1.29
      3 -39.00 -41.40 -39.40 -2.40 -0.40 -2.40 -2.43
      4 -35.60 -39.10 -37.10 -3.50 -1.50 -3.50 -3.54
      5 -42.50 -47.00 -45.00 -4.50 -2.50 -4.50 -4.53
      6 -36.70 -42.00 -40.00 -5.30 -3.30 -5.30 -5.38
      7 -42.80 -48.80 -46.80 -6.00 -4.00 -6.00 -6.09
      8 -39.00 -45.70 -43.70 -6.70 -4.70 -6.70 -6.69
      9 -43.30 -50.40 -48.40 -7.10 -5.10 -7.10 -7.19
      10 -43.10 -50.70 -48.70 -7.60 -5.60 -7.60 -7.60
      11 -47.30 -55.30 -53.30 -8.00 -6.00 -8.00 -7.95
      12 -48.80 -57.10 -55.10 -8.30 -6.30 -8.30 -8.24
      13 -44.10 -52.70 -50.70 -8.60 -6.60 -8.60 -8.49
      14 -48.90 -57.70 -55.70 -8.80 -6.80 -8.80 -8.71
      15 -49.00 -57.90 -55.90 -8.90 -6.90 -8.90 -8.89
      16 -48.90 -58.00 -56.00 -9.10 -7.10 -9.10 -9.04
      17 -47.60 -56.80 -54.80 -9.20 -7.20 -9.20 -9.18
      18 -52.30 -61.60 -59.60 -9.30 -7.30 -9.30 -9.30
      19 -54.80 -64.20 -62.20 -9.40 -7.40 -9.40 -9.40
      20 -52.40 -61.80 -59.80 -9.40 -7.40 -9.40 -9.49

      Delete
    2. I designed the de-emphasis filter using the table and wrote its design process on my blog https://yamamoto2002.blogspot.com/2020/11/designing-de-emphasis-filter-for-some.html

      Delete
    3. Damn, good stuff Miguel!

      And Yamamoto2002 san, that's gotta be the most exhaustive review of pre/de-emphasis design on the Internet with that 27-tap filter and 0.00873dB error from reference! Alas, I'm sure some Audiophile Golden Ear might still hear the difference somewhere on the Internet ;-).

      Cheers boys...

      Delete
    4. Yamamoto san, SOX refuses to see your filter file (txt) unless I delete all the comas after the figures... Then it works! Thank you!

      Delete
  16. ffmpeg has the aemphasis filter which lets you add or remove various types of emphasis including CD & RIAA.

    https://ffmpeg.org/ffmpeg-filters.html#aemphasis

    ReplyDelete
  17. Wondering if anyone could post a CD with pre-emphasis image that I can burn to a disc to check if the appropriate flags get captured by XLD on the mac. I presume a disc image is an exact copy including all info?

    ReplyDelete
    Replies
    1. I wrote an article how to create pre-emphasis Audio CD-R https://yamamoto2002.blogspot.com/2020/11/creating-pre-emphasis-audio-cd.html

      Delete
  18. Great article. I've just started to rip a bunch of old CDs which EAC reports as having pre emph and your guide on SoX worked a treat, thanks for that.

    ReplyDelete
  19. The rise of popularity of "streaming" systems is regrettable. The quality of rips there has a range of problems, including not applied de-emphasis, read errors, deleted pauses, watermark (still), faded or abruptly cut segued transitions, rearranged track order, per-track normalization, loudness war, mixed sources on the same album, transcodes, abysmal artwork. They have rushed to put out more tracks within a short period than early CD reissues.

    An equalizer is useful to preview de-emphasis in order to decide whether the processing is correct. I made presets for TC Parametric EQ and Fabfilter Pro-Q using 1 or 2 bands, by referencing SoX. The result is closer than certain other DSP plugins. I don't think it is right to use more than a one band curve. There might be an extra digit in my preset files.

    TC: 5310 Hz, -9.6 dB, 6dB slope
    Pro-Q 2: I. 5880 Hz, -10.56 dB, 6 dB slope
    II. 5900 Hz, -10.50 dB, Q 0.435, 12 dB slope, hshelf
    17577 Hz, -0.14 dB, Q 1.768, 12 dB slope, bell

    Sometimes it is hard to decide, as some instruments get muffled too much. I might give a rest of at least 2 days and listen to the processed album without a direct A/B comparison.

    ReplyDelete
  20. I wish there were an correction impulse file for de-emphasis to be used with a convolver. Is there any such impulse?

    ReplyDelete
  21. Man, the article is confusing. Put all the files in the same directory and didnt work. When putting your effort in reading, installing and trying and it's not working, its name is "waste of time". Thanks anyway.

    ReplyDelete