PySNR is a Python library which provides a suite of tools to users for performing various types of noise analysis on a signal. PySNR aims to provide four main functionalities:
- SNR (Signal to Noise Ratio)
- THD (Total Harmonic Distortion)
- SINAD (Signal to Noise and Distortion Ratio)
- SFDR (Spurious Free Dynamic Range)
The following sections elaborate on each of these utilities further.
This calculates the signal-to-noise ratio for any input signal. Signal-to-Noise ratio is defined as the ratio between the power of the desired signal to the power of the background noise.
If the noise magnitude is provided along with the signal, the SNR is calculated using the following formula:
The SNR value can also be computed by providing the periodograms of power spectral density enbw()
function which computes the estimated noise bandwidth for assessing
the resolution bandwidth.
This calculates the total harmonic distortion for any signal. Total harmonic distortion is defined as the ratio of the power of the harmonics to the power of the fundamental frequency.
A modified periodogram is computed using a Kaiser window with
The THD value can also be computed by providing the periodograms of power spectral density $(V^{2}/Hz)$ or
power spectrum $(V^{2})$. In case of power spectrum periodograms,the resolution bandwidth needs to be provided
as well. Utilities provide the enbw()
function which computes the estimated noise bandwidth for assessing
the resolution bandwidth.