You are here

Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

For everything after the recording stage: hardware/software and how you use it.

Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby Gone To Lunch » Fri Aug 31, 2018 1:02 pm

I am in 24-bit Digital Performer 9.52 and exploring mastering down to mp3, using a PSP Xenon mastering limiter and a Fraunhofer Codec Toolbox. My question is about dithering to 16-bit pre- and post-fader.


In his review of the Fraunhofer Codec Toolbox plug-in, Sam Inglis, SOS Jan ’14, it says :

“…you place Codec Toolbox in the last insert on your master bus…”

And in the Codec manual it says, section 6.1.4 :

“The encoders in the plug-in will accept an input signal with greater than 16-bit precision, but in such cases the signal will be dithered and truncated to 16-bits prior to the encoding process. The plug-in will not introduce dither at the 16-bit level if the input to the plug-in has been already dithered and truncated to 16-bits”


In his ‘Digital Performer Tips & Techniques - All in a Dither’, SOS Feb ’15, Robin Bigwood says :

“Simply put, the DP master fader is the ideal place to instantiate your preferred bit–reduction and dither processor, because it’s conceptually at the end of the mixing signal chain. However, some care is required to do things right, because it’s all too easy to immediately increase the digital resolution again and undo the plug–in’s good work.

It’s worth looking at this in some more detail, but first I’m just going to give you the two–part solution. First, put your bit–reduction and dither plug–in in a lower slot than any others, so it’s the last plug–in in the signal chain. Then, either keep your master fader exactly on a 0dB ‘unity gain’ position or, if it’s at any other position, or you’ve got it automated for a fade–out, make sure that the insert slot occupied by your mastering plug–in is in a post–fader position. How do you do this? Take a close look at your master fader’s (or indeed any channel’s) plug–in slots. Just to the bottom left of them is a tiny, inconspicuous grey ‘notch’. Hover your mouse pointer over it and the pointer turns into a hand — the notch is draggable! Drag it up to just above the last empty plug–in slot and it should change into a blue divider line. Then drag and drop your mastering plug–in into that empty slot, so that it’s now beneath the blue line. That’s all there is to it.

Now for the explanation, if you’re game. DP carries out all mixing tasks with 32–bit floating–point resolution, regardless of whether your actual audio files are 16– or 24–bit, and even for something as apparently simple as a level cut or boost dialled in with a channel fader. Meanwhile, by default, all DP’s plug–in slots lie in a pre–fader position, which is to say that audio flows into the mixer channel, first through the plug–ins, then through the fader, and on to the output.

Back in our mastering scenario, the dither plug–in is carrying out some really clever maths, effectively distilling (or ‘quantising’) the signal chain down to 16–bit, which is what we need for a CD master. If we place another plug–in in a lower slot fail! Its processing will have caused the digital signal to revert to 32–bit format. Similarly, if the master fader is set to somewhere other than at the 0dB position, and therefore applying some level cut or boost it’s more 32–bit processing and another fail! What we need to do is put the fader before the plug–in, so that the plug–in really is the last thing in the signal chain — and that’s what dragging the plug–in slot divider is for. Plug–ins above the divider are pre–fader, while plug–ins below it are post–fader. So by placing the mastering plug–in post–fader, we make it absolutely the last thing in the signal chain.”

So my question are:

Presumably I should insert my PSP xenon post main fader, followed by the Fraunhofer Codec ?

But if I do, will this cause the signal to revert to 32-bit ?

Would this cause an avoidable un-necessary dithering process ?
Gone To Lunch
Frequent Poster
Posts: 710
Joined: Fri Jun 11, 2004 12:00 am
Location: London
http://www.gonetolunchmusic.com/

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby James Perrett » Fri Aug 31, 2018 6:07 pm

Dither just adds noise at a set level - there is no problem adding dither to a 32 (or 24) bit file, saving the file and then truncating down to 16 bits separately - provided you don't make any changes to the file between dithering and truncating. The article you quote is confusing because it assumes that the same plug-in will do both the dithering and truncation - this doesn't have to be the case.
User avatar
James Perrett
Moderator
Posts: 7549
Joined: Mon Sep 10, 2001 12:00 am
Location: The wilds of Hampshire
JRP Music - Audio Mastering and Restoration. JRP Music Facebook Page

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby Gone To Lunch » Fri Aug 31, 2018 8:19 pm

