Bases: nitime.descriptors.ResetMixin
A class for performing filtering operations on time-series and producing the filtered versions of the time-series
Parameters : | time_series: A nitime TimeSeries object. : lb,ub: float (optional) :
boxcar_iterations: int (optional) :
gpass: float (optional) :
gstop: float (optional) :
filt_order: int (optional) :
iir_ftype: str (optional) :
fir_win: str :
|
---|
Filter the time-series by a boxcar filter.
The low pass filter is implemented by convolving with a boxcar function of the right length and amplitude and the high-pass filter is implemented by subtracting a low-pass version (as above) from the signal
Filter the time-series by passing it to the Fourier domain and null out the frequency bands outside of the range [lb,ub]
Zero-phase delay filtering (either iir or fir).
Parameters : | a,b: filter coefficients : in_ts: time-series object. :
|
---|
Filter the time-series using an FIR digital filter. Filtering is done back and forth (using scipy.signal.filtfilt) to achieve zero phase delay
Filter the time-series using an IIR filter. Filtering is done back and forth (using scipy.signal.filtfilt) to achieve zero phase delay
Bases: nitime.analysis.base.BaseAnalyzer
Analyzer class for extracting the Hilbert transform
Constructor function for the Hilbert analyzer class.
Parameters : | input: TimeSeries : |
---|
The natural output for this analyzer is the analytic signal
Bases: nitime.analysis.base.BaseAnalyzer
Analyzer class for extracting the (complex) Morlet wavelet transform
Constructor function for the Wavelet analyzer class.
Parameters : | freqs: list or float :
sd: list or float :
sd_rel: float :
f_min: float :
f_max: float :
nfreqs: int :
log_spacing: bool :
log_morlet: bool :
|
---|
The natural output for this analyzer is the analytic signal
Bases: nitime.analysis.base.BaseAnalyzer
Analyzer object for spectral analysis
The initialization of the
Parameters : | input: time-series objects : method: dict (optional), :
BW: float (optional), :
adaptive : {True/False}
low_bias: {True/False} :
|
---|
Examples
>>> np.set_printoptions(precision=4) # for doctesting
>>> t1 = ts.TimeSeries(data = np.arange(0,1024,1).reshape(2,512),
... sampling_rate=np.pi)
>>> s1 = SpectralAnalyzer(t1)
>>> s1.method['this_method']
'welch'
>>> s1.method['Fs']
3.14159265359 Hz
>>> f,s = s1.psd
>>> f
array([ 0. , 0.0491, 0.0982, 0.1473, 0.1963, 0.2454, 0.2945,
0.3436, 0.3927, 0.4418, 0.4909, 0.54 , 0.589 , 0.6381,
0.6872, 0.7363, 0.7854, 0.8345, 0.8836, 0.9327, 0.9817,
1.0308, 1.0799, 1.129 , 1.1781, 1.2272, 1.2763, 1.3254,
1.3744, 1.4235, 1.4726, 1.5217, 1.5708])
>>> s[0,0]
1128276.92538360...
This outputs both the PSD and the CSD calculated using algorithms.get_spectra().
Returns : | (f,s): tuple :
|
---|
This is the spectrum estimated as the FFT of the time-series
Returns : | (f,spectrum): f is an array with the frequencies and spectrum is the : complex-valued FFT. : |
---|
The standard output for this analyzer is a tuple f,s, where: f is the frequency bands associated with the discrete spectral components and s is the PSD calculated using mlab.psd().
This is the spectrum estimated as the FFT of the time-series
Returns : | (f,spectrum): f is an array with the frequencies and spectrum is the : complex-valued FFT. : |
---|