combine 2 audio sounds together
Ältere Kommentare anzeigen
I have two audio files with the same length and sample rate. I would like to sum these two signals together to create a new signal: sum[n] = audio1[n] + audio2[n]*(-1)^n.
I would like to know how to implement these operations using MATLAB.
thank!
Antworten (1)
Image Analyst
am 26 Feb. 2023
Don't use "sum" as the name of your variable since that is a very important function that you'll no longer be able to use if you do that.
theSum = mean([audio1; audio2]);
If you want you can transform audio2 like
weights = (-1) .^ (1:n)
audio2 = audio2 .* weights;
before you do the sum
Kategorien
Mehr zu Audio I/O and Waveform Generation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!