ultrasound_metrics.channel.noise
================================

.. py:module:: ultrasound_metrics.channel.noise

.. autoapi-nested-parse::

   Estimate the signal-to-noise ratio (SNR) of an ultrasound transducer system.

   This module provides methods to calculate SNR using repeated pulse-echo
   measurements of a phantom or tissue.

   .. rubric:: Notes

   Motivation:
       We would like to understand the power/SNR tradeoffs, e.g.:
       - How much does AFE power improve SNR?
       - How much does combining channels via summation improve SNR?
       - How much do increasing chip-repeats improve SNR?

   Implemented Methods:
       Repeated Measurements Variance (best for a static phantom):
           - Acquire multiple identical frames (same configuration)
           - Calculate the mean signal across frames (this represents the true signal)
           - Calculate the standard deviation across frames (this represents noise)
           - SNR = mean signal / standard deviation of noise

       Signal Differences in Adjacent Frames:
           - Since tissue moves slowly and we acquire ultrafast ultrasound:
           - Calculate frame-to-frame differences
           - Assuming the tissue moves much slower than the frame rate,
             frame-to-frame differences primarily represent transmit and receive-channel noise
           - Compare mean signal amplitude to this difference (noise) to estimate SNR

   Alternative Methods (Not Implemented):
       Transmit-Off Noise Measurements:
           - Collect data with the transmitter turned off (tx-off)
           - This is all noise, so it's easy to calculate SNR.
           - Downside: noise may be nonlinear or signal-dependent, so this
             would not capture the practical SNR.

       Spectral Analysis:
           - Assumes that the signal is narrowband and that the noise is flat.
           - This is not true for our data, so we don't implement this.

   Differences from B-Mode SNR:
       In ultrasound or image analysis, we often calculate SNR in the B-mode image.
       For example, checking the strength of a reflector in the image.

       You might take a spatial region analysis approach, e.g.:
           - Select regions devoid of signal (e.g. water) to calculate noise power
           - If a reflector is present, you can also calculate signal power

       This is a great way to calculate image-related SNR. However, it does not
       directly characterize the electronic noise, e.g. thermal or quantization noise.
       Scatterer SNR probably belongs in a different submodule of this same repository.



Attributes
----------

.. autoapisummary::

   ultrasound_metrics.channel.noise.key


Classes
-------

.. autoapisummary::

   ultrasound_metrics.channel.noise.NoiseEstimationMethod


Module Contents
---------------

.. py:class:: NoiseEstimationMethod

   Bases: :py:obj:`str`, :py:obj:`enum.Enum`


   Enumeration of noise estimation methods.

   .. attribute:: REPEATED_MEASUREMENTS

      Use repeated measurements variance method.

   .. attribute:: ADJACENT_FRAMES

      Use adjacent frames difference method.

   .. attribute:: Initialize self.  See help(type(self)) for accurate signature.




   .. py:attribute:: ADJACENT_FRAMES
      :value: 'adjacent_frames'



   .. py:attribute:: REPEATED_MEASUREMENTS
      :value: 'repeated_measurements'



.. py:data:: key

