Learn R Programming

gasper (version 1.1.6)

PSNR: 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)

Value

PSNR Numeric. Peak Signal to Noise Ratio.

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)$$

See Also

SNR

Examples

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

Run the code above in your browser using DataLab