next up previous contents index
Next: snoise Up: Reference Previous: sintegral   Contents   Index

smse

$ \bigcirc$Name


smse Computes the mean square error between two fsignals




$ \bigcirc$Command Synopsis


smse [-n] Signal1 Signal2 . . . .



-n : flag to normalize the signals

Signal1 : original signal

Signal2 : reconstructed signal

. (screen output) : signal to noise ratio / `Sig1` (SNR)

. (screen output) : peak signal to noise ratio / `Sig1` (PSNR)

. (screen output) : mean square error between Sig1 and Sig2 (MSE)

. (screen output) : maximal relative difference (MRD)




$ \bigcirc$Function Summary


void smse (Sig1 , Sig2 , Norm , SNR , PSNR , MSE , MRD )

Fsignal Sig1 , Sig2 ;

int *Norm ;

double *SNR ;

double *PSNR ;

double *MSE ;

double *MRD ;




$ \bigcirc$Description


smse computes the maximal relative difference, mean square error, signal to noise ratio, and peak signal to noise ratio between two univariate digitized signals whose sample values are read in files Signal1 and Signal2.

The maximal relative difference is given by

MRD = 100×$\displaystyle {\frac{{\max_{x}\vert f_{1}(x) - f_{2}(x)\vert}}{{\max_{x,i=1,2}f_{i}(x) - \min_{x,i=1,2}f_{i}(x)}}}$

where fi(x) is the xst sample value in signal i, i = 1, 2.

The mean square error is defined by

MSE = $\displaystyle {\frac{{\sum_{x}\vert f_{1}(x) - f_{2}(x)\vert^{2}}}{{n}}}$

where n is the number of samples in Signal1 and Signal2.

In maximal relative difference and mean square difference the two signals have symetric roles. This is no longer the case in (peak) signal to noise ratio. These quantities can be calculated for any two signals, but are more meaningful if f1 is considered as an original signal and f2 as an approximation to it. The signal to noise ratio and peak signal to noise ratio are defined as follows

SNR = 10×log10$\displaystyle {\frac{{\sigma_{1}^{2}}}{{MSE}}}$

PSNR = 10×log10$\displaystyle {\frac{{(\max_{x} f_{1}(x) - \min_{x} f_{1}(x))^{2}}}{{MSE}}}$

where $ \sigma_{{1}}^{{2}}$ is the empirical variance of the original signal.

The -n option specifies that the two signals are normalized to 0.0 mean and 1.0 variance before the computation of the quantities listed above.




$ \bigcirc$See Also


stvrestore.


$ \bigcirc$Version 1.02


Last Modification date : Thu Apr 15 01:04:32 2004


$ \bigcirc$Author


Jean-Pierre D'Ales, Jacques Froment






next up previous contents index
Next: snoise Up: Reference Previous: sintegral   Contents   Index
mw 2004-05-05