Module sleplet.noise
Methods to handle noise in Fourier or wavelet space.
Functions
def compute_sigma_noise(signal: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
snr_in: float,
*,
denominator: int | None = None) ‑> float-
Compute the standard deviation of the noise.
- Args
- -----=
signal- The noised signal.
snr_in- The parameter controlling the signal-to-noise.
denominator- Coefficients to use in computing the noise, defaults to all.
Returns -----= The standard deviation of the noise.
def compute_slepian_mesh_sigma_j(mesh_slepian: MeshSlepian,
signal: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
psi_j: numpy._typing._array_like.NDArray[numpy.float64],
snr_in: float) ‑> numpy._typing._array_like.NDArray[numpy.float64]-
Compute \sigma_{j} for wavelets used in denoising the signal.
- Args
- -----=
mesh_slepian- The Slepian mesh object containing the eigensolutions.
signal- The noised signal.
psi_j- The Slepian wavelet coefficients.
snr_in- The parameter controlling the signal-to-noise ratio.
Returns -----= The standard deviation of the noise.
def compute_snr(signal: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
noise: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
signal_type: str) ‑> float-
Compute the signal to noise ratio.
- Args
- -----=
signal- The unnoised signal.
noise- The noised signal.
signal_type- Specifier to improve logging.
Returns -----= The signal-to-noise value of the noised signal.
def harmonic_hard_thresholding(L: int,
wav_coeffs: numpy._typing._array_like.NDArray[numpy.complex128],
sigma_j: numpy._typing._array_like.NDArray[numpy.float64],
n_sigma: int) ‑> numpy._typing._array_like.NDArray[numpy.complex128]-
Perform thresholding in harmonic space.
- Args
- -----=
L- The spherical harmonic bandlimit.
wav_coeffs- The harmonic wavelet coefficients.
sigma_j- The wavelet standard deviation \sigma_{j}.
n_sigma- The number of \sigma_{j} to threshold.
Returns -----= The thresholded wavelet coefficients.
def slepian_function_hard_thresholding(L: int,
coefficients: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
sigma: float,
n_sigma: int,
slepian: SlepianFunctions) ‑> numpy._typing._array_like.NDArray[numpy.complex128]-
Perform thresholding in Slepian space.
- Args
- -----=
L- The spherical harmonic bandlimit.
coefficients- The Slepian coefficients.
sigma- The standard deviation of the noise \sigma.
n_sigma- The number of \sigma to threshold.
slepian- The given Slepian object.
Returns -----= The thresholded Slepian coefficients.
def slepian_mesh_hard_thresholding(mesh_slepian: MeshSlepian,
wav_coeffs: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
sigma_j: numpy._typing._array_like.NDArray[numpy.float64],
n_sigma: int) ‑> numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64]-
Perform thresholding in Slepian space of the mesh.
- Args
- -----=
mesh_slepian- The Slepian mesh object containing the eigensolutions.
wav_coeffs- The Slepian wavelet coefficients of the mesh.
sigma_j- The wavelet standard deviation \sigma_{j}.
n_sigma- The number of \sigma to threshold.
Returns -----= The thresholded wavelet coefficients of the mesh.
def slepian_wavelet_hard_thresholding(L: int,
wav_coeffs: numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64],
sigma_j: numpy._typing._array_like.NDArray[numpy.float64],
n_sigma: int,
slepian: SlepianFunctions) ‑> numpy._typing._array_like.NDArray[numpy.complex128 | numpy.float64]-
Perform thresholding in Slepian wavelet space.
- Args
- -----=
L- The spherical harmonic bandlimit.
wav_coeffs- The Slepian wavelet coefficients
sigma_j- The wavelet standard deviation \sigma_{j}.
n_sigma- The number of \sigma_{j} to threshold.
slepian- The given Slepian object.
Returns -----= The hard thresholded Slepian wavelet coefficients.