pp_lsnv — Local standard normal variate (LSNV)¶
Group: Preprocessing · C ABI: n4m_transform_local_snv_*
Description¶
Sliding-window (local) SNV.
Parameters¶
Name |
Type |
Default |
|---|---|---|
|
|
|
|
|
|
|
|
|
API and bindings¶
C ABI (ABI 2): n4m_transform_local_snv_create · n4m_transform_local_snv_destroy · n4m_transform_local_snv_transform. Use the linked public header for the exact signature, configuration, and result handles.
Python (verified public re-export):
from n4m.transform.scatter import LSNV
Source signature: LSNV(window: int = 11, pad_mode: str = 'reflect', constant_value: float = 0.0).
R (source-verified): local_snv_transform(X, window = 11L, pad_mode = "reflect", constant_value = 0).
library(n4m)
result <- local_snv_transform(X)
MATLAB / Octave: no current source-verified entry point was found for this catalog method.
Explanations¶
Bibliographic source¶
No single canonical paper defines this sliding-window variant. It locally applies the SNV concept of Barnes, Dhanoa & Lister (1989), https://doi.org/10.1366/0003702894202201.
Mathematical principle¶
For each wavelength, LSNV computes the mean and standard deviation in a centered window of the same spectrum and standardizes the center sample. Reflect, edge, or constant padding defines incomplete boundary windows.
Appropriate uses¶
Removing wavelength-dependent local offset and scale variation that one global SNV cannot represent.
Limits and validation¶
It can suppress broad chemical bands and amplify noise where local variance is small. Window width and padding materially affect the output, especially near edges.
Implementation¶
n4m.transform.scatter.LSNV calls n4m_transform_local_snv_*; rolling statistics and padding modes are implemented in preprocessing/scatter/local_snv.c.
The ABI-2 implementation is the n4m_transform_local_snv_* lifecycle in libn4m.
Sources and provenance¶
https://doi.org/10.1366/0003702894202201; https://github.com/GBeurier/nirs4all-methods/blob/main/cpp/src/core/preprocessing/scatter/local_snv.c
See also: methods index · interactive dashboard