RonK: 64 bit Plug-ins and Summing

Page: < 123 Showing page 3 of 3
Author
Master Chief [Cakewalk]
Max Output Level: -69 dBFS
  • Total Posts : 1053
  • Joined: 2003/11/03 19:20:44
  • Location: Boston, MA, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 09:34:35 (permalink)
Sorry for jumping into this thread so late. We've been trying to coming up with a very simple example to illustrate the benefits of 64-bit double precision mixing. I've got one now. (Thanks to Aurelio Ramos, s/w engineer at Cakewalk, for coming up the idea for how to simply demonstrate this.)

In a nutshell: if you are processing 24-bit audio, and you start mixing many tracks where some volumes are > 0dB and some volumes are < 0dB, then due to the way floating point summation is done you are susceptible to loss of accuracy in the summation.

For those of you who are C/C++ programmers, the following program demonstrates this phenomenon:

void test()
{
const double dScale24 = (double)(1 << 23);
const double dGain = 2.0;
const double dAtten = 0.5;

const int nPCM24Orig = 0x5000FF;
double dSamp = (double)nPCM24Orig / dScale24;
float fSamp = (float)dSamp;

float fSum = 0;
fSum += (float)( dGain * fSamp );
fSum += (float)( dAtten * fSamp );
fSum += (float)( -dGain * fSamp );
fSum = (float)( dGain * fSum );
int nPCM24FromFloat = (int)(fSum * dScale24 + 0.5);

double dSum = 0;
dSum += (double)( dGain * dSamp );
dSum += (double)( dAtten * dSamp );
dSum += (double)( -dGain * dSamp );
dSum = (double)( dGain * dSum );
int nPCM24FromDouble = (int)(dSum * dScale24 + 0.5);

printf("Original: %lX, FromFloat: %lX, FromDouble: %lX\n", nPCM24Orig, nPCM24FromFloat, nPCM24FromDouble);
}
The program's output is:
Original: 5000FF, FromFloat: 500100, FromDouble: 5000FF

What this program does is perform the summation (X*2 + X/2 - X*2) * 2. You can imagine it as a 3 track project with the same file on each track. Track 1's gain is +6dB. Track 2's gain is -6dB. Track 3's gain is also +6dB but the track's phase is flipped. All 3 tracks are bused into a bus whose gain is +6dB. The answer should of course be X, i.e., the signal produced on the bus output should be the same as the track data but at unity gain.

What the program shows is if X is a 24-bit PCM sample, and the math is done using floats, the result is *not* X. The least significant bit is lost. If the gain adjustments are more dramatic, or more gain stages are used, then more bits can be lost.

We've prepared a test project that demonstrates this behavior in a clearly audible fashion. We'll post a link as soon as we can.
#61
urock
Max Output Level: -80 dBFS
  • Total Posts : 501
  • Joined: 2004/02/04 20:52:33
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 11:01:55 (permalink)

ORIGINAL: Ron Kuper [Cakewalk]

We've prepared a test project that demonstrates this behavior in a clearly audible fashion. We'll post a link as soon as we can.



I just finished an 18 song project in Sonar 4 PE for my band that I had sent off to my bandmates to get mastered. Each song uses numerous tracks and approx. 10 buses with effects (UAD-1, Sonitus, etc.). If I get the upgrade (), load the S4 projects into S5 and simply re-export the audio, is it likely that I will hear a noticable difference?

Best

urock

#62
DonM
Max Output Level: -34 dBFS
  • Total Posts : 4129
  • Joined: 2004/04/26 12:23:12
  • Location: Pittsburgh
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 11:13:22 (permalink)
Ron:

Thanks a billion (pun) for your input. As you can see from this threads' popularity and scholarship a bunch of us see what you are doing as very signifiicant.

I suspect this is one of the key differentiators Sonar compared to the rest of the industry. It would be very helpful to me in my world of NPR to articulate the advantages when bidding jobs that require competitors products for 'fidelity' reasons.

I look forward to the test and how we can help.

-D

____________________________________
Check out my new Album  iTunesAmazonCD Baby and recent Filmwork, and Client Release
 
#63
VariousArtist
Max Output Level: -63 dBFS
  • Total Posts : 1397
  • Joined: 2003/11/07 15:03:09
  • Location: London, UK & California, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 11:43:51 (permalink)
Ron Kuper [Cakewalk]
Sorry for jumping into this thread so late. We've been trying to coming up with a very simple example to illustrate the benefits of 64-bit double precision mixing. I've got one now. (Thanks to Aurelio Ramos, s/w engineer at Cakewalk, for coming up the idea for how to simply demonstrate this.)

