PSNR: Compute the Peak Signal to Noise Ratio

View source: R/PSNR.R

PSNRR Documentation

Compute the Peak Signal to Noise Ratio

Description

PSNR function computes the Peak Signal to Noise Ratio (PSNR) between two signals or images.

Usage

PSNR(x, y)

Arguments

x

Numeric vector/matrix. Original reference signal/image.

y

numeric vector/matrix. Restored or noisy signal/image.

Details

Higher values of PSNR indicate closer similarity between the original and the compared signal or image.

The PSNR is defined by:

\mathrm{PSNR}(x,y) = 10 \log_{10}\left(\frac{\max(\max(x),\max(y))^2}{\mathrm{MSE}(x, y)}\right)

Value

PSNR Numeric. Peak Signal to Noise Ratio.

See Also

SNR

Examples

x <- cos(seq(0, 10, length=100))
y <- x + rnorm(100, sd=0.5)
PSNR(x, y)

gasper documentation built on Oct. 27, 2023, 1:07 a.m.