James Perrett wrote:Dither just adds noise at a set level - there is no problem adding dither to a 32 (or 24) bit file, saving the file and then truncating down to 16 bits separately - provided you don't make any changes to the file between dithering and truncating. The article you quote is confusing because it assumes that the same plug-in will do both the dithering and truncation - this doesn't have to be the case.

Thanks for taking the trouble to reply, but I am none the wiser !
Gone To Lunch
Frequent Poster
Posts: 710
Joined: Fri Jun 11, 2004 12:00 am
Location: London
http://www.gonetolunchmusic.com/

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby James Perrett » Sat Sep 01, 2018 12:29 am

Looking more carefully at your question it looks like you need a Digital Performer expert who knows how the internal interface to the plug-ins work.

Why not just set Xenon to 24 bit output? As you are saving to a compressed format anyway, does the flavour of dither really matter that much to you?
User avatar
James Perrett
Moderator
Posts: 7549
Joined: Mon Sep 10, 2001 12:00 am
Location: The wilds of Hampshire
JRP Music - Audio Mastering and Restoration. JRP Music Facebook Page

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby Uncle Freddie » Sat Sep 01, 2018 11:11 am

Gone To Lunch wrote:So my question are:

Presumably I should insert my PSP xenon post main fader, followed by the Fraunhofer Codec ?

Yes, this sounds right: PSP Xenon in front of Fraunhofer.

You have the option of setting the PSP Xenon to output either 24 bits or 16 bits, and either noise shaped or not noise shaped.

You may want to experiment. What I would do, as the simplest starting point, is set the PSP to output at 24 bits, with no noise shaping. This would give the Fraunhofer a 24 bit input that it in turn reduces to 16 bits, then encodes to MP3.

Then, for a comparison, you might want to try setting the PSP to output 16 bits, again with no noise shaping. This would give the Fraunhofer a 16 bit input that it in turn encodes to MP3.


Gone To Lunch wrote:But if I do, will this cause the signal to revert to 32-bit ?

No. If the PSP is set to output 24 bits, then the Fraunhofer receives a 24 bit input. When the Fraunhofer receives a 24 bit input, it dithers that to 16 bits, then encodes to MP3. I see no evidence that it would jump back to 32 bits.

Next, if the PSP is set to output 16 bits, then the Fraunhofer receives a 16 bit input. When the Fraunhofer receives a 16 bit input, it then encodes to MP3. Again no evidence that it would jump back to 32 bits.

In a DAW with only pre-fader plugin positions (for example, Logic) as long as you leave the master fader gain at 0.0dB, the wordlength of the signal will not jump back to 32 bits.

In a DAW like DP where you have the option of putting the plugins post-fader, then you could adjust the master fader without causing the signal to jump back to 32 bits, since the signal is being dithered after the fader.


Gone To Lunch wrote:Would this cause an avoidable un-necessary dithering process ?

No. If you set the PSP to output 24 bits, then the PSP takes the 32 bit input and dithers to a 24 bit output. The Fraunhofer receives a 24 bit input, dithers to 16 bits, then encodes to MP3. Nothing unnecessary.

If you set the PSP to output 16 bits, then the PSP takes the 32 bit input and dithers to a 16 bit output. The Fraunhofer receives a 16 bit input, then encodes to MP3. Nothing unnecessary.
Uncle Freddie
Poster
Posts: 25
Joined: Sat Apr 23, 2016 12:00 am
Location: Detroit, USA

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby CS70 » Sat Sep 01, 2018 6:33 pm

As you say, the samples the DAW processes internally are long numbers - 32 bit.
The last (rightmost) bits in the numbers represent the lowest changes in volume.

To understand why (should it be neeeded): if you take decimal representation, it's obvious that 1000 is much bigger than 0001 - and that's why because the "1" in first position counts the number of thousands, while the "1" in the fourth position counts the units. So increase the number in the first position in 1000 of one unti , from "1" to "2", and and you'll get 2000 - a much bigger number than 1000. But increase the number in fourth position (from "0" to "1"(, and you'll get 1001, which a very small change from 1000.

Bit encoding is essentially the same - with the bits on the left counting much more than bits on the right - in the sense that a change in the former represents a much different number.

