# Signal-to-noise ratio (imaging)

Signal-to-noise ratio (SNR) is used in imaging to characterize image quality. The sensitivity of a (digital or film) imaging system is typically described in the terms of the signal level that yields a threshold level of SNR.

Industry standards define sensitivity in terms of the ISO film speed equivalent, using SNR thresholds (at average scene luminance) of 40:1 for "excellent" image quality and 10:1 for "acceptable" image quality.[1]

SNR is sometimes quantified in decibels (dB) of signal power relative to noise power, though in the imaging field the concept of "power" is sometimes taken to be the power of a voltage signal proportional to optical power; so a 20 dB SNR may mean either 10:1 or 100:1 optical power, depending on which definition is in use.

## Definition of SNR

An operator arbitrarily defines a box area in the signal and background regions of a back-illuminated half moon or knife-edge test target. The data, (such as pixel intensity), is used to determine the average signal and background values.

Traditionally, SNR is defined to be the ratio of the average signal value ${\displaystyle \mu _{\mathrm {sig} }}$ to the standard deviation ${\displaystyle \sigma _{\mathrm {bg} }}$ of the background:

${\displaystyle \mathrm {SNR} ={\frac {\mu _{\mathrm {sig} }}{\sigma _{\mathrm {bg} }}}}$

However, when presented with a high-contrast scene, many imaging systems clamp the background to uniform black, forcing ${\displaystyle \sigma _{\mathrm {bg} }}$ to zero, artificially making the SNR infinite.[2] In this case a better definition of SNR is the ratio of the average signal value ${\displaystyle \mu _{\mathrm {sig} }}$ to the standard deviation of the signal ${\displaystyle \sigma _{\mathrm {sig} }}$:

${\displaystyle \mathrm {SNR} ={\frac {\mu _{\mathrm {sig} }}{\sigma _{\mathrm {sig} }}}}$

which gives a meaningful result in the presence of clamping.

## Calculations

### Explanation

The line data is gathered from the arbitrarily defined signal and background regions and input into an array (refer to image to the right). To calculate the average signal and background values, a second order polynomial is fitted to the array of line data and subtracted from the original array line data. This is done to remove any trends. Finding the mean of this data yields the average signal and background values. The net signal is calculated from the difference of the average signal and background values. The RMS or root mean square noise is defined from the background region. Finally, SNR is determined as the ratio of the net signal to the RMS noise.

### Polynomial and coefficients

• The second order polynomial is calculated by the following double summation.

${\displaystyle f_{i}=\sum _{j=0}^{m}\sum _{i=1}^{n}a_{j}x_{i}^{j}}$

• ${\displaystyle f\,}$ = output sequence
• ${\displaystyle m\,}$ = the polynomial order
• ${\displaystyle x\,}$ = the input sequence (array/line values) from the signal region or background region, respectively.
• ${\displaystyle n\,}$ = the number of lines
• ${\displaystyle a_{j}\,}$ = the polynomial fit coefficients
• The polynomial fit coefficients can thus be calculated by a system of equations.[3]

${\displaystyle {\begin{bmatrix}1&x_{1}&x_{1}^{2}\\1&x_{2}&x_{2}^{2}\\\vdots &\vdots &\vdots \\1&x_{n}&x_{n}^{2}\end{bmatrix}}{\begin{bmatrix}a_{2}\\a_{1}\\a_{0}\\\end{bmatrix}}={\begin{bmatrix}f_{1}\\f_{2}\\\vdots \\f_{n}\end{bmatrix}}}$

• Which can be written...

${\displaystyle {\begin{bmatrix}n&\sum x_{i}&\sum x_{i}^{2}\\\sum x_{i}&\sum x_{i}^{2}&\sum x_{i}^{3}\\\sum x_{i}^{2}&\sum x_{i}^{3}&\sum x_{i}^{4}\end{bmatrix}}{\begin{bmatrix}a_{2}\\a_{1}\\a_{0}\end{bmatrix}}={\begin{bmatrix}\sum f_{i}\\\sum f_{i}x_{i}\\\sum f_{i}x_{i}^{2}\end{bmatrix}}}$

• Computer software or rigorous row operations will solve for the coefficients.

### Net signal, signal, and background

The second-order polynomial is subtracted from the original data to remove any trends and then averaged. This yields the signal and background values[clarification needed]:

${\displaystyle \mu _{\text{sig}}={\frac {\sum _{i=1}^{n}(X_{i}-f_{i})}{n}}\qquad \qquad \mu _{\text{bkg}}={\frac {\sum _{i=1}^{n}(X_{i}-f_{i})}{n}}}$

where

• ${\displaystyle \mu _{\text{sig}}}$ = average signal value
• ${\displaystyle \mu _{\text{bkg}}}$ = average background value
• ${\displaystyle n\,}$ = number of lines in background or signal region
• ${\displaystyle X_{i}\,}$ = value of the ith line in the signal region or background region, respectively.
• ${\displaystyle f_{i}\,}$ = value of the ith output of the second order polynomial.

Hence, the net signal value is determined by[citation needed]:

${\displaystyle {\text{signal}}=\mu _{\text{sig}}-\mu _{\text{bkg}}}$.

### RMS noise and SNR

${\displaystyle {\text{RMS noise}}={\sqrt {\frac {\sum _{i=1}^{n}(X_{i}-{\frac {\sum _{i=1}^{n}X_{i}}{n}})^{2}}{n}}}}$

The SNR is thus given by

${\displaystyle {\text{SNR}}={\frac {\text{signal}}{\text{RMS noise}}}}$

Using the industry standard 20 log rule[4]...

${\displaystyle {\text{SNR}}=20\log _{10}{\frac {\text{signal}}{\text{RMS noise}}}\,{\mbox{dB}}}$