#' # Savitzky-Golay smoothing
if(! requireNamespace("signal", quietly = TRUE)) {
x1 <-
ir::ir_sample_data[1:5, ] |>
ir::ir_smooth(method = "sg", p = 3, n = 51, ts = 1, m = 0)
}
# Fourier smoothing
if(! requireNamespace("fda", quietly = TRUE)) {
x2 <-
ir::ir_sample_data[1:5, ] |>
ir::ir_smooth(method = "fourier", k = 21)
}
# computing derivative spectra with Savitzky-Golay smoothing (here: first
# derivative)
if(! requireNamespace("signal", quietly = TRUE)) {
x3 <-
ir::ir_sample_data[1:5, ] |>
ir::ir_smooth(method = "sg", p = 3, n = 51, ts = 1, m = 1)
}
Run the code above in your browser using DataLab