Skip to content

Instantly share code, notes, and snippets.

@vorushin
Created April 9, 2016 18:51
Show Gist options
  • Save vorushin/765f51cfd0544638d63b90c5d0f990ab to your computer and use it in GitHub Desktop.
Save vorushin/765f51cfd0544638d63b90c5d0f990ab to your computer and use it in GitHub Desktop.
% GNU Octave file (may also work with MATLAB(R) )
Fs=44100;minF=10;maxF=Fs/2;
sweepF=logspace(log10(minF),log10(maxF),200);
preemph_coeff = 1
b0 = 1 * preemph_coeff
b1 = -1.700724000000000e+00 * preemph_coeff + (1 - preemph_coeff)
b2 = 7.029381524255900e-01 * preemph_coeff
a0 = 2.380612232632074e-01 * preemph_coeff + (1 - preemph_coeff)
a1 = -1.718545401961680e-01 * preemph_coeff
a2 = -4.429177968575995e-02 * preemph_coeff
[h,w]=freqz([b0, b1, b2],[a0, a1, a2],sweepF,Fs);
semilogx(w,20*log10(h))
grid on
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment