# 4.3.10 Decimation and Signal Envelope

## Summary

Decimation is used to reduce the size of the signal sequence by merging every N samples into one.

Envelope detection adds an envelope curve to the input signal. Origin's signal envelope tool computes an envelope and plots an upper envelope, a lower envelope, or both.

## What You Will Learn

This tutorial will show you how to:

1. Decimate a signal to reduce the size of the input signal sequence.
2. Perform envelope detection to add the envelope curve.

## Decimation

In this tutorial, we are going to perform decimation on sunspot count data. Measurements of sunspot number were collected every month for more than 200 years. We will use decimation to reduce our dataset to one sunspot count for each year.

1. Start with a new workbook, and import the data <Origin Installation Directory>\Samples\Signal Processing\Sunspot.dat.
2. Select column A. Right click on the column and choose Set As: Y to set this column's plot designation to Y. This will ensure that sunspot number is not associated with column A as X. That is because decimation needs the X column data to be strictly monotonic.
3. Select column C and from the menu choose Analysis: Signal Processing: Decimation.... This opens the Decimation: decimate dialog box.
4. In the dialog, set Resample Factor to 12. Set the Filter Type to Moving Average Filter. To preview the result in the right panel, check the Auto Preview check box.
5. Click OK to output results.
6. In the worksheet, select column D (the X column generated from the result), then right-click and choose Insert from the shortcut menu to insert a new column. Right click again and choose Set As: Y to change the column's plot designation as Y.
7. Highlight the newly inserted column and right click on it and choose Set As: X from the context menu to change this column's plot designation to X. Right-click on the column again and choose Set Column Values... to bring up the Set Values dialog box and enter $data(1749, 1749+255)$ into the text box and and click OK.
8. Select column A, then right-click to choose Set As: X from the shortcut menu, to set the column's plot designation back to X. The final worksheet will look similar to the one below.
9. Press CTRL and select columns C and E. From the menu, choose Plot: Multi-Panel: Vertical 2 Panel to make a graph. Note that the decimated line looks smoother as the image below shows.