MATLAB: Sum of signals and filter the sum and recuperate the inicial frequencies

filterfilteringsum of signals

Hello, I am new to matlab,
I would like to generate two diffrent sinus signal with diffrent frequencies f1 and f2. One generated I want to do the sum of them (let's call it totalSignal) . Next, I want t filter the total signal and recuperate f1 and f2.
Any body can help me?

Best Answer

Making the simulated signal is quite simple. First, make a vector t which covers the time domain you are interested in. Then, generate your two sine vectors from this x, and add them together:
t=0.001:0.001:1; %this gives you t that starts from 0.001, in steps of 0.001, up to 1.
f1=10;
f2=100;
totalSignal=sin(2*pi*f1*t)+sin(2*pi*f2*t); %two signals with frequency 10 and 100 Hz, lets imagine.
plot(t,totalSignal);
Now that you have your signal, you can look into different options for recovering your original input frequencies. Fourier analysis is a great way of achievting this - check out the fft documentation for more info.