Considering that audio samples simply tell the level at a certain instant in time (at 44.1Khz, 44100 instants per second), and the level is a number represented by 32 bit, the last 16 bit count quite little - you can truncate them away and you'll get relatively similar numbers - a small error.

That's what the encoding do - from the above should also be clear you can encode at 16 bit by using 32 bits - simply always leave the last 16 bit at 0! :) So you take your 32 bit numbers, zero the last 16 and voila', 16 bit encoding!

No that after the encoding, the DAW can use number representations as big as it wants, say n bits, but so long nothing changes the last n-16 bits, the actual information will be at 16 bit (so for example ready to be written down to a file in 16 bit words, ignoring the last 16).

So far so good. However, it turns out that when you try to reconstruct the original signal from these 16bit samples even these small changes, in the worst case, can amount to an audible error. These circumstances happen when you take two adiacent samples, which are 32 bits number, truncate them to 16 bits (or clear the last 16, doesn't matter) , and the resulting sequences of 1s and 0s (which represent 16-bit numbers) turn out to be numbers far enough that the D/A converter (which has to deal with real, slowish energy changes to actually reproduce the audio) simply cannot cope with the jump - it's too much difference of say voltage, too fast, and the result is ugly distortion.

Dithering at N bits removes that possibility by changing the bits in the rightmost N or (N and N-1) position(s) in a random way - where the randomness is given according to an appropriate statistical distribution. In short, it adds noise - but only in the rightmost bits, so it's not that audible (since these bits represent very small changes in level). This noise evens out the numbers so that they turn out to near enough than your regular D/A can cope.

So what matters is that you encode a N bit and dither at N bit. But what's important is that after encoding you leave the signal alone - the only thing you want to do is dithering; or after dithering you leave the signal alone - all you wanto to do is encode (and make sure you encode by truncating or zeroing the last bits). Since some encoders may do something a little more sophisticated, the safest bet is to get a 16 bit file from a 32 one is to encode first (so you end up with samples in which only the leftmost 16 bits are significant) and then dither at 16 bit.
User avatar
CS70
Frequent Poster (Level2)
Posts: 2860
Joined: Mon Nov 26, 2012 1:00 am
Location: Oslo, Norway
Silver Spoon - Check out our latest video  and the FB page

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby Gone To Lunch » Tue Sep 04, 2018 11:04 am

Thank you all for your replies, and especially CS70 for your detailed explanation of dithering.


Uncle Freddie wrote:
Gone To Lunch wrote:So my question are:

Presumably I should insert my PSP xenon post main fader, followed by the Fraunhofer Codec ?

Yes, this sounds right: PSP Xenon in front of Fraunhofer.

You have the option of setting the PSP Xenon to output either 24 bits or 16 bits, and either noise shaped or not noise shaped.


Gone To Lunch wrote:But if I do, will this cause the signal to revert to 32-bit ?

No. If the PSP is set to output 24 bits, then the Fraunhofer receives a 24 bit input. When the Fraunhofer receives a 24 bit input, it dithers that to 16 bits, then encodes to MP3. I see no evidence that it would jump back to 32 bits….

In a DAW like DP where you have the option of putting the plugins post-fader, then you could adjust the master fader without causing the signal to jump back to 32 bits, since the signal is being dithered after the fader.



But My understanding of the item is that if a plugin is instantiated post fader, after the signal has been dithered, it will jump back to 32 bit - as explained again here :

In his ‘Digital Performer Tips & Techniques - All in a Dither’, SOS Feb ’15, Robin Bigwood says :


Back in our mastering scenario, the dither plug–in is carrying out some really clever maths, effectively distilling (or ‘quantising’) the signal chain down to 16–bit, which is what we need for a CD master. If we place another plug–in in a lower slot fail! Its processing will have caused the digital signal to revert to 32–bit format. "



So am I right in thinking I do not automatically need to dither at all, because when I select .wav or .mp3 or whatever, the software doing the converting does not actually require it ? And I only need to dither when making a CD because that specifically requires a 16-bit format ?
Gone To Lunch
Frequent Poster
Posts: 710
Joined: Fri Jun 11, 2004 12:00 am
Location: London
http://www.gonetolunchmusic.com/

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby CS70 » Tue Sep 04, 2018 2:28 pm

Gone To Lunch wrote:But My understanding of the item is that if a plugin is instantiated post fader, after the signal has been dithered, it will jump back to 32 bit - as explained again here :

It will not jump back, it will stay at 32 bit as it is before and after the ditherer. :D

I think what's confusing you is that you "16bit" and "32bit" refers to two things:

a) the word-length used internally by the DAW to represent numbers. In DA I understand that's 32 bit. That means that the signal (i.e. the stream of samples) is made by 32 bit words, before and after any plugin

