added spectrum analyzer
rebinning function added