def construct_filterbank(num_filters, nfft, sr, min_freq, max_freq):
min_mel = freq_to_mel(min_freq)<EOL>max_mel = freq_to_mel(max_freq)<EOL>mel_points = np.linspace(min_mel, max_mel, num_filters + <NUM_LIT:2>)<EOL>bin_freqs = mel_to_freq(mel_points)<EOL>fftfreqs = np.arange(int(nfft / <NUM_LIT:2> + <NUM_LIT:1>)) / nfft * sr<EOL>fbank = np.zeros((num_filters, int(nfft / <NUM_LIT:2> + <NUM_LIT:1>)))<EOL>for i in range(num_filters):<EOL><INDENT>fs = bin_freqs[i + np.arange(<NUM_LIT:3>)]<EOL>fs = fs[<NUM_LIT:1>] + (fs - fs[<NUM_LIT:1>])<EOL>loslope = (fftfreqs - fs[<NUM_LIT:0>]) / (fs[<NUM_LIT:1>] - fs[<NUM_LIT:0>])<EOL>highslope = (fs[<NUM_LIT:2>] - fftfreqs) / (fs[<NUM_LIT:2>] - fs[<NUM_LIT:1>])<EOL>fbank[i, :] = np.maximum(np.zeros(loslope.shape), np.minimum(loslope, highslope))<EOL><DEDENT>return fbank.transpose()<EOL>
Constructs a mel-frequency filter bank.

            Parameters
            ----------
            nfft : int
                Number of points in the FFT.

            Returns
            -------
            array
                Filter bank to multiply an FFT spectrum to create a mel-frequency
                spectrum.