flat assembler
Message board for the users of flat assembler.
 flat assembler > Heap > What is the Correct Sound Mixing Math?
Author
rocketsoft

Joined: 26 Jan 2010
Posts: 166
What is the Correct Sound Mixing Math?
An open question...
normally they are just added:
but:1+1=2 volts
gives 1+1=4 watts!(not correct!)
yet everyone uses additive mixing!
14 Aug 2017, 09:41
Furs

Joined: 04 Mar 2016
Posts: 861
If by volts you mean sound level (amplitude), then that is correct. Power is amplitude squared so there's nothing wrong there at all. That's because amplitude has both positive and negative values.
14 Aug 2017, 11:23
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15233
Location: 1I/ʻOumuamua
 Furs wrote: That's because amplitude has both positive and negative values.
I thought it was because the current follows the voltage when the load remains the same. P=VI, where I=V/R, leads to P=V^2/R, so where R is a constants P ~ V^2.
14 Aug 2017, 16:13
Furs

Joined: 04 Mar 2016
Posts: 861
Ehm, I wasn't speaking about math but an intuitive grasp of why it may seem "counterintuitive" for some people. After all, audio is mixed probably in software these days almost everywhere, where there's no volts, but the same mixing (with addition) happens.
14 Aug 2017, 17:11
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15233
Location: 1I/ʻOumuamua
I don't see how it helps to explain that tripling the signal voltage gives nine times the power output.
14 Aug 2017, 17:16
Furs

Joined: 04 Mar 2016
Posts: 861
Because V includes a negative counterpart. Well rocketsoft is confused why "mixing" two audio sources results in something 4x the power output. Intuitiveness (?) is obviously subjective though, so idk how to explain it if others don't get it. (maybe I "picture" it wrong anyway but is enough intuitive for me)

I mean yeah you can say, well because the math says so, but he's confused why that is even correct in the first place.

Personally, I think of it as due to it having negative counterpart. When we say 5V (amplitude) it means it oscillates +5/-5 over time. So why isn't it -5V? Because it doesn't matter with squaring: -x^2 = x^2.
14 Aug 2017, 17:29
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15233
Location: 1I/ʻOumuamua
Re: What is the Correct Sound Mixing Math?
 rocketsoft wrote: An open question... normally they are just added: but:1+1=2 volts gives 1+1=4 watts!(not correct!) yet everyone uses additive mixing!
I think that if you want to keep the same power level after mixing then you can use:

output = sqrt(1/2) * (input0 + input1)

This assumes you are adding voltages together and that the output is also a voltage level.
14 Aug 2017, 17:58
rocketsoft

Joined: 26 Jan 2010
Posts: 166
sqrt(1/2)*(4 + 8)=0.707*12=8.484
(18 watts.... close but no sigar)
4 watts + 16 watts=20 watts
4 ohm!
P=I*I*R
I=sqrt(P/R)
U=I*R
U=sqrt((U*U)/(R*R))*R?
U=sqrt(144/16=9)*4?
12=not correct! (always original U)
restart!
P1=(4v*4v)/4ohm=4Watt, P2=16watt
P=P1+P2
P=I*I*R
I=sqrt(P/R)
U=I*R ... exact!
For 1 Ohm:
P1=U1*U1, P2=U2*U2, P=P1+P2,P=I*I
I=sqrt(P)
U=I
P1=4*4=16,P2=8*8,P=16+64=80
U=sqrt(80)=8.9=correct
conclusion:simple math for perfect mixing
so...
Output=sqrt(U1*U1+U2*U2+U3*U3+...)
Otherwise very audible Distortion!!!
I guess I answered my own question.
Note...sqrt and squares are Sign-Sensitive!
sssqrt+ssmul... notify intel
2 new sign-sensitive fpu instruction
"PowersMixer(TM)" I call this new mixer!
Even better... its now possible to mix
1024 channels instead of max.32
with classic level(voltage) summers
square root of sum of squares
Contracts with companies are needed...
all middle men(n) get 50%/n and I get 50% too... fair is fair!
We will be bigger than Dolby(TM)!!!!!
I Want 1% of shares from OS producers!
10% of all other companies that use mixers!!! ;-)

Last edited by rocketsoft on 19 Aug 2017, 21:10; edited 3 times in total
14 Aug 2017, 20:43
Furs

Joined: 04 Mar 2016
Posts: 861
That hurts my eyes, looks like obfuscated math.
15 Aug 2017, 14:27
rocketsoft

Joined: 26 Jan 2010
Posts: 166
correct Revolution 1+1+1=9 watts!
lol and 1+1=4 watts... its not even linear!
19 Aug 2017, 21:13
revolution
When all else fails, read the source

Joined: 24 Aug 2004
Posts: 15233
Location: 1I/ʻOumuamua
 rocketsoft wrote: correct Revolution 1+1+1=9 watts! lol and 1+1=4 watts... its not even linear!

(1 + 1 + 1) ^ 2 = 9
20 Aug 2017, 04:36
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum General----------------MainDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsCompiler InternalsIDE DevelopmentOS ConstructionNon-x86 architecturesHigh Level LanguagesProgramming Language DesignProjects and IdeasExamples and Tutorials Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou can attach files in this forumYou can download files in this forum