View source: R/lighting_values.R
interpolate_sprague | R Documentation |
interpolate_sprague()
performs a special interpolation for a
spectrum with equidistant data points. interpolation of defined
spectrum data points.
interpolate_sprague(y, f)
y |
Numerical spectral data vector to be interpolated |
f |
Interpolation factor. Doubling the sampling rate with f = 2. |
This function is originally based on a Matlab code \insertCiteWestland2012lighting
and was adapted to R. Sampling rate must be at least doubled, i. e. f \ge
2.
And f must be nominal (2, 3, ...). #' For more insight of the sprague
interpolation method see \insertCiteWestland2015lighting.
A vector of interpolated data points using the Sprague method.
\insertAllCited{}
spectra_tbl <- tibble::tibble(wavelength = seq(380, 780, 5)) %>%
dplyr::mutate(p2700K = planck_law(wavelength, 2700)) %>%
dplyr::mutate(p5000K = planck_law(wavelength, 5000))
# interpolation to wavelength range seq(380, 780, 5)
interpolate_sprague(spectra_tbl$p2700K, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.