Bharat
Bharat

Reputation: 1082

Extracting a signal with multiple frequency components in matlab

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 :

Plot 1

Plot 2

Upvotes: 1

Views: 666

Answers (1)

Yurii Mytiai
Yurii Mytiai

Reputation: 41

If you have one reference signal s1 you can just subtract it from summary signal A and get target signal: s2 = A - s1.

But if you don't have one of those signal you can't get separate one. There are infinity number of compositions of different signals s1 and s2 that can create A like s1+s2. So it's imposible po separate them.

Upvotes: 1

Related Questions