SPECPR Users’ Manual                                                   Page 8-f7.1

F7:  Smoothing Function                                   Alias: smoo[th]
This routine smoothes a spectrum by performing a weighted smoothing of
adjacent channels.  First, the channels are sorted into increasing
wavelengths; note that the smoothing is done in channel space only.  The
user then chooses how many channels to include on each side of each data
point.  Each point is weighted by the inverse power of 2 with the power
increasing with increasing distance from the data point to be smoothed.
If the parameter giving the number of channels to include on each side
of a given channel is n, then for n = 1 data point D at channel i is computed by

                  Di = [ ½Di-1 + Di + ½Di+1]/2.                (eqn 8.f7.1)

For n = 2

           Di = [ ¼Di-2 + ½Di-1 + Di + ½Di+1  ¼Di+2]/2.5.      (eqn 8.f7.2)

In general

            ╭ Di-n          Di-1        Di+1          Di+n ╮
            ┥ ———— + .... + ———— + Di + ———— + .... + ———— ┝
            ╰  2n            2           2             2n  ╯
      Di = —————————————————————————————————————————————————   (eqn 8.f7.3)
                        ╭     2          2  ╮
                        ┥ 1 + —— + ... + —— ┝
                        ╰     21         2n ╯

and

      ╭ σ2i-n         σ2i-1        σ2i+1         σ2i+n ╮ ½
      ┥ ———— + .... + ———— + σ2i + ———— + .... + ————  ┝
      ╰  2n            2            2              2n  ╯
σi = ———————————————————————————————————————————————————  (eqn 8.f7.4)
                  ╭     2          2  ╮
                  ┥ 1 + —— + ... + —— ┝
                  ╰     21         2n ╯

The parameter n can vary from 1 to the number of channels divided by 2. When the smoothing is finished, the data are sorted into the original order. The wavelength record default is the current wavelength set in use (and is printed on the CRT). If another wavelength set is desired, type the wavelength file id and record number on the same line as the parameter n (which must be first on the line). Also, if data only in a certain range is to be considered, on the same line, type an "l" command (for limit) and the range limits:

l n1 n2

where n1 and n2 are the minimum and maximum data numbers to be included. Default limits on l are -1.0x1034 to +1.0x1034. For example, the following command (all on one line):

2 V15 l -50 30000

sets the n = 2, wavelength set V15, and set limits to be -50 to 30,000. If certain channels should be deleted, type

d

to delete points. You will then be asked to type in the points to be deleted. When you are finished typing in points to be deleted, type

c

to continue. A data set must be specified before the f7 command, and errors can be included. The parameter n seems to give excellent results when it is 1 or 2. When n gets larger, there seems little difference in the smoothed result compared to smoothed data with n=2.