Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | The name of the input workspace. |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | The name of the output workspace. |
WorkspaceIndex | Input | number | 0 | Spectrum index for smoothing |
Filter | Input | string | Zeroing | The type of the applied filter. Allowed values: [‘Zeroing’] |
Params | Input | string | The filter parameters |
FFTSmooth uses the FFT algorithm to create a Fourier transform of a spectrum, applies a filter to it and transforms it back. The filters remove higher frequencies from the spectrum which reduces the noise.
This version of the FFTSmooth algorithm has one filter:
Example: Zeroing with Params=2
ws = CreateSampleWorkspace(function="Multiple Peaks",XMax=20,BinWidth=0.2,BankPixelWidth=1,NumBanks=1)
#add a bit of predictable noise
noiseAmp=0.1
noiseArray= []
for i in range(ws.blocksize()):
noiseAmp = -noiseAmp
noiseArray.append(noiseAmp)
for j in range(ws.getNumberHistograms()):
ws.setY(j,ws.readY(j)+noiseArray)
wsSmooth = FFTSmooth(ws, Params='2', Version=1)
print "bin Orig Smoothed"
for i in range (0,100,10):
print "%i %.2f %.2f" % (i, ws.readY(0)[i], wsSmooth.readY(0)[i])
Output:
bin Orig Smoothed
0 0.20 0.30
10 0.20 0.30
20 0.37 0.47
30 10.20 10.30
40 0.37 0.47
50 0.20 0.30
60 8.20 8.30
70 0.20 0.30
80 0.20 0.30
90 0.20 0.30
Categories: Algorithms | Arithmetic\FFT | Transforms\Smoothing