mean square error of a multidimensional signal

Hi...... How to Calculate Mean Square Error of a Signal in Multidimensional Matrix(Multidimensional Array).

Answers (1)

Matt J
Matt J on 23 Apr 2018
Edited: Matt J on 23 Apr 2018
mean( ( array1(:)-array2(:) ).^2 )

8 Comments

I want to calculate element by element mean square error of multidimensional array page by page ? help me in this regard
Matt J
Matt J on 23 Apr 2018
Edited: Matt J on 23 Apr 2018
Then please update your posted question to spell all that out with examples.
a=randi(4,5,5,2)+(-j)*randi(4,5,5,2);
b=randi(4,5,5,2)+(-j)*randi(4,5,5,2);
SNR=1:5;

this is my sample code for which i have to calculate the Mean Square Error and plot the graph of MSE v/s SNR. the Value of SNR is assumed.

help me in debugging code.

Did you try to apply Matt's code? All you have to do is change variable names:
mse = mean( ( array1(:)-array2(:) ).^2 )
y = SNR * ones(length(mse));
plot(SNR, y, 'b*-');
i have tried this code fragment for computing the MSE but i am able to get as MSE as a one single value. i need to get an array of MSE values to be computed for each and every value of SNR . plot it for MSE v/s SNR
You'll need multiple array1 and array2 for that. But no problem, just put them into the mse formula and it will calculate the mse for whatever arrays you put into it. Note that your code does not yet change the arrays depending on the SNR, so you will need to do that. There are a variety of ways to do that, the easiest being to simply add the SNR to one of the arrays.
SNR=4; % Whatever
b = a + SNR;
will try it,thanks a lot ....
can you help in other ways of finding out the MSE of the singal

Sign in to comment.

Asked:

on 23 Apr 2018

Commented:

on 3 Jul 2018

Community Treasure Hunt

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

Start Hunting!