I am currently analyzing respiration signal from 100 participants in R. In order to pre-process the data for my further analysis steps I am using a butterworth bandpass filter (order = 4, 0.2 - 5 Hz). The signal was sampled at 250Hz and the signals are between 60000 and 300000 data points long.
BW_FILT_RR = function (x) {
c(bwfilter(x, f = 250, n = 4, from = 0.2, to = 5.0, bandpass = TRUE))
} # Butterworth Bandpass Filter Function: order 4; for the 0.2 - 5Hz range
RR_clean = lapply(RR_clean, BW_FILT_RR) # RR_clean is a list of data frames with each df being one signal
Problem = After running the butterworth filter I have the problem that the first 500 - 1000 data points become extreme outliers. See: Example Plot Click Here. How do I avoid this? Or is the only option to simply remove the first 1000 data points?
I am grateful for any tips!
Best, Johnson