Package timeside :: Package analyzer :: Module utils
[hide private]
[frames] | no frames]

Module utils

source code

Functions [hide private]
 
downsample_blocking(frames, hop_s, dtype='float32') source code
 
computeModulation(serie, wLen, withLog=True)
Compute the modulation of a parameter centered.
source code
 
segmentFromValues(values, offset=0) source code
 
melFilterBank(nbFilters, fftLen, sr)
Grenerate a Mel Filter-Bank
source code
 
triangle(length)
Generate a triangle filter.
source code
 
entropy(serie, nbins=10, base=2.7182818284590451, approach='unbiased')
Compute entropy of a serie using the histogram method.
source code
Variables [hide private]
  __package__ = 'timeside.analyzer'
Function Details [hide private]

computeModulation(serie, wLen, withLog=True)

source code 

Compute the modulation of a parameter centered. Extremums are set to zero.

Args :

  • serie : list or numpy array containing the serie.
  • wLen : Length of the analyzis window in samples.
  • withLog : Whether compute the var() or log(var()) .

Returns :

  • modul : Modulation of the serie.

melFilterBank(nbFilters, fftLen, sr)

source code 

Grenerate a Mel Filter-Bank

Args :

  • nbFilters : Number of filters.
  • fftLen : Length of the frequency range.
  • sr : Sampling rate of the signal to filter.

Returns :

  • filterbank : fftLen x nbFilters matrix containing one filter by column. The filter bank can be applied by matrix multiplication (Use numpy *dot* function).

triangle(length)

source code 

Generate a triangle filter.

Args :

  • length : length of the filter.

returns :

  • triangle : triangle filter.

entropy(serie, nbins=10, base=2.7182818284590451, approach='unbiased')

source code 

Compute entropy of a serie using the histogram method.

Args :
    - serie     : Serie on witch compute the entropy
    - nbins     : Number of bins of the histogram
    - base      : Base used for normalisation
    - approach  : String in the following set : {unbiased,mmse}
                  for un-biasing value.

Returns :
    - estimate  : Entropy value
    - nbias     : N-bias of the estimate
    - sigma     : Estimated standard error

Raises :
    A warning in case of unknown 'approach' value.
    No un-biasing is then performed