comparison MFCC.py @ 3:7a20cff05bd6

couple of bugfixes, almost runs
author Dan Stowell <danstowell@users.sourceforge.net>
date Wed, 14 Nov 2012 13:23:02 +0000
parents d5d4981b58f1
children 6cafb481a1e5
comparison
equal deleted inserted replaced
2:6159c3c0793c 3:7a20cff05bd6
80 k2 = numpy.float32(filterEnd-filterCentre) 80 k2 = numpy.float32(filterEnd-filterCentre)
81 up = (numpy.array(xrange(filterStart,filterCentre))-filterStart)/k1 81 up = (numpy.array(xrange(filterStart,filterCentre))-filterStart)/k1
82 dn = (filterEnd-numpy.array(xrange(filterCentre,filterEnd)))/k2 82 dn = (filterEnd-numpy.array(xrange(filterCentre,filterEnd)))/k2
83 filt[filterStart:filterCentre] = up 83 filt[filterStart:filterCentre] = up
84 filt[filterCentre:filterEnd] = dn 84 filt[filterCentre:filterEnd] = dn
85 85
86 def warpSpectrum(self,magnitudeSpectrum): 86 def warpSpectrum(self,magnitudeSpectrum):
87 '''Compute the Mel scaled spectrum.''' 87 '''Compute the Mel scaled spectrum.'''
88 return numpy.dot(magnitudeSpectrum,self.filterMatrix) 88 return numpy.dot(magnitudeSpectrum,self.filterMatrix)
89 89
90 def getDCTMatrix(self,size): 90 def getDCTMatrix(self,size):