function [yQ, totalBits] = performEncoding(y, Fs, bits, FFTLength, M, F, k, thres, totalBits, quantType); % % quantType = -1 : full-range quantization % 0 : narrow quantization % 8 : 8-bit full-range quantization % 16 : 16-bit full-range quantization % 99 : ATH full-range quantization % find low and high frequencies for this filter in the bank center = (2*k - 1) * Fs * pi/(2*M); low = center - Fs*pi/(2*M); high = center + Fs*pi/(2*M); % find the index into the frequency array that corresponds to low and high lowIndex = max(find(F