The results, when "smoothdemo.m" is run (with a noise array length of 10^7 to insure accurate sampling of the noise), are shown by the figure and text print-out below. The four quadrants of the graph are: (upper left) the original Gaussian peak before smoothing and without noise; (upper right) the peak height of the smoothed signal as a function of smooth ratio; (lower left) the standard deviation of the noise as a function of smooth ratio; the signal-to-noise ratio (SNR) as a function of smooth ratio (lower right). The different smooth types are indicated by color: blue - sliding-average; green - triangular; red - pseudo-Gaussian, and cyan - Savitzky-Golay.

The function also calculates and prints out the elapsed time for a each smooth type and the maximum in the SNR plot.

1. Sliding-average:

Elapsed Time: 0.26 Opt. SNR: 15.1 at smooth width of 1.25

2. Triangular:

Elapsed Time: 0.59 Opt. SNR: 15.8 at smooth width of 1.11

3. Pseudo-Gaussian:

Elapsed Time: 0.87 Opt. SNR: 15.6 at smooth width of 0.93

4. Savitzky-Golay:

Elapsed Time: 4.5 Opt. SNR: 20.3 at smooth width of 1.74

These results clearly show that the Savitzky-Golay smooth gives the smallest peak distortion (smallest reduction in peak height), but, on the other hand, it gives the smallest reduction in noise amplitude and the longest computation time (by far). The pseudo-Gaussian smooth gives the greatest noise reduction and, below a smooth ratio of about 1.0, the highest signal-to-noise ratio, but the Savitzky-Golay smooth gives the highest SNR above a smooth ratio of 1.0.

For applications where the shape of the signal must be preserved as much as possible, the Savitzky-Golay is clearly the method of choice. In the peak detection function, on the other hand, the purpose of smoothing is to reduce the noise in the derivative signal; the retention of the shape of that derivative is less important. Therefore the triangular or pseudo-Gaussian smooth is well suited to this purpose and has the additional advantage of faster computation speed.

The conclusions are essentially the same for a Lorentzian peak, as demonstrated by a similar function "smoothdemoL.m", the main difference being that the peak height reduction is greater for the Lorentzian.

A more sophisticated method of noise reduction, called wavelet denoising. That method is added to the modified script smoothdemoWavelet.m as method #5, and its performance is shown by the magenta markers in the graph on the left. For wavelet denoising, the role of the smooth ratio is replaced by the “level”, which varies from 1 to 11.

The key performance difference is that wavelet denoising does not reduce the peak height, which gives it an edge over the other methods. The maximum signal-to-noise ratio is greater than the other methods. The only downside is the execution time, which is 10 to 100 times slower.

(To run this yourself, you’ll need to have Matlab’s Wavelet Toolbox installed).

Last updated May, 2013. This page is part of "

Unique visits since May 17, 2008: