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