flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Heap > What is the Correct Sound Mixing Math?

Author
Thread Post new topic Reply to topic
rocketsoft



Joined: 26 Jan 2010
Posts: 171

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!
Post 14 Aug 2017, 09:41
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 1071

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.
Post 14 Aug 2017, 11:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15641
Location: Thasus


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.
Post 14 Aug 2017, 16:13
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 1071

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.
Post 14 Aug 2017, 17:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15641
Location: Thasus

I don't see how it helps to explain that tripling the signal voltage gives nine times the power output. Confused
Post 14 Aug 2017, 17:16
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 1071

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. Wink

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.
Post 14 Aug 2017, 17:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15641
Location: Thasus

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.
Post 14 Aug 2017, 17:58
View user's profile Send private message Visit poster's website Reply with quote
rocketsoft



Joined: 26 Jan 2010
Posts: 171

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
Post 14 Aug 2017, 20:43
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 1071

That hurts my eyes, looks like obfuscated math. Razz
Post 15 Aug 2017, 14:27
View user's profile Send private message Reply with quote
rocketsoft



Joined: 26 Jan 2010
Posts: 171

correct Revolution 1+1+1=9 watts!
lol and 1+1=4 watts... its not even linear!
Post 19 Aug 2017, 21:13
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15641
Location: Thasus


rocketsoft wrote:
correct Revolution 1+1+1=9 watts!
lol and 1+1=4 watts... its not even linear!

It's quadratic.

(1 + 1 + 1) ^ 2 = 9
Post 20 Aug 2017, 04:36
View user's profile Send private message Visit poster's website Reply with quote
rocketsoft



Joined: 26 Jan 2010
Posts: 171

spice:says linear mixing produces NO distortion.linear mixing is only correct mixing.Case closed!
Post 18 Dec 2017, 23:26
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

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


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.