In a nutshell: if you are processing 24-bit audio, and you start mixing many tracks where some volumes are > 0dB and some volumes are < 0dB, then due to the way floating point summation is done you are susceptible to loss of accuracy in the summation.

For those of you who are C/C++ programmers, the following program demonstrates this phenomenon:


void test()
{
const double dScale24 = (double)(1 << 23);
const double dGain = 2.0;
const double dAtten = 0.5;

const int nPCM24Orig = 0x5000FF;
double dSamp = (double)nPCM24Orig / dScale24;
float fSamp = (float)dSamp;

float fSum = 0;
fSum += (float)( dGain * fSamp );
fSum += (float)( dAtten * fSamp );
fSum += (float)( -dGain * fSamp );
fSum = (float)( dGain * fSum );
int nPCM24FromFloat = (int)(fSum * dScale24 + 0.5);

double dSum = 0;
dSum += (double)( dGain * dSamp );
dSum += (double)( dAtten * dSamp );
dSum += (double)( -dGain * dSamp );
dSum = (double)( dGain * dSum );
int nPCM24FromDouble = (int)(dSum * dScale24 + 0.5);

printf("Original: %lX, FromFloat: %lX, FromDouble: %lX\n", nPCM24Orig, nPCM24FromFloat, nPCM24FromDouble);
}
The program's output is:

Original: 5000FF, FromFloat: 500100, FromDouble: 5000FF

What this program does is perform the summation (X*2 + X/2 - X*2) * 2. You can imagine it as a 3 track project with the same file on each track. Track 1's gain is +6dB. Track 2's gain is -6dB. Track 3's gain is also +6dB but the track's phase is flipped. All 3 tracks are bused into a bus whose gain is +6dB. The answer should of course be X, i.e., the signal produced on the bus output should be the same as the track data but at unity gain.

What the program shows is if X is a 24-bit PCM sample, and the math is done using floats, the result is *not* X. The least significant bit is lost. If the gain adjustments are more dramatic, or more gain stages are used, then more bits can be lost.

We've prepared a test project that demonstrates this behavior in a clearly audible fashion. We'll post a link as soon as we can.


Simple, but great example if you are programmatically inclined, to illustrate the point of this thread.

Note for those out there that might try to compile and run this example (say in Visual C++ which is more common these days), don't forget to include the "StdAfx" library to handle the output statements (i.e. printf):

#include "stdafx.h"

Looking forward to the example that demonstrates the 64-bit stuff now...
#64
CapnSpanky
Max Output Level: -79 dBFS
  • Total Posts : 581
  • Joined: 2003/11/20 13:15:12
  • Location: Nashville, TN
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 11:58:15 (permalink)
Using my abacus to translate the C++ hexidecimal into MHz, I've determined that Sonar 5 will sound 20 to 40 percent better.

Tim Wells
-------
Cap'n Spanky
From the Planet Screwball
#65
jt
Max Output Level: -89 dBFS
  • Total Posts : 79
  • Joined: 2003/12/12 10:36:11
  • Location: Rochester, NY
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 12:59:31 (permalink)
Ron,

Interesting, I tried this in both VS6 and in .NET. I get the same result as you with VS6. However, with .net the result is:

Original: 5000FF, FromFloat: 5000FF, FromDouble: 5000FF

Edit: The above result was using the default optimization settings in .NET.

Original: 5000FF, FromFloat: 5000FF, FromDouble: 5000FF (with /O2 option)
Original: 5000FF, FromFloat: 500100, FromDouble: 5000FF (with /Od option)
post edited by jt - 2005/09/23 13:51:44
#66
VariousArtist
Max Output Level: -63 dBFS
  • Total Posts : 1397
  • Joined: 2003/11/07 15:03:09
  • Location: London, UK & California, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 13:11:37 (permalink)
Ron,

Interesting, I tried this in both VS6 and in .NET. I get the same result as you with VS6. However, with .net the result is:

Original: 5000FF, FromFloat: 5000FF, FromDouble: 5000FF


I got the same result as Ron K:

Original: 5000FF, FromFloat: 500100, FromDouble: 5000FF

Note that the size of data types can vary across operating systems and hardware -- or perhaps there's some configuration setting that you have in VS6 that is different to me that is causing your data types to behave differently....there's probably some esoteric, yet logical, explanation for this difference.