b) the significant bits contained in each word, i.e. the ones which carry meaningful data. You may have 32 bits available but if you use only the first two you will have 2bits dynamic range!!

Dithering at 16 bit means that the process will affect the 16th (and maybe 15th and 14th etc) bits in the word regardless of the actual word length. It may also clear (i.e. set to zero) the bits from position 17 to position 32.

So after the dithering plugin, since the data stream is still in the DAW, it's still made of 32 bit words, but only the first 16 are actually meaningful (and the 16th bit etc has been randomized)

The actual step which cuts things down to 16bit words happens only when you save data into a 16bit format (for example a 16bit/44.1 WAV file), which would save on the disk only the first 16 bit of each 32 bit word. (and by the way, If you bounce an mp3, due to the algorithm you don't actually save the samples as they are, but what gets saved on the disk depends on the first 16 bit of each 32 bit word).

Sonar/Cakewalk for example uses 64bit internally, so after a ditherer plugin you will still have 64bits words, but the last 48 bits will be meaningless - and usually zeroed.

That is why you don't want normal plugins after the ditherer - because they would take your nice 32bits words (whose last 16 bit are zeroed) and treat them like a regular 32bit stream, and produce words whose entire 32 bits are significant - so that you would have to dither again... having already added noise in the middle, which is not a good thing.

One more thing that can help clarify is the opposite process -when you record, you usually record 24 bits words.. but when the file is loaded into DP (which uses 32bit internally) each word is given 8 more bits on the right, all zeros - so you have 32bit words where only the first 24 are actually meaningful.

And I only need to dither when making a CD because that specifically requires a 16-bit format ?

In general 44.1 samples per second, each at 16 bit of length, allow to represent all the sample levels you need in order to reproduce any music very well. So most playable formats work with that word length.

But if you save with DP to a format which happens to use 32 bit word length (like another variation of WAV for example), you would not need to dither - because no truncation would occur when you save the samples to disk.

It's just that a 32bit format uses double the space for no reason, so they are not very popular (not to talk 64bit).
User avatar
CS70
Frequent Poster (Level2)
Posts: 2860
Joined: Mon Nov 26, 2012 1:00 am
Location: Oslo, Norway
Silver Spoon - Check out our latest video  and the FB page

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby resistorman » Tue Sep 04, 2018 2:43 pm

Why worry about all this during mixdown? I always do all format changes on the stereo file after the mixing and mastering is done.
User avatar
resistorman
Frequent Poster
Posts: 584
Joined: Sun Nov 22, 2015 1:00 am
Location: Asheville NC
future26.com

Re: Mastering to MP3 - PSP Xenon - Fraunhofer Codec Toolbox

Postby CS70 » Tue Sep 04, 2018 2:51 pm

resistorman wrote:Why worry about all this during mixdown? I always do all format changes on the stereo file after the mixing and mastering is done.

Well you do need to send a file to the mastering house. If you save to a format which has a lower word length that what's used by your DAW, you may want to dither.

For example, I tend to send 24bits WAV, which with Cakewalk implies discarding 48 bits from the internal word length. It's true that the mastering house will return a file whose word length is cut further, and probably any distortions due to consecutive samples discrepancies in the 24th bit will be very small and almost inaudible to them, but so will be the corresponding dither noise, so it's a good idea to dither anyway.

If you send a file with the same word length that your DAW uses, no need of course - it's just gonna take longer time to send via network because you tend to have a big file.
User avatar
CS70
Frequent Poster (Level2)
Posts: 2860
Joined: Mon Nov 26, 2012 1:00 am
Location: Oslo, Norway
Silver Spoon - Check out our latest video  and the FB page


Who is online

Users browsing this forum: No registered users