Combining two sounds digitaly?
I am trying to find out how to combine two sound waves together digitaly, i need to know how to do this on each individual sample mathmaticaly (don't point me in the direction of some mixing program or function) . I have read that it requires adding each sample squared to get the composite sample squared but whenever i try this i get a horible screaching noise. (i am square rooting the final value)
Answers:
Just add them together sample by sample. Squaring them is destroying the negative values. (Just think of a sine wave.)
The distortion must be terrible!
Note however if when you add them the sum exceeds a certain value you will get some overload. If the sample values are modest to start with this will not happen.
Squaring the values would work in theory but in digital audio you have a limited dynamic range. If values are squared they are surely going way above this range, resulting in clipping, creating a loud square wave...screeeeech. Look for the highest bit rate possible, which would be 24, to have the most dynamic range possibly. This way the highest number you can have is BIN 111111111111111111111111.
Also, quarkel is right. Squaring the values will always return the absolute value, thus getting rid of negative values. I agree that simply adding them together would work fine, in theory. Just watch your dynamic range!
how long do carbohydrates stay in your body before they become fat?
Via Selective Breeding, could we make humans that are giants and hobbits?
Why is it impossible to sneeze with your eyes open?
if you added oxygen to an hydrocarbon could the result be carbohydrate?
why do ppl say 'i fell up the stairs'? you can only fall downwards!?
what is 2m82 on a scale of 1:50?
Do you get wetter by fat rain drops or fine rain drops?
Can a small electric motor produce more power than it takes to run it?
Answers:
Just add them together sample by sample. Squaring them is destroying the negative values. (Just think of a sine wave.)
The distortion must be terrible!
Note however if when you add them the sum exceeds a certain value you will get some overload. If the sample values are modest to start with this will not happen.
Squaring the values would work in theory but in digital audio you have a limited dynamic range. If values are squared they are surely going way above this range, resulting in clipping, creating a loud square wave...screeeeech. Look for the highest bit rate possible, which would be 24, to have the most dynamic range possibly. This way the highest number you can have is BIN 111111111111111111111111.
Also, quarkel is right. Squaring the values will always return the absolute value, thus getting rid of negative values. I agree that simply adding them together would work fine, in theory. Just watch your dynamic range!
The answers post by the user, for information only, UKQnA.com does not guarantee the right.