Of course, I'm assuming that you typed in the code from Ron's post verbatim?
#67
jt
Max Output Level: -89 dBFS
  • Total Posts : 79
  • Joined: 2003/12/12 10:36:11
  • Location: Rochester, NY
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 13:17:09 (permalink)
My bad. After playing around with the changing default optimization parameter (/O2) which gave me a different answer than Ron. When I switched it to (/Od) I got the same answer as Ron in .NET.
#68
Master Chief [Cakewalk]
Max Output Level: -69 dBFS
  • Total Posts : 1053
  • Joined: 2003/11/03 19:20:44
  • Location: Boston, MA, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 14:13:45 (permalink)
Right. /O2 disables the "ensure float consistency" feature. It generates faster code but causes floats to be more precise than their actual representation. Since in a real DAW samples would be mixed back down into buffers, rewritten as floats, this optimization wouldn't have any effect on the DAWs summation code.
#69
Richard Brian
Max Output Level: -40 dBFS
  • Total Posts : 3519
  • Joined: 2004/02/09 11:16:38
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 15:08:37 (permalink)
Using my abacus to translate the C++ hexidecimal into MHz, I've determined that Sonar 5 will sound 20 to 40 percent better.


It only caused me to make a beer run.
#70
DonM
Max Output Level: -34 dBFS
  • Total Posts : 4129
  • Joined: 2004/04/26 12:23:12
  • Location: Pittsburgh
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/23 19:39:29 (permalink)
Now I'm wondering if someone can write (capture) an impulse file that simulates the 3rd order (or wherever) harmonic distortion of a NEVE console that I can process in the master bus using the new convolution tool (perfect space) then I can mix in-the-box and no-one will ever know ...

-D

____________________________________
Check out my new Album  iTunesAmazonCD Baby and recent Filmwork, and Client Release
 
#71
kylen
Max Output Level: -79 dBFS
  • Total Posts : 578
  • Joined: 2003/11/25 19:30:06
  • Location: Southern WV, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/24 00:46:20 (permalink)
Here's some Neve Impulses that include the EQ curve and phase (I think):
http://www.noisevault.com/index.php?option=com_remository&Itemid=29&func=selectcat&cat=19

Of course that doesn't include the dynamics and distortion of the real thing...I'm still looking for that maybe Warmifier or AF Tapebus might have some punch - not exactly though...I'm still looking for the sound.

I realize one or both of us are just kidding...or are we?
#72
DonM
Max Output Level: -34 dBFS
  • Total Posts : 4129
  • Joined: 2004/04/26 12:23:12
  • Location: Pittsburgh
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/24 07:14:33 (permalink)
LOL Kylen.. All of this math needs a break (unfortunately I love the math stuff as much as a good sounding mix - they are intrisictly related)
-D

____________________________________
Check out my new Album  iTunesAmazonCD Baby and recent Filmwork, and Client Release
 
#73
VariousArtist
Max Output Level: -63 dBFS
  • Total Posts : 1397
  • Joined: 2003/11/07 15:03:09
  • Location: London, UK & California, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/29 13:56:18 (permalink)
LOL Kylen.. All of this math needs a break (unfortunately I love the math stuff as much as a good sounding mix - they are intrisictly related)


Yes DonM, they are "intrinsically related" and it's not always a trivial matter trying to understand it or, harder still, get others to understand it. It's easier to get tripped up though and, although maths is my subject (both academically as well as from a genuine interest outside of my studies), I still find myself having to revisit some of the fundamentals -- especially in the topic of "Numerical Analysis", an area of mathematics that is almost a subject in its own right and one that forms the basis for this entire debate about number crunching in computers.

It's easy to jump to the wrong conclusions and "join the dots" in the wrong way -- and a lot of misinformation is bandied about. The mob rule of misinformation on the net can obscure the facts that are true regardless of anyone's intuitions or gut feelings about the subject.
#74
Guest
Max Output Level: -25.5 dBFS
  • Total Posts : 4951
  • Joined: 2009/08/03 10:50:51
  • Status: online
RE: RonK: 64 bit Plug-ins and Summing 2005/09/29 16:27:48 (permalink)
ORIGINAL: Ron Kuper [Cakewalk]

Right. /O2 disables the "ensure float consistency" feature. It generates faster code but causes floats to be more precise than their actual representation. Since in a real DAW samples would be mixed back down into buffers, rewritten as floats, this optimization wouldn't have any effect on the DAWs summation code.



