如何用MATLAB分离两个信号
答案:1 悬赏:10
解决时间 2021-01-24 17:54
- 提问者网友:書生途
- 2021-01-24 05:50
如何用MATLAB分离两个信号
最佳答案
- 二级知识专家网友:洎扰庸人
- 2021-01-24 06:28
分离信号基本上是根据信号的频谱不同,比如第一个信号,占用频带是1000~2000Hz。第二个信号占用频带是3000~4000Hz,我们只要把信号做FFT变换,然后在频域上拿到两个信号的各自分量,再用IFFT反变换回时域,就能重组出两个信号了。
但是前提是这两个语音的频带不能叠在一起
不多说了,举个例子,sin(t)+sin(10t),这两个信号的频带显然不同,可以分离
clc;
clear;
t=0:0.1:10;
x1=sin(t);
x2=sin(10*t);
x=x1+x2;
X_f=fft(x);
figure (1)
subplot(2,1,1);
plot(x);
xlabel('time')
title('x1+x2 (time domain)')
subplot(2,1,2);
plot(abs(X_f));
xlabel('frequency')
title('x1+x2(frequency domian)')
X1_f=X_f;
X1_f(10:95) = 0;
X2_f=X_f;
X2_f(1:9)=0;
X2_f(96:end)=0;
x1_reconstruc = ifft(X1_f);
x2_reconstruc = ifft(X2_f);
figure (2)
subplot(2,1,1);
plot(x1);
title('Original x1')
subplot(2,1,2);
plot(real(x1_reconstruc));
title('Reconsturctured x1')
figure (3)
subplot(2,1,1);
plot(x2);
title('Original x2')
subplot(2,1,2);
plot(real(x2_reconstruc));
title('Reconsturctured x2')
但是前提是这两个语音的频带不能叠在一起
不多说了,举个例子,sin(t)+sin(10t),这两个信号的频带显然不同,可以分离
clc;
clear;
t=0:0.1:10;
x1=sin(t);
x2=sin(10*t);
x=x1+x2;
X_f=fft(x);
figure (1)
subplot(2,1,1);
plot(x);
xlabel('time')
title('x1+x2 (time domain)')
subplot(2,1,2);
plot(abs(X_f));
xlabel('frequency')
title('x1+x2(frequency domian)')
X1_f=X_f;
X1_f(10:95) = 0;
X2_f=X_f;
X2_f(1:9)=0;
X2_f(96:end)=0;
x1_reconstruc = ifft(X1_f);
x2_reconstruc = ifft(X2_f);
figure (2)
subplot(2,1,1);
plot(x1);
title('Original x1')
subplot(2,1,2);
plot(real(x1_reconstruc));
title('Reconsturctured x1')
figure (3)
subplot(2,1,1);
plot(x2);
title('Original x2')
subplot(2,1,2);
plot(real(x2_reconstruc));
title('Reconsturctured x2')
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