【发布时间】:2019-09-29 10:20:40
【问题描述】:
这是我在网上找到的一个程序。它应该从文件夹中获取音频文件,添加噪音然后将其过滤掉。然而,ha=dsp.LMSFilter(256,mu);是错误的,如何将正确的参数添加到 dsp.LMSFilter(),我不知道。阿洛斯,我不明白代码的工作原理。任何帮助,将不胜感激。这是我大学里一个非常重要的分级项目的一部分。
load handel.mat;
d= 'Recording.m4a';
samples = [1,20*Fs];
clear d Fs
[d,Fs] = audioread('Recording.m4a',samples);
sound(d,Fs)
pause(3)
x=awgn(d,20);
sound(x,Fs)
pause(3)
mu=0.017;%stepsize
ha=dsp.LMSFilter(256,mu);
[y,e]=filter(ha,x(:,1),d(:,1));
sound(y,Fs)
subplot(4,1,1),plot(d)
grid on
xlabel('iterations')
ylabel('amplitude')
title('original voice signal')
subplot(4,1,2)
plot(x)
grid on
xlabel('iterations')
ylabel('amplitude')
title('signal with AWGN')
subplot(4,1,3)
plot(y)
grid on
title('filtered output')
xlabel('iterations')
ylabel('amplitude')
subplot(4,1,4)
plot(e)
grid on
title('error signal')
xlabel('iterations')
ylabel('amplitude')
【问题讨论】:
-
如果这是您教育的重要评分作业的一部分,最好祈祷教授不属于 SO。
-
或许阅读docs 会有所帮助。
-
"这是我在网上找到的一个程序。"请为您在 Stack Overflow 上发布的任何代码提供正确的署名,就像您提交项目进行评分一样。 (你打算这样做,对吧?)
-
是的,我是。对不起,我没有意识到。会一直这样做...
-
这是原论文:google.com/…
标签: matlab noise cancellation