SNR: Compute the Signal to Noise Ratio

View source: R/SNR.R

SNRR Documentation

Compute the Signal to Noise Ratio

Description

SNR computes the Signal to Noise Ratio (SNR) between two signals, indicating the level of desired signal to the level of background noise.

Usage

SNR(x, y)

Arguments

x

Numeric vector/matrix. Original reference signal.

y

Numeric vector/matrix. Restored or noisy signal.

Details

Higher values of SNR indicate a cleaner signal compared to the noise level. The SNR is computed as the ratio of the power of the signal (or the square of the Euclidean norm of the signal) to the power of the noise (or the square of the Euclidean norm of the signal difference), represented in decibels (dB).

The SNR is defined by:

\mathrm{SNR}(x,y) = 20 \log_{10}\left(\frac{\|x\|_2}{\|x-y\|_2}\right)

Value

SNR Numeric. Signal to Noise Ratio.

See Also

PSNR

Examples

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

gasper documentation built on May 29, 2024, 8:32 a.m.