From: Thomas Fillon Date: Mon, 24 Mar 2014 13:36:17 +0000 (+0100) Subject: Merge branch 'dev' into diadems X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=00ca4cfc4117871384a7d1567bbc573ff3a53236;p=timeside.git Merge branch 'dev' into diadems --- 00ca4cfc4117871384a7d1567bbc573ff3a53236 diff --cc timeside/analyzer/irit_speech_4hz.py index 2e34cf5,c04e438..0deed58 --- a/timeside/analyzer/irit_speech_4hz.py +++ b/timeside/analyzer/irit_speech_4hz.py @@@ -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 @@@ -123,12 -118,12 +123,12 @@@ 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