barbaLab / nigeLab

Neurophysiological data analyses by engineers, for physiologists.
GNU General Public License v3.0
14 stars 2 forks source link

[BUG] Uncontrolled sample rate changes with downsampling #100

Open m-nishim0t0 opened 3 months ago

m-nishim0t0 commented 3 months ago

Need to address downsampling issue with logLira in unitFilt.

FrancescoNegri commented 3 months ago

When running doUnitFilter, each channel goes through the following steps:

  1. Stimulus artifacts rejection (optional)
  2. Filtering
  3. Downsampling (optional)

If downsampling is enabled, the Block.SampleRate is modified after the first processed channel and the subsequent channels believe that new frequency is their original sample rate. This causes isssues in the conversion of stimulus onsets from time to samples and also in the filtering step, when setting the filter characteristics.