How to separate signals with diffrent frequencies
106 views (last 30 days)
t = linspace(0, 1, 1001);
x=sin(2*pi*t*3) + sin(2*pi*t*6) + sin(2*pi*t*10)+sin(2*pi*t*13)+sin(2*pi*t*20)+sin(2*pi*t*50)+sin(2*pi*t*100)+sin(2*pi*t*200);
% my signal with frequencies 3,6,10,13,20,50,100,200 KHz
y=x+randn(size(x)).*sigma; % adding noise
I filtered the signal using fft.
I want to separate signals.
Eg : from my original signal, I want a signal with frequency range say 3 to 8 KHz, another signal say from 100 to 200 KHz. How can I separate them and display those signals.How can I do this. Anybody Please help me to solve this.?
Shoaibur Rahman on 1 Jan 2015
Add the following lines of code at the bottom of your code (after y=x+randn(size(x)).*sigma;):
ffty = fft(y);
ffty = abs(ffty(1:ceil(length(y)/2)));
[~,locs] = findpeaks(ffty);
freqs = (locs-1)/t(end)
signal_1 = sin(2*pi*t*freqs(1))+sin(2*pi*t*freqs(2))+sin(2*pi*t*freqs(3)); % 3-10
signal_2 = sin(2*pi*t*freqs(6))+sin(2*pi*t*freqs(7)); % 50-100
More Answers (1)
Pourya Alinezhad on 1 Jan 2015
1-you can use several filters with different center frequencies (chebishev or butter filter)
h = fdesign.bandpass('N,F3dB1,F3dB2', N, Fc1, Fc2, Fs);
Hd = design(h, 'butter');
2- you can use an adaptive filter and feed the signal and the desired signals to it (LMS filter).