Pre-emphasis on CDs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rolmill
    Full Member
    • Nov 2010
    • 630

    Pre-emphasis on CDs

    This may be old hat to everyone else, but it was new to me and I thought I would share it in case anyone else is as naïve in these matters as I am!

    A chance comment from Bryn on the Bargains thread alerted me to the fact that some CDs have the sound modified in a manner that is cancelled by (most) CD players on playback, the purpose being to reduce background noise when played. However, when ripping the CD this pre-emphasis is not automatically corrected, leaving a rather harsh treble sound. I have over the last few years been gradually ripping my CD collection to my hard drive, blissfully unaware of this - I have only listened to a small proportion on iPod when travelling so far, though it probably explains my occasional disappointment at the ripped result! Other boarders helpfully told me how to eliminate the pre-emphasis whilst ripping (I am using the sox command line application for this).

    Fortunately, a year ago I started using EAC as my CD ripper, which displays a column stating whether pre-emphasis is present on the CD, so I am now running them all through EAC with the intention of re-ripping any so marked. Still in the early stages, but so far the Brilliant box of Alfven symphonies has been identified (though bizarrely only the first four of the five CDs), as has the Hyperion three CD series of Malcolm Arnold's chamber music from the Nash Ensemble, making a "hit" rate of around 3 - 4%.

    Happy for this post to be roundly ignored as pointless, but I wouldn't want anyone else ripping thousands of CDs without being aware of this possible issue and thus finding a (small) proportion of them pretty much unplayable!
  • Stunsworth
    Full Member
    • Nov 2010
    • 1553

    #2
    Just a small point, iTunes detects and compensates for CD pre-emphasis.
    Steve

    Comment

    • richardfinegold
      Full Member
      • Sep 2012
      • 7332

      #3
      Originally posted by Stunsworth View Post
      Just a small point, iTunes detects and compensates for CD pre-emphasis.
      I have ripped several hunderd cDs (sing i tunes) and never noted this problem.

      Comment

      • robk
        Full Member
        • Nov 2010
        • 167

        #4
        Originally posted by richardfinegold View Post
        I have ripped several hunderd cDs (sing i tunes) and never noted this problem.
        I had been wondering why the Raphael Ensemble Hyperion recording of the Brahms Sextets is so well liked when mine has edgy uncomfortable sound.
        I have now checked the CD with EAC and it has pre-emphasis. I have re-ripped the CD and removed the pre-emphasis. I found this a time consuming process, partly because I had to learn how to use the command window.

        The prospect of checking hundreds of CD's is daunting. Are there any guidelines about which labels used pre-emphasis and the time period that it occurred?

        Comment

        • Rolmill
          Full Member
          • Nov 2010
          • 630

          #5
          Originally posted by robk View Post
          I had been wondering why the Raphael Ensemble Hyperion recording of the Brahms Sextets is so well liked when mine has edgy uncomfortable sound.
          I have now checked the CD with EAC and it has pre-emphasis. I have re-ripped the CD and removed the pre-emphasis. I found this a time consuming process, partly because I had to learn how to use the command window.

          The prospect of checking hundreds of CD's is daunting. Are there any guidelines about which labels used pre-emphasis and the time period that it occurred?
          Not really, so far as I can see, though there are a few indications (classical more affected than rock, 1980s recordings, BIS label etc) in this link: http://www.head-fi.org/t/423506/ripp...e-pre-emphasis

          The comments from Steve and Richard re iTunes are interesting. The above link suggests that iTunes ripping deals with pre-emphasis but sometimes at a cost in terms of sound quality - I think someone on the Bargains thread also mentioned this. However, the comment dates from some years ago, so it may be that more recent version of iTunes deal with the issue satisfactorily. I must admit, I really like the results from EAC and have never used iTunes for ripping (am not a fan of the software anyway, as every release seems to be worse than its predecessor for my purposes!), so am reluctant to use it - but it could save a lot of time if the earlier sound quality issues have been resolved. As you say, removing the pre-emphasis is quite time-consuming. I might try just using iTunes to rip CDs where EAC identifies pre-emphasis.

          Given the extent to which people nowadays rip CDs, I am a little surprised that the subject has not received more attention - maybe most people simply use iTunes and therefore bypass the problem.

          Comment

          • johnb
            Full Member
            • Mar 2007
            • 2903

            #6
            In order to get the best results from removing the pre-emphasis it is recommended that the music file is first converted to 24 bits, then the pre-emphasis is removed, then the file is converted to 16 bits with dither (or left at 24 bits).

            If I have time this afternoon I will post the sox commands for this process and also post a means by which the three stage sox procedure can be done by just dragging a file onto a desktop icon.

            Comment

            • Rolmill
              Full Member
              • Nov 2010
              • 630

              #7
              Originally posted by johnb View Post
              In order to get the best results from removing the pre-emphasis it is recommended that the music file is first converted to 24 bits, then the pre-emphasis is removed, then the file is converted to 16 bits with dither (or left at 24 bits).

              If I have time this afternoon I will post the sox commands for this process and also post a means by which the three stage sox procedure can be done by just dragging a file onto a desktop icon.
              That would be really helpful, thanks .

              Comment

              • Dave2002
                Full Member
                • Dec 2010
                • 17865

                #8
                Originally posted by robk View Post
                The prospect of checking hundreds of CD's is daunting. Are there any guidelines about which labels used pre-emphasis and the time period that it occurred?
                I am slightly surprised at the CDs which have been mentioned so far which are claimed to have pre-emphasis. I thought that mostly it was only a few Japanese mastered CDs which have this, so hearing about Brilliant's Alfvén Symphonies, and Hyperion's recordings came as a surprise.

                A database of recordings which are found or known to have pre-emphasis would certainly be helpful/useful.

                In days gone by lights came on when CDs were put into some CD players if the CD had such a feature.

                Comment

                • Rolmill
                  Full Member
                  • Nov 2010
                  • 630

                  #9
                  Originally posted by Dave2002 View Post
                  I am slightly surprised at the CDs which have been mentioned so far which are claimed to have pre-emphasis. I thought that mostly it was only a few Japanese mastered CDs which have this, so hearing about Brilliant's Alfvén Symphonies, and Hyperion's recordings came as a surprise.

                  A database of recordings which are found or known to have pre-emphasis would certainly be helpful/useful.

                  In days gone by lights came on when CDs were put into some CD players if the CD had such a feature.
                  Yes, I was surprised when the Hyperion CDs were flagged by EAC, but I kept the old ripped files and there is no doubt that the new ("sox"-ed) files are less harsh in the treble frequencies, notably in the violin sonatas. I think BIS were mentioned on another website as a possibility, and I guess the Alfven are licensed from BIS - after making the OP I then found two of the BIS Bach cantata/Suzuki discs with pre-emphasis. I should add that the incidence seems sporadic - so the other ten BIS Bach cantata CDs in my collection are fine, as are the many other Hyperion discs I have checked so far!

                  I have a few thousand more to check (), which will take me several months or longer, but I'm happy to keep a list of the culprits and make it available.

                  Comment

                  • Dave2002
                    Full Member
                    • Dec 2010
                    • 17865

                    #10
                    I found this on another site, though it's a few years old now
                    * cdda2wav will detect pre-emphasis ("cdrecord -D /dev/cdrom -J") and can RIP & convert on-the-fly "-T"
                    * sox can process for pre-emphasis if you've already ripped the CD and it is in wav
                    * k3b will detect pre-emphasis (select your drive with the audio cd loaded and select "media info") - it does not use cdda2wav
                    * k3b will write an audio project WITH pre-emphasis with the pre-emphasis flag checked.
                    It looks as though cdda2wav might do the detection you want, and since it's available as a Linux version, it might even be persuaded to work with a Mac - http://www.cdda2wav.de/

                    I have got PCs and Linux systems, but they're a faff to set up, so if I can't get something working on my Macs it probably won't get done.

                    It looks as though if you have already ripped the CDs, then sox will sort out the pre-emphasis if you need to do that - but obviously it would help a lot if you know which ones have, or are more likely to have, any pre-emphasis.

                    This page also appears to be very helpful, though suggests that iTunes does not give the best results, even though it does handle the pre-emphasis - http://www.head-fi.org/t/423506/ripp...e-pre-emphasis

                    Perhaps a shared database (wiki?) might help us all here. Users could add in any CDs they know which they find have pre-emphasis.

                    Comment

                    • robk
                      Full Member
                      • Nov 2010
                      • 167

                      #11
                      Originally posted by Rolmill View Post
                      I have a few thousand more to check (), which will take me several months or longer, but I'm happy to keep a list of the culprits and make it available.
                      That would be much appreciated. I am inclined to only check after listening to a file which sounds wrong. My high frequency hearing ability is not great these days so if I can't hear a problem I am not sure that it really matters. I will post if I find any more.

                      Comment

                      • johnb
                        Full Member
                        • Mar 2007
                        • 2903

                        #12
                        I feel quite hesitant about sharing things that are very "quick and dirty" but here goes.

                        I've done two "drag and drop" versions:

                        1) To remove the pre-emphasis from a wav file, and

                        2) Removing the pre-emphasis while maintaining the tags when a CD has been already ripped to flac and tagged.

                        The original files will still be present and should be unchanged but please take a backup copy of them as a precaution.

                        Both versions are very rough and ready (i.e. quick and dirty) - so you and warned.

                        I'll put the two versions in separate posts.

                        Comment

                        • johnb
                          Full Member
                          • Mar 2007
                          • 2903

                          #13
                          Version 1 - To remove the pre-emphasis from a wav file

                          I've tested it on my system but that is no guarantee that it will work on everyone's PC.
                          The original files should remain unchanged - but make of backup copy of them as a precaution.

                          This assumes you have SOX installed. If not it can be downloaded from: http://sourceforge.net/projects/sox/

                          Open Notepad and copy and paste the following into it.
                          Code:
                          REM Batch file to remove pre-emphasis from a wave file
                          
                          REM set 'FILE' to dropped filename and path but without filetype
                          set FILE=%~dpn1
                          
                          REM set 'SOXEXE' to the path and filename of sox
                          set SOXEXE="C:\Program Files (x86)\sox-14-4-0\sox"
                          
                          REM create new 24 bit wave file
                          %SOXEXE% "%FILE%.wav" -b 24 "%FILE%_24.wav"
                          
                          REM de-emphasise the 24 bit file
                          %SOXEXE% "%FILE%_24.wav" "%FILE%_24DE.wav" deemph
                          
                          REM convert the 24 bit file to 16 bit, applying shaped dither
                          %SOXEXE% "%FILE%_24DE.wav" -b 16 "%FILE%_16DE.wav" dither -s
                          
                          REM delete temporary files
                          del "%FILE%_24.wav"
                          del "%FILE%_24DE.wav"
                          pause

                          Check where sox.exe is located on your own computer and edit the set SOXEXE="C:\Program Files (x86)\sox-14-4-0\sox" line accordingly, making sure you only change the location and nothing else.

                          Save it onto your Desktop using a short name such as "De-emph.bat" (the .bat part is very important)

                          Then open Windows Explorer in a way that you can still see the De-emph.bat icon on the desktop and drag the wave file onto the De-emph icon.

                          When the process is complete you will be asked to "Press any key to continue ...". Pressing any key will close the window, but the pause enables you to check for any errors before the window closes.

                          The de-emphasised file will have the same filename as the original but with "_16DE" added at the end (to signify 16 bits, de-emphasised).

                          'REM' lines are explanatory remarks and the batch file does the following:
                          - create a new wave file with 24 bit depth named filename_24.wav
                          - de-emphasise to a wave file named filename_24DE.wav
                          - create a new de-emphasised wave file with 16 bit depth (employing noise shaped dither) filename_16DE.wav
                          - delete the intermediate files

                          Comment

                          • johnb
                            Full Member
                            • Mar 2007
                            • 2903

                            #14
                            Version 2) Remove pre-emphasis in a flac file while keeping the tagged data (e.g. when a CD has been already ripped to flac and tagged)

                            I've tested it on my system but that is no guarantee that it will work on everyone's PC.
                            The original files should remain unchanged - but make of backup copy of them as a precaution.

                            This assumes you have both SOX and FLAC installed on your computer. If not, they can be downloaded from:
                            Download SoX - Sound eXchange for free. SoX is the Swiss Army Knife of sound processing utilities. It can convert audio files to other popular audio file types and also apply sound effects and filters during the conversion.

                            FLAC is a free lossless compressed audio format which supports streaming and archival. The FLAC project maintains the format and provides a…


                            Open Notepad and copy and paste the following into it.

                            Code:
                            REM Batch file to remove pre-emphasis from a flac file
                            REM while maintaining the tags
                            
                            REM set 'FILE' to dropped filename and path but without filetype
                            set FILE=%~dpn1
                            
                            REM set paths to sox. flac, metaflac
                            set SOXEXE="C:\Program Files (x86)\sox-14-4-0\sox"
                            set FLC="C:\Program Files (x86)\flac\flac"
                            set FLCMETA="C:\Program Files (x86)\flac\metaflac"
                            
                            REM export tags to filename.tags
                            %FLCMETA% --no-utf8-convert --export-tags-to="%FILE%.tags" "%FILE%.flac"
                            
                            REM decode FLAC to WAV
                            %FLC% -d "%FILE%.flac"
                            
                            REM create new 24 bit wave file
                            %SOXEXE% "%FILE%.wav" -b 24 "%FILE%_24.wav"
                            
                            REM de-emphasise the 24 bit file
                            %SOXEXE% "%FILE%_24.wav" "%FILE%_24DE.wav" deemph
                            
                            REM convert the 24 bit file to 16 bit, applying dither
                            %SOXEXE% "%FILE%_24DE.wav" -b 16 "%FILE%_16DE.wav" dither -s
                            
                            REM convert wav to flac using default compression level 5
                            %FLC% "%FILE%_16DE.wav"
                            
                            REM import tags from filename.tags
                            %FLCMETA% --remove-all-tags "%FILE%_16DE.flac"
                            %FLCMETA% --no-utf8-convert --import-tags-from="%FILE%.tags" "%FILE%_16DE.flac"
                            
                            REM delete temporary files
                            del "%FILE%.tags"
                            del "%FILE%.wav"
                            del "%FILE%_16DE.wav"
                            del "%FILE%_24.wav"
                            del "%FILE%_24DE.wav"
                            pause

                            Check where sox.exe, flac.exe and metaflac.exe are located on your own computer and amend the following lines accordingly. Making sure that only the location is changed:
                            set SOXEXE="C:\Program Files (x86)\sox-14-4-0\sox"
                            set FLC="C:\Program Files (x86)\flac\flac"
                            set FLCMETA="C:\Program Files (x86)\flac\metaflac"


                            Save the Notepad file to your Desktop using a short name such as "DE_flac.bat" (the .bat part is very important).

                            Then open Windows Explorer in a way that you can still see the DE_flac.bat icon on the desktop and drag the flac file you want to process onto the DE_flac icon. (When dragging the file it is best to avoid the top section of the left hand panel in Windows Explorer.)

                            When the process is complete you will be asked to "Press any key to continue ...". Pressing any key will close the window, but the pause enables you to check for any errors before the window closes.

                            The de-emphasised file will have the same flac filename as the original but with "_16DE" added at the end (to signify 16 bits, de-emphasised). It should also have the same tags as the original flac file.

                            The batch file will:
                            - export the existing tags to a text file named filename.tags
                            - decode the flac file to wav file named filename.wav
                            - create a new wave file with 24 bit depth named filename_24.wav
                            - de-emphasise to a wave file named filename_24DE.wav
                            - create a new de-emphasised wave file with 16 bit depth (employing noise shaped dither) filename_16DE.wav
                            - encode that to flac filename_16DE.flac
                            - import the saved tags into the new de-emphasised file
                            - delete the intermediate files
                            Last edited by johnb; 21-10-14, 12:12. Reason: Amendment to (hopefully) deal with accented characters

                            Comment

                            • Dave2002
                              Full Member
                              • Dec 2010
                              • 17865

                              #15
                              I wasn't sure if Sox is available for MacOS, but it seems it is - see http://sox.sourceforge.net/

                              If I get time and/or enthusiasm, I might try to code up and test a script file similar to the one in post 13 - maybe take a day or so - or maybe never get done if mojo doesn't return!

                              Comment

                              Working...
                              X