Main Content

Peak signal-to-noise ratio (PSNR)

also specifies the dimension labels, `peaksnr`

= psnr(___,'DataFormat',`dataFormat`

)`dataFormat`

, of unformatted
image data. Use this syntax to return a separate PSNR for each element along a batch
dimension.

The `psnr`

function implements this equation to calculate PSNR:

$$PSNR=10{\mathrm{log}}_{10}\left(peakva{l}^{2}/MSE\right)$$

`peakval`

is either specified by the user or taken from the range of the
image data type. For example, for an image of data type `uint8`

, the
`peakval`

is `255`

. *MSE* is
the mean square error between `A`

and
`ref`

.