sp_filter: Filter noise form a spectroscopic signal

View source: R/sp_filter.R

sp_filterR Documentation

Filter noise form a spectroscopic signal

Description

Function first applies median and then Savitzky-Golay smoothing filters for each spectroscopic curve individually.

Usage

sp_filter(sp, k = 3, n = 25, p = 9)

Arguments

sp

hyperSpec object

k

Window for a median filter. If k = 0, median filter is not applied.

n

filter length (must be odd) for a Savitzky-Golay (SG)smoothing filter. If n = 0, SG filter is not applied.

p

filter order for a Savitzky-Golay smoothing filter

Examples

library(spHelper)
library(hyperSpec)

Original
Spectra2[1]  %>% plotspc()

# Filtered
Spectra2[1]  %>% sp_filter() %>% plotspc()


GegznaV/spHelper documentation built on April 16, 2023, 1:42 p.m.