clarity.predictor.torch_msbg module¶
An FIR-based torch implementation of approximated MSBG hearing loss model
- class clarity.predictor.torch_msbg.MSBGHearingModel(audiogram: np.ndarray, audiometric: np.ndarray, sr: int = 44100, spl_cali: bool = True, src_position: str = 'ff', kernel_size: int = 1025, device: str | None = None)[source]¶
Bases:
Module
- f_smear¶
settings for recruitment
- forward(x: Tensor) Tensor [source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- gt_fir_sin¶
settings for spl calibration
- measure_rms(wav: Tensor) Tensor [source]¶
Compute RMS level of a signal.
- Measures total power of all 10 msec frames that are above a specified
threshold of db_relative_rms
- Parameters:
wav – input signal
- Returns:
RMS level in dB
- recruitment_out_coef¶
settings for FIR Gammatone Filters
- class clarity.predictor.torch_msbg.torchloudnorm(sample_rate: int = 44100, norm_lufs: int = -36, kernel_size: int = 1025, block_size: float = 0.4, overlap: float = 0.75, gamma_a: int = -70, device: str | None = None)[source]¶
Bases:
Module
- forward(x: Tensor) Tensor [source]¶
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- high_pass¶
rms measurement