How to plot MSE for error signal and fft for my code?

[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 commentaires

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
Priyanka Shanmuga Raja le 17 Jan 2019
Modifié(e) : Priyanka Shanmuga Raja le 17 Jan 2019
lms1_d is my function that i put as a seperate coding. I showed this codes and outputs to my professor, he asked me to plot MSE and fft.
I have given an input signal s " handel.wav" .
Generated a cosinusoidal signal with the frequency 50 Hz, the amplitude 0.3 and the phase 3π/4 as noise.
I have added s + noise
Now by using lms function, i have filtered the added error and plotted. Also calculated MSE, now i want to plot MSE and fft.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by