damn .. ron knows optimizer levels in VC ... i'm impressed .. reminds me of that Dan Akroyd
sketch when he was playing Jimmy Carter on a call in line " .. ok .. you've taken orange
sunshine ... " ;-)

jeff
post edited by jmarkham - 2005/09/29 16:36:05
#75
newfuturevintage
Max Output Level: -57 dBFS
  • Total Posts : 1848
  • Joined: 2004/11/04 20:35:09
  • Location: o'land, ca
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/09/29 19:50:01 (permalink)
you've taken orange sunshine


"do you have any Allman Brothers?".....good stuff.....

My inner child is an angry drunk.
#76
Jonny Mumra
Max Output Level: -89 dBFS
  • Total Posts : 54
  • Joined: 2005/11/09 04:45:10
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 08:52:25 (permalink)
Has this thread died.
#77
Skyline In The Office
Max Output Level: -88 dBFS
  • Total Posts : 147
  • Joined: 2004/09/22 05:47:55
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 09:14:35 (permalink)
There's some heavy stuff here that I can't begin to understand but I bow to the superior knowledge on display. So...... if i sum up for my own benefit: for the best fidelity in S5P (end product being an audio CD or MP3) I should record at 44.1 kHz at 24bit with the 64 bit precision box ticked, yes?
#78
Master Chief [Cakewalk]
Max Output Level: -69 dBFS
  • Total Posts : 1053
  • Joined: 2003/11/03 19:20:44
  • Location: Boston, MA, USA
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 10:16:05 (permalink)
We have posted my presentation from AES about x64 technology and also about double-precision mixing, here.

More pertinent to this discussion, we've also posted the source code for a test program I wrote to illustate the improved accuracy of summing with 64-bit double precision arithmetic. The ZIP file is here.
#79
markheath
Max Output Level: -82 dBFS
  • Total Posts : 408
  • Joined: 2003/12/30 05:28:55
  • Location: Southampton, England
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 10:22:26 (permalink)
ORIGINAL: Skyline In The Office
So...... if i sum up for my own benefit: for the best fidelity in S5P (end product being an audio CD or MP3) I should record at 44.1 kHz at 24bit with the 64 bit precision box ticked, yes?


Oh no! You've just started three more pages of arguments

For targetting audio CD, the basic setting is
44.1KHz, 16bit file depth, 32bit audio engine. This is actually fine for many hobbyists who aren't planning to sell their work.

If you want higher quality, then I would suggest prioritising improvements in this way
1) 24 bit file depth
2) 88.2 or 96kHz sample rate
3) 64 bit precision engine

With each of those enhancements the likelihood of you actually being able to hear the difference decreases. These enhancements will also put extra strain on your CPU, disk usage and RAM requirements. If you have cheap microphones, mixer and monitors (like me ), then it hardly seems worth going all the way up to 24/96 with 64bit engine. Who needs a higher quality recording of the next door neighbours flushing their toilet during your best vocal take?

#80
Skyline In The Office
Max Output Level: -88 dBFS
  • Total Posts : 147
  • Joined: 2004/09/22 05:47:55
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 10:31:06 (permalink)
Thanks Mark. I usually use 48kHz and 24bit, and I assume it certainly won't do any harm to tick the 64 bit precision as well. My (old and shot) ears won't hear the difference, but it's still nice to know I'm producing something of slightly higher quality. My ears wouldn't be so bad if I'd followed your example and always wore ear defenders when sounding the dinner gong ..
#81
Jonny Mumra
Max Output Level: -89 dBFS
  • Total Posts : 54
  • Joined: 2005/11/09 04:45:10
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 10:38:24 (permalink)
I wouldnt be so quick to use 96khz even though this is another topic all together.

Remember your music still has suffer the final toll of samlerate conversion to 44.1.

Also ask yourself if the mics you are using to record instruments with are capturing sound above 20k as most do not.

FWIW i believe 44.1 24bit 64bit option would be your best bet if your final destination is cd.
#82
markheath
Max Output Level: -82 dBFS
  • Total Posts : 408
  • Joined: 2003/12/30 05:28:55
  • Location: Southampton, England
  • Status: offline
RE: RonK: 64 bit Plug-ins and Summing 2005/11/11 11:30:12 (permalink)
We have posted my presentation from AES about x64 technology and also about double-precision mixing, here.


Great talk Ron. How long before we have 64 bit plugins simulating the "classic" sound of a 32 bit mixing engine?

#83
Page: < 123 Showing page 3 of 3
Jump to:
© 2025 APG vNext Commercial Version 5.1