]> git.parisson.com Git - timeside.git/commitdiff
Merge branch 'dev' into diadems
authorThomas Fillon <thomas@parisson.com>
Mon, 24 Mar 2014 13:36:17 +0000 (14:36 +0100)
committerThomas Fillon <thomas@parisson.com>
Mon, 24 Mar 2014 13:36:17 +0000 (14:36 +0100)
1  2 
timeside/analyzer/core.py
timeside/analyzer/irit_speech_4hz.py

Simple merge
index 2e34cf58d7aa1281525df23c939d6e69251e78b1,c04e43885a161836d444d4fe64da83a7e415d53a..0deed58034a3e0a3afbc55925c77fa823f4a31c9
@@@ -24,15 -24,13 +24,15 @@@ from timeside.analyzer.core import Anal
  from timeside.analyzer.utils import melFilterBank, computeModulation
  from timeside.analyzer.utils import segmentFromValues
  from timeside.api import IAnalyzer
- from numpy import array, hamming, dot, mean, float
+ from numpy import array, hamming, dot, mean, float, isnan
  from numpy.fft import rfft
  from scipy.signal import firwin, lfilter
 -
 +from timeside.analyzer.preprocessors import frames_adapter
  
  class IRITSpeech4Hz(Analyzer):
 -    '''Speech Segmentor based on the 4Hz energy modulation analysis.
 +    implements(IAnalyzer)
 +    '''
 +    Segmentor based on the analysis of the 4Hz energy modulation.
  
      Properties:
          - energy4hz           (list)          : List of the 4Hz energy by frame for the modulation computation
          energy = sum(energy)
  
          # Normalization
-         if self.normalizeEnergy:
+         if self.normalizeEnergy and energy.any():
              energy = energy / mean(energy)
  
 +      
          # Energy Modulation
 -        frameLenModulation = int(
 -            self.modulLen * self.samplerate() / self.blocksize())
 +        frameLenModulation = self.modulLen/self.wStep 
          modEnergyValue = computeModulation(energy, frameLenModulation, True)
  
          # Confidence Index