how to mix two audio signals
135 views (last 30 days)
W. Owen Brimijoin on 19 Jan 2015
Edited: W. Owen Brimijoin on 20 Jan 2015
Simple mixing is just adding.
y3 = y1 + y2;
If you want to control the level of each within the mix, then you need to adjust them as follows:
y3 = (y1*y1_level) + (y2*y2_level);
where yx_level is based on the decibel conversion:
yx_level = 10^(level/20);
So to make signal 2 half the amplitude of signal 1, you'd use -6 dB as follows:
y3 = (y1*(10^(0/20)) + (y2*(10^(-6/20));
All of this assumes that the two signals are the same dimensions and have the same starting level.
More Answers (1)
suresh gunarathna on 29 Jan 2020
if l1 > l2