Removing spikes and offset jumps

Spectrum Viewer has several functions to get your spectrum back into shape. Let's look at the following example, taken from the file "Spikes Example.svf" in the TestSpectra folder:

Between X-values 900 and 1050 the measurement shows a strange pattern. There are spikes and an offset jump. When you are sure this is a measurement error and not actually a legitimate measurement, you can try to correct it with Spectrum Viewer. First, let's zoom in on the affected area: draw a rectangle around it (with click-drag) and then right-click.

   

Select the plot and draw a rectangle around some spikes (selecting is done by double-clicking near the plot). Press ctrl-del (or via the menu: Smooth->Delete data points->Interpolate) and they are gone.

       

When deleting spikes this way the number of data points doesn't decrease because the Y-values of the spikes are placed on a line between their surrounding valid data points. There is still an ugly offset jump to correct though. To correct it, select the affected part, choose the menu option "Position->Drag plot". Within drag plot mode, choose "shift Y". You can now simply drag the offset jump to its place.

     

If you are using Spectrum Viewer Basic, drag plot is disabled. However, there's still another way you can correct offset jumps, with "Smooth->Delete offset jumps". You will be asked for the maximum absolute Y jump, and the width. The smallest Y jump of the offset of this particular plot is on the right-hand side. Its value is about 13 (it jumps from 60 to 73), so we will stay just below that value by filling in 12. The width is used to calculate a mean value of the jump height around the jumping point. For very clean plots, use 1. For very noisy plots, use a high value, 10 or more. A width of 3 seems to be a good default, and that is what we will use here. To summarize: draw rectangle, choose "Delete offset jumps", fill in 12 and 3, and as you will see, the offset jump will disappear as well.

To do a final clean-up of the plot, we will smooth it. Press F8, or choose "Smooth->Smooth". You will be asked for the width, once more. When you fill in a value of 3, the Y-value of each data point will be an average of 7 data points: 3 to the left, 3 to the right, and the data point itself. The X-values are left alone, this way the number of data points on your plot stays the same. Experiment with the width value to get the best results. A low value will not do very much, a high value will alter the plot considerably. 

     

As you can see, the value of 50 is a bit too much...

By drawing a rectangle around a part of the plot before smoothing it you will only smooth the part within the rectangle.

Other interesting smoothing options in the smooth menu are:

One final warning though. Spectrum Viewer can be used to make your plots into something they are not. When you clean up a plot you are altering your data. Sometimes unexpected results are just that, unexpected results, and not measurement errors. It is up to you to decide whether or not your plot actually has measuring errors, which may be cleaned up safely. In any case: keep a copy of your original data! You may need to go back to it years from now.