fn_filt

Contents

Syntax

y = fn_filt(x,tau[,'l|h|b|n'][,dim][,filtertype][,'mirror']['mask'[,mask]][,'zero'][,'detrend']['complex|phase'])
y = fn_filt(x,tau[,options][,dim])
y = fn_filt(x,'detrend|detrendz'[,dim])

Description

FFT-based filter
Input:
- x       ND array - data
- tau     scalar or 2-elements vector or 2-element cell array - threshold
          period expressed in number of samples (tau = fsampling/fthresh)
          A sine wave of frequency fthresh will have its amplitude
          divided by two after filtering. Low-pass filtering with fn_filt
          is equivalent to convolution with a Gaussian kernel of standard
          deviation sqrt(2*log(2))/(2*pi)*tau...
          If there are 2 elements, they must verify tau(1) < tau(2)
- type    'l' for low-pass, 'h' for high-pass, 'b' for band-pass, 'n' for
          notch
          if type is not specified, it is gueesed from the format of the
          'tau' argument:
          taul or [taul 0] will result in a low-pass filtering
          [0 tauh] will result in a high-pass filtering
          [taul tauh] will result in a band-pass filtering
- dim     1, 2, or [1 2] - dimension where to apply the filter ([1 2]
          results in a 2-dimensional filtering)
- filtertype
          'gaussian'  [default] performs a Gaussian fft filter
          'sharp'     performs a 0-1 fft filter (warning: this creates
                      oscillations at near-threshold frequencies)
          'butterN'   Butterworth filter of order N (if N is omitted,
                      default value of N=2 is used)
- 'mirror'
          data will be padded with its mirror reflections before
          filtering, instead of the default which effectively does wrap
          around
- 'mask|maskin'
          points that do not have a full neighborhood are adjusted
          use 'maskin' flag to mask the input that is outside the mask,
          but not the output (e.g. for a low pass filter, the holes will
          be filled-in)
- 'zero'  will preserve the constant even in the case of high-pass and
          band-pass
- 'detrend'
          removes (if high-pass or band-pass) or keep! (if
          low-pass or notch) a linear trend; use fn_filt(x,'detrend')
          to perform only a detrending!, and fn_filt(x,'detrendz') to
          remove only the trend but not the constant
- 'complex'
          return a complex signal
- 'phase' or 'phase01'
          return the phase of the complex signal; 'phase01' results in
          values between 0 and 1 instead of between -pi and pi
- options a string summarizing all options: for example 'hmz' results in
          a high-pass filter, using mirror padding, and preserving the
          constant
          available shortcuts are:
          l,h,b,n     type (Low,High,Band,Notch)
          g,s,u       filter type (Gaussian,Sharp,bUtter)
          z           zero
          d           detrend
          m           mirror
          k           mask
Output:
- y       filtered data

Source

Thomas Deneux

Copyright 2015-2017