If I have a signal which is a mixture of sine and cosine waves with different frequencies I can easily extract one of them by designing a band pass filter with pass band frequency equal to my desired frequency.
What if I have to extract a signal that has more than one frequency components ?
For example if I have two audio signals. Obviously an audio signal contains many frequencies. Let the two audio signals be a1,a2.
Now I'm adding them like A=a1+a2;
Note that I'm not appending one audio to another. I'm adding their amplitudes.
For that I'm doing this :
[a1,fs1]=audioread('1.mp3');
[a2,fs2]=audioread('sample.mp3');
A=zeros(1,max(length(a1),length(a2)));
for i=1:length(a1)
A(i)=a1(i);
end
for i=1:length(a2)
A(i)=A(i)+a2(i);
end
Now I have a composite audio in variable A
.
Now if I want to extract a1
from A
how do I do that ? If it was a simple frequency range I would have extracted it very easily. But here both audio signals almost have same set of frequencies. Is it even possible t o extract like this ?
Thankyou :)
EDIT:
As asked for the fourier plots here I'm pasting them :
for
loops withA(1:length(a1)) = a1
andA(1:length(a2)) = A(1:length(a2)) + a2
. Then what do you mean by extractinga1
other than some variation onA - a2
? Do the two audio signals exclusively use different frequencies? – Wolfie