treble_tsdk.results.audio_signal¶
Audio signal and convolved audio handling.
Provides AudioSignal and ConvolvedAudioSignal classes for working with audio waveforms and convolved impulse response data.
Classes
Audio signal class for handling audio data |
|
Audio signal produced by convolving an impulse response with an input waveform. |
- class treble_tsdk.results.audio_signal.AudioSignal¶
Audio signal class for handling audio data
- __init__(data: ndarray, sampling_rate: float, time: ndarray | None = None, source: list[SourceResults] | None = None, receiver: list[ReceiverResults] | None = None, zero_pad_samples: int = 0, normalization_coefficient: float | None = None)¶
A Class handling all mono impulse response related actions
- Parameters:
data (np.ndarray) – The time domain impulse response
sampling_rate (float) – The sampling rate of the impulse response
source (Source | None) – Information on source, defaults to None
receiver (Receiver | None) – Information on receiver, defaults to None
zero_pad_samples (int) – The number of samples that have been zero padded in the beginning, defaults to 0
normalization_coefficient (float | None) – The coefficient used to normalize the data
- repeat_to_duration(duration_seconds: float, full_repeat: bool = False, fadeout_samples: int = 1024) AudioSignal' | 'ConvolvedAudioSignal¶
repeat the audio audio signal to a specified duration
- Parameters:
- Return AudioSignal:
the new audio signal
- trim_to_duration(duration_seconds: float, fadeout_samples: int = 1024) AudioSignal' | 'ConvolvedAudioSignal¶
Trim the audio signal to a specified duration
- convolve_with_audio_signal(audio: AudioSignal) AudioSignal¶
Convolve the impulse response with an audio signal to get a convolved audio signal
- Parameters:
audio (AudioSignal) – signal to be convolved with the IR
- Return AudioSignal:
The convolved audio signal
- class treble_tsdk.results.audio_signal.ConvolvedAudioSignal¶
Audio signal produced by convolving an impulse response with an input waveform.
Provides utilities to access individual channels, plot, normalize, resample, and manipulate the convolved audio signal.
- __init__(data: ndarray, sampling_rate: float, time: ndarray | None = None, source: list[SourceResults] | None = None, receiver: list[ReceiverResults] | None = None, zero_pad_samples: int = 0, normalization_coefficient: float | None = None)¶
A Class handling all mono impulse response related actions
- Parameters:
data (np.ndarray) – The time domain impulse response
sampling_rate (float) – The sampling rate of the impulse response
source (Source | None) – Information on source, defaults to None
receiver (Receiver | None) – Information on receiver, defaults to None
zero_pad_samples (int) – The number of samples that have been zero padded in the beginning, defaults to 0
normalization_coefficient (float | None) – The coefficient used to normalize the data