xboa
_hanning_smoothing.py
Go to the documentation of this file.
1 import copy
2 
3 class HanningSmoothing(object):
4  def __init__(self):
5  pass
6 
7  def smooth(self, data):
8  omega = math.pi*len(data)
9  data_out = copy.deepcopy(data)
10  for i_index, item in enumerate(data):
11  x_smoothed = data[index]
12  for j_index, item in enumerate(data):
13  x_smoothed += data[j_index]*cos(omega*(j_index-i_index))**2.
14  data_out[index] = x_smoothed
15  return data_out