grafx.processors.stereo
- class StereoGain
Bases:
Module
A simple stereo-to-stereo or mono-to-stereo gain.
We use simple channel-wise constant multiplication with a gain vector. The gain is assumed to be in log scale, so we apply exponentiation before multiplying it to the stereo signal.
Hence, the learnable parameter is
- forward(input_signals, log_gain)
Processes input audio with the processor and given parameters.
- Parameters:
input_signals (
FloatTensor
, ) – A batch of input audio signals, either mono or stereo.log_magnitude (
FloatTensor
, ) – A log-magnitude vector of the FIR filter.
- Returns:
A batch of output signals of shape
.- Return type:
FloatTensor
- parameter_size()
- Returns:
A dictionary that contains each parameter tensor’s shape.
- Return type:
Dict[str, Tuple[int, ...]]
- class SideGainImager
Bases:
Module
Stereo imager with side-channel loudness control.
We multiply the input’s side signal
, i.e., left minus right , with a gain parameter to control the stereo width. The mid and side outputs are given asHence, the learnable parameter is
- forward(input_signals, log_gain)
Processes input audio with the processor and given parameters.
- Parameters:
input_signals (
FloatTensor
, ) – A batch of input audio signals; must be stereo.log_magnitude (
FloatTensor
, ) – A log-magnitude vector of the FIR filter.
- Returns:
A batch of output signals of shape
.- Return type:
FloatTensor
- parameter_size()
- Returns:
A dictionary that contains each parameter tensor’s shape.
- Return type:
Dict[str, Tuple[int, ...]]
- class MonoToStereo
Bases:
Module
A simple mono-to-stereo conversion.
- forward(input_signals)
Processes input audio with the processor and given parameters.
- Parameters:
input_signals (
FloatTensor
, ) – A batch of input audio signals; must be mono.- Returns:
A batch of output signals of shape
.- Return type:
FloatTensor
- parameter_size()
- Returns:
A dictionary that contains each parameter tensor’s shape.
- Return type:
Dict[str, Tuple[int, ...]]
- class StereoToMidSide(normalize=True)
Bases:
Module
A simple stereo-to-mid-side conversion.
- forward(input_signals)
Processes input audio with the processor and given parameters.
- Parameters:
input_signals (
FloatTensor
, ) – A batch of input audio signals; must be stereo.- Returns:
A batch of output signals of shape
.- Return type:
FloatTensor
- parameter_size()
- Returns:
A dictionary that contains each parameter tensor’s shape.
- Return type:
Dict[str, Tuple[int, ...]]
- class MidSideToStereo(normalize=True)
Bases:
Module
A simple mid-side-to-stereo conversion.
- forward(mid, side)
Processes input audio with the processor and given parameters.
- Parameters:
mid (
FloatTensor
, ) – A batch of mid audio signals.side (
FloatTensor
, ) – A batch of side audio signals.
- Returns:
A batch of output signals of shape
.- Return type:
FloatTensor
- parameter_size()
- Returns:
A dictionary that contains each parameter tensor’s shape.
- Return type:
Dict[str, Tuple[int, ...]]