⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spsub.m

📁 Simulation of Speech Enhancement using Spectral Subtraction
💻 M
字号:
--Sevakula RahulKumar (5464)

t = 0:0.001:1.023;
x = sin(2*pi*50*t) + sin(2*pi*120*t) + sin(2*pi*200*t);
plot(t(1:250),x(1:250));
pause
clf
p = 3*randn(1,1024);
q = 3*randn(1,1024);
r = 3*randn(1,1024);
y = p + x;
plot(t(1:250),y(1:250));
pause
clf
Y = fft(y,1024);
Pyy = Y.*conj(Y)/1024;
f = 1000*(0:512)/1024;
plot(f,Pyy(1:513));
pause
clf
P = fft(p,1024);
Q = fft(q,1024);
R = fft(r,1024);
X = fft(x,1024);
Ppp = P.*conj(P)/1024;
Pqq = Q.*conj(Q)/1024;
Prr = R.*conj(R)/1024;
Pxx = X.*conj(X)/1024;
Pss = (Ppp + Pqq + Prr)/3;
for m = 1:1024
    Pzz(1,m) = Pyy(1,m) - Pss(1,m);
end;
plot(f,Pzz(1:513));
pause
clf
for m = 1:1024
    if (Pzz(1,m) < 0)
      Pzz(1,m) = 0;
    end;
end
plot(f,Pzz(1:513));
pause
clf
Ptt = Pzz - Pxx;
for m = 1:1024
    if (Pzz(1,m)<= max(Ptt))
      Pzz(1,m) = 5;
    end;
end;
plot(f,Pzz(1:513))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -