how to mix two audio signals
Show older comments
i have two audio signals y1 ,y2 .Now i wants y3 as mixture of y1 and y2
Accepted Answer
More Answers (1)
suresh gunarathna
on 29 Jan 2020
0 votes
function [Y,f]=togau(A,B)
[x1,f1]=audioread(A);
[x2,f2]=audioread(B);
[l1,c1]=size(x1);
[l2,c2]=size(x2);
if l1 > l2
l=l2;
else
l=l1;
end
if(f1>=f2)
f=f1;
else
f=f2;
end
G=zeros(1,1);
t=0;
token=0;
for i=1:l
if t==f
if token==0
token=1;
t=0;
else
token=0;
t=0;
end
end
if(token==0)
G(i)=x1(i);
t=t+1;
else
G(i)=x2(i);
t=t+1;
end
end
Y=G;
audiowrite('out.wav',Y,f);
end
Categories
Find more on Audio Processing Algorithm Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!