using NeuroAnalyzer
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 308480 × 1; 1204.996 s)
Load data:
using NeuroAnalyzer
= load("files/eeg.hdf"); eeg
[ Info: Loaded: EEG (24 × 308480 × 1; 1204.996 s)
Show sampling rate:
sr(eeg)
256
Resample to 512 Hz:
= NeuroAnalyzer.resample(eeg, new_sr=512);
eeg_512 sr(eeg_512)
512
Resample to 128 Hz:
= NeuroAnalyzer.resample(eeg, new_sr=128);
eeg_128 sr(eeg_128)
[ Warning: To prevent aliasing due to down-sampling, a low-pass filter should be applied before removing data points. The filter cutoff should be the Nyquist frequency of the new down-sampled rate, (64.0 Hz), not the original Nyquist frequency (128.0 Hz).
[ Warning: New sampling rate should be easily captured by integer fractions e.g. 1000 Hz → 250 Hz or 256 Hz → 512 Hz.
128
Calculate band frequency range:
band_frq(eeg, band=:alpha)
filter!(eeg, ch="all", fprototype=:butterworth, ftype=:bp, cutoff=band_frq(eeg, band=:alpha), order=8) NeuroAnalyzer.
m[ Info: Signal should be tapered prior to filtering to reduce edge artifacts
Progress: 8%|█▋ | ETA: 0:00:48Progress: 100%|████████████████████| Time: 0:00:04
(!) Band range is truncated is Nyquist frequency based on EEG sampling rate (128.0) is lower than the band range, e.g. gamma range (30.0-150.0 Hz) is truncated to: 30.0-127.9 Hz for 128 Hz signal.