Author Topic: Mixing digital sources/signals  (Read 2010 times)

SISKO

Mixing digital sources/signals
« on: December 16, 2012, 05:03:33 PM »
Hello, Im starting to write VST plug-ins. The representation range is limited to +-1 float.
I read somewhere (dont remember where) that when summing two input signals, both should be scaled to prevent overflow, that is: y = 1/2*x1 + 1/2*x2

While this makes (preety much) sense to me, I wanted to know if Im understading it well. Is this the way most dsp codes are written? Because of all the examples I have seen, all of them are writen in the form y= x1 + x2
--Is there any body out there??--

CynicalMan

Re: Mixing digital sources/signals
« Reply #1 on: December 16, 2012, 11:21:42 PM »
The inputs and outputs should be limited to 1, but internal floats can be any value. So it's perfectly fine to sum together signals with 1 amplitude as long as you keep the output below 1.

The y = 1/2*x1 + 1/2*x2 equation is useful for converting stereo to mono, though. It ensures that if the amplitude of a mono input will be the same whether you convert it to mono in your plugin or not.

SISKO

Re: Mixing digital sources/signals
« Reply #2 on: December 18, 2012, 04:03:15 PM »
Excellent! Thank you very!
--Is there any body out there??--