Timeside Core Analyzers

Global analyzers

Mean DC Shift

class timeside.plugins.analyzer.dc.MeanDCShift[source]

Bases: timeside.core.analyzer.Analyzer

Mean DC shift analyzer

static id()[source]

Short alphanumeric, lower-case string which uniquely identify this processor, suitable for use as an HTTP/GET argument value, in filenames, etc…

static name()[source]

Return the analyzer name, such as “Mean Level”, “Max level”, “Total length, etc..

post_process()[source]
process(frames, eod=False)[source]
setup(channels=None, samplerate=None, blocksize=None, totalframes=None)[source]

Allocate internal resources and reset state, so that this processor is ready for a new run.

The channels, samplerate and/or blocksize and/or totalframes arguments may be required by processors which accept input. An error will occur if any of these arguments is passed to an output-only processor such as a decoder.

static unit()[source]

Return the unit of the data such as “dB”, “seconds”, etc…

Level

class timeside.plugins.analyzer.level.Level[source]

Bases: timeside.core.analyzer.Analyzer

Audio level analyzer

Examples

>>> import timeside
>>> from timeside.core import get_processor
>>> from timeside.core.tools.test_samples import samples
>>> source = samples['sweep.mp3']
>>> decoder = get_processor('file_decoder')(uri=source)
>>> level = get_processor('level')()
>>> (decoder | level).run()
>>> level.results.keys()
['level.max', 'level.rms']
>>> max = level.results['level.max']
>>> print max.data
[ 0.]
>>> rms = level.results['level.rms']
>>> print rms.data  
[-3.26...]
static id()[source]

Short alphanumeric, lower-case string which uniquely identify this processor, suitable for use as an HTTP/GET argument value, in filenames, etc…

static name()[source]

Return the analyzer name, such as “Mean Level”, “Max level”, “Total length, etc..

post_process()[source]
process(frames, eod=False)[source]
setup(channels=None, samplerate=None, blocksize=None, totalframes=None)[source]

Allocate internal resources and reset state, so that this processor is ready for a new run.

The channels, samplerate and/or blocksize and/or totalframes arguments may be required by processors which accept input. An error will occur if any of these arguments is passed to an output-only processor such as a decoder.

static unit()[source]

Return the unit of the data such as “dB”, “seconds”, etc…

Value Analyzers

Spectrogram

class timeside.plugins.analyzer.spectrogram.Spectrogram(input_blocksize=2048, input_stepsize=None, fft_size=None)[source]

Bases: timeside.core.analyzer.Analyzer

Spectrogram image builder with an extensible buffer based on tables

Parameters:

input_blocksize : int, optional

Blocksize of the input signal, default to 2048

input_stepsize : str, optional

The second parameter, default to half blocksize.

fft_size : int, optional

The size of the fft, default to blocksize.

Examples

>>> import timeside
>>> from timeside.core import get_processor
>>> from timeside.core.tools.test_samples import samples
>>> audio_source = samples['sweep.wav']
>>> decoder = get_processor('file_decoder')(uri=audio_source)
>>> spectrogram = get_processor('spectrogram_analyzer')(input_blocksize=2048, input_stepsize=1024)
>>> pipe = (decoder | spectrogram)
>>> pipe.run()
>>> spectrogram.results.keys()
['spectrogram_analyzer']
>>> result = spectrogram.results['spectrogram_analyzer']
>>> result.data.shape
(344, 1025)
static id()[source]

Short alphanumeric, lower-case string which uniquely identify this processor, suitable for use as an HTTP/GET argument value, in filenames, etc…

static name()[source]

Return the analyzer name, such as “Mean Level”, “Max level”, “Total length, etc..

post_process()[source]
process(analyzer, frames, eod)[source]
setup(channels=None, samplerate=None, blocksize=None, totalframes=None)[source]

Allocate internal resources and reset state, so that this processor is ready for a new run.

The channels, samplerate and/or blocksize and/or totalframes arguments may be required by processors which accept input. An error will occur if any of these arguments is passed to an output-only processor such as a decoder.

static unit()[source]

Return the unit of the data such as “dB”, “seconds”, etc…