pyeeg.utils.signal_envelope
- pyeeg.utils.signal_envelope(signal, srate, cutoff=20.0, method='hilbert', comp_factor=0.3333333333333333, resample=125, verbose=None)
- Compute the broadband envelope of the input signal. Several methods are available: - Hilbert -> abs -> low-pass (-> resample) 
- Rectify -> low-pass (-> resample) 
- subenvelopes -> sum 
 - The envelope can also be compressed by raising to a certain power factor. - Parameters:
- signal (ndarray (nsamples,)) – 1-dimensional input signal 
- srate (float) – Original sampling rate of the signal 
- cutoff (float (default 20Hz)) – Cutoff frequency (transition will be 10 Hz) In Hz 
- method (str {'hilbert', 'rectify', 'subs'}) – Method to be used 
- comp_factor (float (default 1/3)) – Compression factor (final envelope = env**comp_factor) 
- resample (float (default 125Hz)) – New sampling rate of envelope (must be 2*cutoff < .. <= srate) Explicitly set to False or None to skip resampling 
 
- Returns:
- env – Envelope 
- Return type:
- ndarray (nsamples_env,)