class_docstr: Object for Epoch/Evoked filtering.
docstr: Filter the data using Savitzky-Golay polynomial method.
  
  Parameters
  ----------
  h_freq : float
      Approximate high cut-off frequency in Hz. Note that this
      is not an exact cutoff, since Savitzky-Golay filtering
      :footcite:`SavitzkyGolay1964` is done using polynomial fits
      instead of FIR/IIR filtering. This parameter is thus used to
      determine the length of the window over which a 5th-order
      polynomial smoothing is used.
  %(verbose)s
  
  Returns
  -------
  inst : instance of Epochs or Evoked
      The object with the filtering applied.
  
  See Also
  --------
  mne.io.Raw.filter
  
  Notes
  -----
  For Savitzky-Golay low-pass approximation, see:
  
      https://gist.github.com/larsoner/bbac101d50176611136b
  
  .. versionadded:: 0.9.0
  
  References
  ----------
  .. footbibliography::
  
  Examples
  --------
  >>> import mne
  >>> from os import path as op
  >>> evoked_fname = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample', 'sample_audvis-ave.fif')  # doctest:+SKIP
  >>> evoked = mne.read_evokeds(evoked_fname, baseline=(None, 0))[0]  # doctest:+SKIP
  >>> evoked.savgol_filter(10.)  # low-pass at around 10 Hz # doctest:+SKIP
  >>> evoked.plot()  # doctest:+SKIP
docstr_tok: ["Filter","the","data","using","Savitzky-Golay","polynomial","method",".","Parameters","--","--","--","--","--","h_freq",":","float","Approximate","high","cut-off","frequency","in","Hz",".","Note","that","this","is","not","an","exact","cutoff",",","since","Savitzky-Golay","filtering",":","footcite",":","`","SavitzkyGolay1964","`","is","done","using","polynomial","fits","instead","of","FIR\/IIR","filtering",".","This","parameter","is","thus","used","to","determine","the","length","of","the","window","over","which","a","5th-order","polynomial","smoothing","is","used",".","%","(","verbose",")","s","Returns","--","--","--","-","inst",":","instance","of","Epochs","or","Evoked","The","object","with","the","filtering","applied",".","See","Also","--","--","--","--","mne.io.Raw.filter","Notes","--","--","-","For","Savitzky-Golay","low-pass","approximation",",","see",":","https",":","\/\/gist.github.com\/larsoner\/bbac101d50176611136b","..","versionadded",":",":","0.9.0","References","--","--","--","--","--","..","footbibliography",":",":","Examples","--","--","--","--",">",">",">","import","mne",">",">",">","from","os","import","path","as","op",">",">",">","evoked_fname","=","op.join","(","mne.datasets.sample.data_path","(",")",",","'MEG","'",",","'sample","'",",","'sample_audvis-ave.fif","'",")","#","doctest",":","+SKIP",">",">",">","evoked","=","mne.read_evokeds","(","evoked_fname",",","baseline=","(","None",",","0",")",")","[","0","]","#","doctest",":","+SKIP",">",">",">","evoked.savgol_filter","(","10",".",")","#","low-pass","at","around","10","Hz","#","doctest",":","+SKIP",">",">",">","evoked.plot","(",")","#","doctest",":","+SKIP"]
code: def savgol_filter(self, h_freq, verbose=None):
      """Filter the data using Savitzky-Golay polynomial method.
  
      Parameters
      ----------
      h_freq : float
          Approximate high cut-off frequency in Hz. Note that this
          is not an exact cutoff, since Savitzky-Golay filtering
          :footcite:`SavitzkyGolay1964` is done using polynomial fits
          instead of FIR/IIR filtering. This parameter is thus used to
          determine the length of the window over which a 5th-order
          polynomial smoothing is used.
      %(verbose)s
  
      Returns
      -------
      inst : instance of Epochs or Evoked
          The object with the filtering applied.
  
      See Also
      --------
      mne.io.Raw.filter
  
      Notes
      -----
      For Savitzky-Golay low-pass approximation, see:
  
          https://gist.github.com/larsoner/bbac101d50176611136b
  
      .. versionadded:: 0.9.0
  
      References
      ----------
      .. footbibliography::
  
      Examples
      --------
      >>> import mne
      >>> from os import path as op
      >>> evoked_fname = op.join(mne.datasets.sample.data_path(), 'MEG', 'sample', 'sample_audvis-ave.fif')  # doctest:+SKIP
      >>> evoked = mne.read_evokeds(evoked_fname, baseline=(None, 0))[0]  # doctest:+SKIP
      >>> evoked.savgol_filter(10.)  # low-pass at around 10 Hz # doctest:+SKIP
      >>> evoked.plot()  # doctest:+SKIP
      """  # noqa: E501
      _check_preload(self, "inst.savgol_filter")
      h_freq = float(h_freq)
      if h_freq >= self.info["sfreq"] / 2.0:
          raise ValueError(
              "h_freq must be less than half the sample rate"
          )
  
      # savitzky-golay filtering
      window_length = (
          int(np.round(self.info["sfreq"] / h_freq)) // 2
      ) * 2 + 1
      logger.info("Using savgol length %d" % window_length)
      self._data[:] = signal.savgol_filter(
          self._data, axis=-1, polyorder=5, window_length=window_length
      )
      return self
  
imports: from collections import Counter
  from copy import deepcopy
  from functools import partial
  from math import gcd
  import numpy
  from scipy import fft, signal
  from scipy.stats import f
  from ._fiff.pick import _picks_to_idx
  from ._ola import _COLA
  from .cuda import _fft_multiply_repeated, _fft_resample, _setup_cuda_fft_multiply_repeated, _setup_cuda_fft_resample, _smart_pad
  from .parallel import parallel_func
  from .utils import _check_option, _check_preload, _ensure_int, _pl, _validate_type, logger, sum_squared, verbose, warn
label_desc: Use image node_id 1 for calling the FilterMixin obj's underlying member method code with example usage: obj.savgol_filter(h_freq, verbose) and returns: self