interpolate_sprague: Interpolating spectrum using the Sprague method

View source: R/lighting_values.R

interpolate_spragueR Documentation

Interpolating spectrum using the Sprague method

Description

interpolate_sprague() performs a special interpolation for a spectrum with equidistant data points. interpolation of defined spectrum data points.

Usage

interpolate_sprague(y, f)

Arguments

y

Numerical spectral data vector to be interpolated

f

Interpolation factor. Doubling the sampling rate with f = 2.

Details

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 \ge2. And f must be nominal (2, 3, ...). #' For more insight of the sprague interpolation method see \insertCiteWestland2015lighting.

Value

A vector of interpolated data points using the Sprague method.

References

\insertAllCited{}

Examples

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)


Wei-Lim/lighting documentation built on Oct. 17, 2023, 3:20 p.m.