Coding noise cancellation in matlab
127 ビュー (過去 30 日間)
古いコメントを表示
%This is a program I found online. It's supposed to take an audio file from the folder, add noise and then filter it out. However, ha=dsp.LMSFilter(256,mu); is wrong and how to add the correct arguments to dsp.LMSFilter(), I have no idea. Alos, I don't understand the working of the code. Any help would be appreciated. This is a part of a very important and graded project in my college.
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')
4 件のコメント
回答 (1 件)
Asvin Kumar
2019 年 10 月 3 日
Consider using either of the following syntaxes:
ha=dsp.LMSFilter('Length',256,'StepSize',mu);
ha=dsp.LMSFilter(256,'StepSize',mu);
For more details have a look at the following example:
For more details on the syntax for object creation and object properties refer to:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Propagation and Channel Models についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!