%% Convert Between ERB Scale and Hz
% Set two bounding frequencies in Hz and then convert them to the ERB scale.

b = hz2erb([20,8000]);

%  Generate a row vector of 32 values uniformly spaced on the ERB scale.

erbVect = linspace(b(1),b(2),32);

% Convert the row vector of values into equivalent frequencies in Hz.

hzVect = erb2hz(erbVect);

% Plot the two vectors for comparison. As ERB values increase linearly, Hz values increase exponentially.

plot(erbVect,hzVect,'o')
title('ERB vs Hz')
xlabel('ERB')
ylabel('Hz')
grid on

% Copyright 2018 The MathWorks, Inc.