Added MIN() check to updateSmoothedSpectrum, in case spectrum[] or smoothedSpectrum[] are different sizes, attempt to avoid a memory buffer overflow