How to plot MSE for error signal and fft for my code?
Show older comments
[s, f_s] = audioread('handel.wav');
noise= 0.2*cos(2*pi*(50/f_s)*(1:N));
d = s + noise;
figure(2);
plot(d);
L=20;
alpha=0.01;
delta=100;
[e,y,ff] = lms1_d(d,L,alpha,delta);
figure(3);
plot(e);
[c1x, c1y] = size(s);
[c2x, c2y] = size(d);
if c1x ~= c2x
disp('dimension do not agree');
else
R = c1x;
C = c1y;
err = sum((s - e).^2)/(R*C);
MSE = sqrt(err);
MAXVAL = 65535;
PSNR = 20*log10(MAXVAL/MSE);
disp(['mse=' num2str(MSE) ' PSNR=' num2str(PSNR)]);
end
2 Comments
Geoff Hayes
on 17 Jan 2019
Priyanka - please explain/comment on what you are doing in the above code. Where is the FFT? What is the lms1_d?
Priyanka Shanmuga Raja
on 17 Jan 2019
Edited: Priyanka Shanmuga Raja
on 17 Jan 2019
Answers (0)
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!