Simplified bandwith and dof calculation

master
Per A Brodtkorb 9 years ago
parent 31b61e2117
commit f112d95b97

@ -1171,19 +1171,13 @@ class TimeSeries(PlotData):
'''Returns bandwidth (rad/sec) and degrees of freedom '''Returns bandwidth (rad/sec) and degrees of freedom
used in chi^2 distribution used in chi^2 distribution
''' '''
Be = v = None
if isinstance(wname, tuple): if isinstance(wname, tuple):
wname = wname[0] wname = wname[0]
if wname == 'parzen': dof = int(dict(parzen=3.71, hanning=2.67,
v = int(3.71 * n / L) bartlett=3).get(wname, np.nan) * n/L)
Be = 2 * pi * 1.33 / (L * dt) Be = dict(parzen=1.33, hanning=1,
elif wname == 'hanning': bartlett=1.33).get(wname, np.nan) * 2 * pi / (L*dt)
v = int(2.67 * n / L) return Be, dof
Be = 2 * pi / (L * dt)
elif wname == 'bartlett':
v = int(3 * n / L)
Be = 2 * pi * 1.33 / (L * dt)
return Be, v
def tospecdata(self, L=None, tr=None, method='cov', detrend=detrend_mean, def tospecdata(self, L=None, tr=None, method='cov', detrend=detrend_mean,
window='parzen', noverlap=0, ftype='w', alpha=None): window='parzen', noverlap=0, ftype='w', alpha=None):

Loading…
Cancel
Save