Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Audio CD pre-emphasis and ripping (Read 5944 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Audio CD pre-emphasis and ripping

If an Audio CD uses pre-emphasis, rather than using somithing like sox to alter the digital bits, is there a metadata tag that can be added to alert playback software that it needs to apply de-emphasis after decode?

It seems to me that would be the proper way to do it, and it seems to me that is how some software that rips to a single file with a cue sheet does it (noting it has had pre-emphasis added in the cue sheet)

Does such a meta-tag exist that players (e.g. foobar2000) will act upon?

And I guess another question, would keeping the original bits alter the proper replay-gain?

Audio CD pre-emphasis and ripping

Reply #1
If you want to have a bit perfect copy of the CD, then I would use an image with no processing.

For anything else, you should decode the pre-emphasis fully, as there is no reason to have partially decoded PCM.  And yes, feeding an incorrectly decoded signal to replaygain will give you a (somewhat) different value.

Audio CD pre-emphasis and ripping

Reply #2
This IMHO is one of the benefits of doing it with a tag -

``There are also some CDs which people believe were mastered with pre-emphasis, but which have no pre-emphasis flags set at all.'' from http://wiki.hydrogenaudio.org/index.php?title=Pre-emphasis

Keeping the data the way it was on the CD allows use of a tag to specify whether it should be applied by default or not, rather than relying upon knowing for sure when the media is ripped.

Audio CD pre-emphasis and ripping

Reply #3
If no flag is set, then any automated processing will not apply de-emphasis anyway, and so you will always get the unmodified PCM data.  In that case, its up to you to decide (subjectively) if the CD requires it and then process it if needed.

Audio CD pre-emphasis and ripping

Reply #4
If no flag is set, then any automated processing will not apply de-emphasis anyway, and so you will always get the unmodified PCM data.  In that case, its up to you to decide (subjectively) if the CD requires it and then process it if needed.


Right - but you can simply add a tag that sets the flag, which also would work with rips made from CDs that had the flag but using ripping software that neglected to care about the flag. Especially useful for lossy rips, as that would not require a re-encode.

Audio CD pre-emphasis and ripping

Reply #5
Yes, this exists. It’s only logical for something that’s just a flag on a CD to be supported in the same way by CD rippers/players

Here are your options as far as I know, although others probably exist:
• cuesheet: line: FLAGS PRE
• and/or fb2k + a specific metadata field: http://www.hydrogenaudio.org/forums/index....howtopic=100196

More generally, there’s an article about emphasis on our Knowledgebase, which you may like to read and/or update: http://wiki.hydrogenaudio.org/index.php?title=Pre-emphasis

Audio CD pre-emphasis and ripping

Reply #6
Especially useful for lossy rips, as that would not require a re-encode.


IMHO it's better to do de-emphasis before a lossy compression.

Audio CD pre-emphasis and ripping

Reply #7
I keep my lossless files unaltered, that includes un-deemph'd, and use fb2k to process on-the-fly.

Now here is a tip for those who are as paranoid as I am:
I use a different file format - WavPack rather than FLAC - for CD rips with pre-emphasis. Should I then accidentally delete the tag, then I know from codec and filetype (and a flag in folder name).

Good for peace of mind, and besides I finally had an excuse to use WavPack. Maybe I should use TAK for my only DTS CD - paying tribute to two formats that are cool but unfortunately not #1 ;-)

Audio CD pre-emphasis and ripping

Reply #8
IMHO it's better to do de-emphasis before a lossy compression.
I agree - but then it's ironic that of all formats, mp3 has a pre-emphasis flag that is included in the format's header - i.e. it's there if you use any tagging format, or no tags at all.

I don't know if anything uses it (writes it, reads it, applies it). Like you, I wouldn't trust it.

Cheers,
David.

Audio CD pre-emphasis and ripping

Reply #9
I don't know if anything uses it (writes it, reads it, applies it). Like you, I wouldn't trust it.

From lame --longhelp:
Code: [Select]
lame -e <emp>  de-emphasis n/5/c (obsolete)

On the other hand, libavcodec seems to just ignore emphasis bits in MPEG audio header (mpegaudiodecheader.c).

Audio CD pre-emphasis and ripping

Reply #10
I've been thinking about this...

Either way the "bit perfect" audio is obviously not, what you want to hear...   

From a technical point of view, I don't think it matters if you keep it bit perfect and alter/correct the data stream later at playback time (or alter the analog signal), or if you permanently alter the data in the file.   

From a convenience point of view, I'd go ahead and permanently alter the file and be done with it (if I ever run-across a pre-emphasized CD).

Audio CD pre-emphasis and ripping

Reply #11
There is one technical difference between altering the data vs. applying de-emphasis when played. If you apply de-emphasis and then store the result in 16 bits, you will be adding (probably inaudible) noise, whereas applying it when played you can perform the calculations at higher resolution.

After all, the reason for using pre-emphasis was to increase the SNR, which benefit you lose if you convert to 16 bits after removing pre-emphasis.

Audio CD pre-emphasis and ripping

Reply #12
After all, the reason for using pre-emphasis was to increase the SNR, which benefit you lose if you convert to 16 bits after removing pre-emphasis.


I wouldn't worry. The reason was quantization noise, reduced by attenuating the treble in the analogue domain. Doing it in the digital domain was contrary to purpose in any case.
Fortunately, after oversampling came around, quantization noise should not be much of an issue anymore, and one can safely process before the DAC.

More: http://www.hydrogenaudio.org/forums/index....st&p=729276

Audio CD pre-emphasis and ripping

Reply #13
If I intentionally change a CD rip (for whatever reason), I keep the original version as
original_filename.flac.original

Nothing will play it or transcode it, but I can go back to it manually if needs be.

The new version (with fixed glitches or changed EQ or applied de-emphasis or whatever other change I felt needed to be made) just gets the original filename and sits as a normal part of my library.

It's overkill, but this happens to so few tracks that it's hardly wasting any space. Even if the only use for the "wrong" version is to post as an example on HA, it's easier to keep it like this than to go and find the original CD and re-rip it.

I keep the .original files in the same folder as the normal ones. If I kept them separately I'd lose them.

Cheers,
David.