deffilterbank_application(input,b,verbose=False):"""
A function to run the input through a bandpass filter bank with parameters defined by the b and a coefficients.
Parameters:
* input (type: array-like matrix of floats) - input signal. (Required)
* b (type: array-like matrix of floats) - the b coefficients of each filter in shape b[numOfFilters][numOfCoeffs]. (Required)
Returns:
* y (type: numpy array of floats) - an array with inner dimensions equal to that of the input and outer dimension equal to
the length of fc (i.e. the number of bandpass filters in the bank) containing the outputs to each filter. The output
signal of the nth filter can be accessed using y[n].
"""input=np.array(input)bshape=np.shape(b)nFilters=bshape[0]lengthFilter=bshape[1]shape=(nFilters,)+(np.shape(input))shape=np.array(shape[0:])shape[-1]=shape[-1]+lengthFilter-1y=np.zeros((shape))foriinrange(nFilters):if(verbose):sys.stdout.write("\r"+str(int(np.round(100.0*i/nFilters)))+"% complete.")sys.stdout.flush()x=np.array(input)y[i]=signal.fftconvolve(x,b[i])if(verbose):sys.stdout.write("\n")returny
samplefreq,input=wavfile.read('sine_sweep.wav')input=input.transpose()input=(input[0]+input[1])/2b_coeff1=gammatone_filterbank(samplefreq,39)Output=filterbank_application(input,b_coeff1)Rect_Output=half_rectification(Output)