combine 2 audio sounds together
Afficher commentaires plus anciens
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!
Réponses (1)
Image Analyst
le 26 Fév 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
Catégories
En savoir plus sur Audio I/O and Waveform Generation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!