[Eeglablist] pop_resample() - potential bug?
Andreas Widmann
widmann at uni-leipzig.de
Wed May 1 09:23:53 PDT 2024
Entering
[p,q] = rat(250/500, 1e-12)
on the MATLAB command line results in
p = 1
q = 2
where p and q are exactly 1 and 2 (and other results would be surprising).
Please double-check that your EEG.srate is *exactly* 500 and that you have not overloaded the MATLAB built-in rat() function.
Best,
Andreas
> Am 30.04.2024 um 22:42 schrieb Brian Harvey via eeglablist <eeglablist at sccn.ucsd.edu>:
>
> Attempt at resampling a 500Hz dataset to 250Hz (decimation of 0.5) results in [p,q] variables that are inappropriate... Looking into the script I see there are two different tolerances for rat() where one is commented out.
>
> Correct [p,q] values are returned when using the commented line (tolerance of 1e-4)
>
> % finding the best ratio
> % [p,q] = rat(freq/EEG.srate, 0.0001); % not used right now
> [p,q] = rat(freq/EEG.srate, 1e-12); % used! AW
>
>
> Brian Harvey
>
> Neural Circuits
>
> Biogen Inc.
>
> brian.harvey at biogen.com
>
>
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to eeglablist-request at sccn.ucsd.edu
More information about the eeglablist
mailing list