def dynamic_range_compression(x, normalize_fun=torch.log, C=1, clip_val=1e-5):
    """
    PARAMS
    ------
    C: compression factor
    """
    return normalize_fun(torch.clamp(x, min=clip_val) * C)
PARAMS
------
C: compression factor
models/tta/picoaudio/picoaudio/audioldm/audio/audio_processing.py