added smoothing operations and fixed bugs in plotSpectrum