Signal-to-Noise Ratio (SNR) Calculator

Data Visualization

Signal-to-Noise Ratio (SNR) Calculator

What is Signal-to-Noise Ratio (SNR)?

Signal-to-Noise Ratio (SNR) is a measure used in science and engineering to compare the level of a desired signal to the level of background noise. It is defined as the ratio of signal power to the noise power, often expressed in decibels (dB).

Formula and Its Meaning

The basic formula for SNR is:

\[SNR = \frac{\mu}{\sigma}\]

Where:

  • \(\mu\) (mu) is the signal mean (average signal power)
  • \(\sigma\) (sigma) is the standard deviation of the noise (noise level)

In decibels, SNR is expressed as:

\[SNR_{dB} = 10 \log_{10}\left(\frac{\mu^2}{\sigma^2}\right) = 20 \log_{10}\left(\frac{\mu}{\sigma}\right)\]

Calculation Steps

  1. Calculate the mean (\(\mu\)) of the input values (signal power)
  2. Calculate the standard deviation (\(\sigma\)) of the input values (noise level)
  3. Divide the mean by the standard deviation to get the SNR
  4. (Optional) Convert to decibels using the formula above

Example Calculation

Let's calculate the SNR for the dataset: 5, 20, 40, 80, 100

  1. Calculate the mean: \(\mu = \frac{5 + 20 + 40 + 80 + 100}{5} = 49\)
  2. Calculate the variance: \[\sigma^2 = \frac{(5-49)^2 + (20-49)^2 + (40-49)^2 + (80-49)^2 + (100-49)^2}{5} = 1384.4\]
  3. Calculate the standard deviation: \(\sigma = \sqrt{1384.4} \approx 37.21\)
  4. Calculate SNR: \(SNR = \frac{49}{37.21} \approx 1.32\)
  5. Convert to dB: \(SNR_{dB} = 20 \log_{10}(1.32) \approx 2.41\) dB

Visual Representation

Mean (Signal) Noise

This graph represents the example dataset. The red dashed line indicates the mean (signal), while the green curve illustrates the noise level. The SNR is a measure of how much the signal stands out from the noise.