Skip to content

Instantly share code, notes, and snippets.

@grejppi
Created August 30, 2015 00:27
Show Gist options
  • Save grejppi/72ce39073d43be611931 to your computer and use it in GitHub Desktop.
Save grejppi/72ce39073d43be611931 to your computer and use it in GitHub Desktop.
using WAV
name = ARGS[1]
outname = ARGS[2]
input, rate = wavread(name)
input = sum(input, 2)
spectrum = fft(input)
rmax = maximum(abs(real(spectrum)))
imax = maximum(abs(imag(spectrum)))
output = [real(spectrum) imag(spectrum)] ./ max(rmax, imax)
wavwrite(output, outname, Fs=rate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment