Wavelet Filtering Example
In this example, we use existing data rather than creating sample data. The example file is damped sine wave data with severe high-frequency noise.
- Use the input variable to define the data to use:
- Create another variable to contain the output from the READ_BINARY function. READ_BINARY reads the contents of a file based on keywords or a predefined template. The DATA_DIMS keyword sets a scalar or array specifying the size of the data to be read and returned. (The array value of
damp_sn.datis provided in theindex.txtfile inexamples/data.) - Plot the data:

- Use the wavelet transform to reduce the noise in the plot:
- Plot the smoothed data:
input = FILEPATH('damp_sn.dat', $
SUBDIRECTORY=['examples', 'data'])
output = READ_BINARY(input, DATA_DIMS=[512,1])
smooth=WV_DENOISE(output, $
'Coiflet', 3, PERCENT=50)
Note that we specify the Y range to ensure that it is the same as in the previous plot.
