featureextracter.FeatureExtracter(data_ori, srate, n_chan, n_pnts, n_trials, channel_names, tmin=0, tmax=[], freq_bands=[[2, 4], [4, 8], [8, 12], [15, 30], [30, 80]], freq_band_names=['Delta', 'Theta', 'Alpha', 'Beta', 'Gamma'])¶Bases: object
Feature Extracter Class. Each Time Features object possess one instance. Used to extracted feature from the original data (amplitude usually). For frequency-based features, frequency bands of interest are defined (freq_bands) and the mean of the feature on these bands is computed.
| Attributes: |
|
|---|
Methods
bandpower_on_data([filt_type, filt_order, …]) |
|
||
cwt_on_data([wav_name, pfreqs, scale_type, …]) |
Apply the Continous Wavelet Transform to the data data_ori, return both power and phase average over the frequency bands. |
||
dwt_on_data(wav_name[, scale_type, …]) |
Apply the Discrete Wavelet Transform on the data | ||
filter_hilbert_on_data(center_freq, bandwidth) |
Estimate the phase of the data data_ori using band-pass filtering and the Hilbert transform. |
||
stft_on_data([win_name, win_dur, overlap, …]) |
|
bandpower_on_data(filt_type='butterworth', filt_order=3, scale_type=[], base_tstart=[], base_tend=[])¶| Parameters: |
|
|---|
cwt_on_data(wav_name=[], pfreqs=[], scale_type=[], base_tstart=[], base_tend=[])¶Apply the Continous Wavelet Transform to the data data_ori, return both power and phase average over the
frequency bands. Uses the PyWavelets module
| Parameters: |
|
|---|
dwt_on_data(wav_name, scale_type=[], base_tstart=[], base_tend=[])¶Apply the Discrete Wavelet Transform on the data
| Parameters: |
|
|---|
filter_hilbert_on_data(center_freq, bandwidth, ftype='elliptic', forder=4, f_tolerance=[], noise_tolerance=[], n_monte_carlo=5)¶Estimate the phase of the data data_ori using band-pass filtering and the Hilbert transform. The cos
and sin of the phase angle are returned, the phase angle is 2-pi periodic, thus cannot be used directly as a
feature in a classification or regression task.
see phase_utils.compute_robust_estimation()
| Parameters: |
|
|---|
stft_on_data(win_name='hamming', win_dur=0.2, overlap=0.85, nfft=[], scale_type=[], base_tstart=[], base_tend=[])¶| Parameters: |
|
|---|
featureextracter.bandpower_1d(x, srate, freq_bands, filt_type='butterworth', filt_order=3, scale_type=[], base_tstart=[], base_tend=[])¶Compute the power of input signal x in the different frequency bands defined by freq_bands. Signal x
is first passed through a band-pass filter specified by filt_type and filt_order, output amplitude is then
squared to get the power and the envelope is computed using the Hilbert transform
featureextracter.compute_band_mean(data, freqs, freq_bands, interp_method='linear', freqs_interp=[])¶Compute the mean of data over the frequency bands defined by freq_bands. The original data array
of shape [n_freqs * n_pnts] is first interpolated along the frequency axis before computing the mean.
The new frequency values can be specified by the freqs_interp parameter. By default the freqs_interp
parameter add 3 equally spaced points between each original frequency value.
| Parameters: |
|
|---|---|
| Returns: |
|
featureextracter.cwt_1d(x, srate, freq_bands, freqs=array([ 3., 3.273378, 3.57166783, 3.89713963, 4.25227037, 4.63976276, 5.06256577, 5.52389713, 6.02726778, 6.57650857, 7.17579948, 7.82970137, 8.54319073, 9.32169752, 10.17114651, 11.0980024, 12.10931895, 13.21279273, 14.41682166, 15.73056893, 17.16403273, 18.72812235, 20.43474121, 22.2968774, 24.32870262, 26.54567994, 28.96468154, 31.60411707, 34.48407379, 37.62646946, 41.05521906, 44.79641689, 48.87853512, 53.33264044, 58.19263056, 63.49549213, 69.28158225, 75.59493562, 82.48359962, 90. ]), n_cycles=array([ 1., 1.06081836, 1.12533558, 1.19377664, 1.26638017, 1.34339933, 1.42510267, 1.51177507, 1.60371874, 1.70125428, 1.80472177, 1.91448198, 2.03091762, 2.15443469, 2.28546386, 2.42446202, 2.57191381, 2.72833338, 2.89426612, 3.07029063, 3.25702066, 3.45510729, 3.66524124, 3.88815518, 4.12462638, 4.37547938, 4.64158883, 4.92388263, 5.22334507, 5.54102033, 5.87801607, 6.23550734, 6.61474064, 7.01703829, 7.44380301, 7.89652287, 8.3767764, 8.88623816, 9.42668455, 10. ]), scale_type=[], base_tstart=[], base_tend=[])¶Compute the Continuous Wavelet Transform for a 1 dimension input array x
| Parameters: |
|
|---|---|
| Returns: |
|
featureextracter.dwt_1d(x, srate, wav_name, do_plot=0, scale_type=[], base_tstart=[], base_tend=[])¶Discrete wavelet transform for input 1D array.
| Parameters: |
|
|---|---|
| Returns: |
|
featureextracter.get_bandpass_filter(srate, cutoff_freqs, filt_type='butterworth', filt_order=[])¶featureextracter.stft_1d(x, srate, freq_bands, win_name='hamming', win_dur=[], overlap=0.9, nfft=256, fmin=[], scale_type=[], base_tstart=[], base_tend=[])¶Compute the short-time Fourier transform
| Parameters: |
|
|---|---|
| Returns: |
|
featureextracter.tf_scaling(tf_power_mat, base_ind_start, base_ind_end, scale_type)¶Scale / Normalize the time-frequency map given the baseline time.
| Parameters: |
|
|---|---|
| Returns: |
|
featureextracter.zero_tf_edges(tf_mat, fs, freqs, n_period=2)¶