Javascript spectrum analyser