PySNR is a Python library which provides a suite of tools for performing various types of noise analysis on signals. PySNR aims to provide five main functionalities:
- SNR (Signal to Noise Ratio)
- THD (Total Harmonic Distortion)
- SINAD (Signal to Noise and Distortion Ratio)
- TOI (Third Order Intercept)
- SFDR (Spurious Free Dynamic Range)
The following sections elaborate on each of these utilities further.
This calculates the signal-to-noise ratio of an 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:
If the noise magnitude is not provided, a modified periodogram is computed using a Kaiser window with
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 of a 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 enbw()
function which computes the estimated noise bandwidth for assessing
the resolution bandwidth.
This calculates the signal-to-noise-and-distortion ratio of a signal. SINAD is defined as the ratio between the power of the signal's fundamental frequency to the power of the background noise and harmonics.
A modified periodogram is computed using a Kaiser window with
The SINAD 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 third order intercept point for a signal. There are six third-order intermodulation points from the
top two dominant frequencies
A modified periodogram is computed using a Kaiser window with
The TOI 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 spurious free dynamic range of a signal. SFDR is defined as the strength ratio of the fundamental signal to the strongest spurious signal.
A modified periodogram is computed using a Kaiser window with
The SFDR 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.
Currently PySNR can be installed from pypi. TO install, use the following command:
pip install pysnr
To have a more detailed understanding of using the library, please refer to the usage and API Reference.
If you are using this software in your research, please use the following citation:
@software{sambit_paul_2022_6725547,
author = {Sambit Paul},
title = {psambit9791/pysnr: First Release},
month = jun,
year = 2022,
publisher = {Zenodo},
version = {0.0.1},
doi = {10.5281/zenodo.6725547},
url = {https://doi.org/10.5281/zenodo.6725547}
}
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to use, modify and distribute this software, as long as the copyright header is left intact.