@verbose
def fit_iir_model_raw(raw, order=2, picks=None, tmin=None, tmax=None, verbose=None):
 from ..cov import _apply_scaling_array
 (start, stop) = (None, None)
 if (tmin is not None):
  start = raw.time_as_index(tmin)[0]
 if (tmax is not None):
  stop = (raw.time_as_index(tmax)[0] + 1)
 if (picks is None):
  picks = _pick_data_channels(raw.info, exclude='bads')
 data = raw[picks, start:stop][0]
 picks_list = _picks_by_type(pick_info(raw.info, picks))
 scalings = _handle_default('scalings_cov_rank', None)
 _apply_scaling_array(data, picks_list=picks_list, scalings=scalings)
 (coeffs, _) = _yule_walker(data, order=order)
 return (np.array([1.0]), np.concatenate(([1.0], (- coeffs))))

@ verbose def fit_iir_model_raw ( raw , order = 2 , picks = None , tmin = None , tmax = None , verbose = None ) : from . . cov import _apply_scaling_array ( start , stop ) = ( None , None ) if ( tmin is not None ) : start = raw . time_as_index ( tmin ) [ 0 ] if ( tmax is not None ) : stop = ( raw . time_as_index ( tmax ) [ 0 ] + 1 ) if ( picks is None ) : picks = _pick_data_channels ( raw . info , exclude = 'bads' ) data = raw [ picks , start : stop ] [ 0 ] picks_list = _picks_by_type ( pick_info ( raw . info , picks ) ) scalings = _handle_default ( 'scalings_cov_rank' , None ) _apply_scaling_array ( data , picks_list = picks_list , scalings = scalings ) ( coeffs , _ ) = _yule_walker ( data , order = order ) return ( np . array ( [ 1.0 ] ) , np . concatenate ( ( [ 1.0 ] , ( - coeffs ) ) ) )
fit an ar model to raw data and creates the corresponding iir filter .