(nfilt=20,
                    nfft=512,
                    samplerate=16000,
                    lowfreq=0,
                    highfreq=None)
return fbanks
Compute a Mel-filterbank. The filters are stored in the rows, the columns correspond
    to fft bins. The filters are returned as an array of size nfilt * (nfft/2 + 1)

    :param nfilt: the number of filters in the filterbank, default 20.
    :param nfft: the FFT size. Default is 512.
    :param samplerate: the samplerate of the signal we are working with. Affects mel spacing.
    :param lowfreq: lowest band edge of mel filters, default 0 Hz
    :param highfreq: highest band edge of mel filters, default samplerate/2
    :returns: A numpy array of size nfilt * (nfft/2 + 1) containing filterbank. Each row holds 1 filter.
Compute a Mel-filterbank. The filters are stored in the rows, the columns correspond
    to fft bins. The filters are returned as an array of size nfilt * (nfft/2 + 1)
Compute a Mel - filterbank . The filters are stored in the rows the columns correspond to fft bins . The filters are returned as an array of size nfilt * ( nfft / 2 + 1 )
def get_filterbanks(nfilt=20,
                    nfft=512,
                    samplerate=16000,
                    lowfreq=0,
                    highfreq=None):
  """Compute a Mel-filterbank. The filters are stored in the rows, the columns correspond
    to fft bins. The filters are returned as an array of size nfilt * (nfft/2 + 1)

    :param nfilt: the number of filters in the filterbank, default 20.
    :param nfft: the FFT size. Default is 512.
    :param samplerate: the samplerate of the signal we are working with. Affects mel spacing.
    :param lowfreq: lowest band edge of mel filters, default 0 Hz
    :param highfreq: highest band edge of mel filters, default samplerate/2
    :returns: A numpy array of size nfilt * (nfft/2 + 1) containing filterbank. Each row holds 1 filter.
    """
  highfreq = highfreq or samplerate / 2
  assert highfreq <= samplerate / 2, "highfreq is greater than samplerate/2"

  # compute points evenly spaced in mels
  lowmel = hz2mel(lowfreq)
  highmel = hz2mel(highfreq)
  melpoints = numpy.linspace(lowmel, highmel, nfilt + 2)
  # our points are in Hz, but we use fft bins, so we have to convert
  #  from Hz to fft bin number
  bins = numpy.floor((nfft + 1) * mel2hz(melpoints) / samplerate)

  fbanks = numpy.zeros([nfilt, nfft // 2 + 1])
  for j in range(0, nfilt):
    for i in range(int(bins[j]), int(bins[j + 1])):
      fbanks[j, i] = (i - bins[j]) / (bins[j + 1] - bins[j])
    for i in range(int(bins[j + 1]), int(bins[j + 2])):
      fbanks[j, i] = (bins[j + 2] - i) / (bins[j + 2] - bins[j + 1])
  return fbanks
def get_filterbanks ( nfilt = 20 , nfft = 512 , samplerate = 16000 , lowfreq = 0 , highfreq = None ) : highfreq = highfreq or samplerate / 2 assert highfreq <= samplerate / 2 , "highfreq is greater than samplerate/2" # compute points evenly spaced in mels lowmel = hz2mel ( lowfreq ) highmel = hz2mel ( highfreq ) melpoints = numpy . linspace ( lowmel , highmel , nfilt + 2 ) # our points are in Hz, but we use fft bins, so we have to convert #  from Hz to fft bin number bins = numpy . floor ( ( nfft + 1 ) * mel2hz ( melpoints ) / samplerate ) fbanks = numpy . zeros ( [ nfilt , nfft // 2 + 1 ] ) for j in range ( 0 , nfilt ) : for i in range ( int ( bins [ j ] ) , int ( bins [ j + 1 ] ) ) : fbanks [ j , i ] = ( i - bins [ j ] ) / ( bins [ j + 1 ] - bins [ j ] ) for i in range ( int ( bins [ j + 1 ] ) , int ( bins [ j + 2 ] ) ) : fbanks [ j , i ] = ( bins [ j + 2 ] - i ) / ( bins [ j + 2 ] - bins [ j + 1 ] ) return fbanks