SignalToNoiseRatio: SignalToNoiseRatio

Description Usage Arguments Value Author(s) Examples

Description

Compute the Signal to Noise Ratio of a spectrometer

Usage

1
2
3
4
SignalToNoiseRatio(specStats, avgLamp = specStats$meanLamp, sdLamp = specStats$sdLamp, 


    avgDC = specStats$meanDC, sdDC = specStats$sdDC)

Arguments

specStats

alternative parameterization data.frame with columns meanLight, sdLight, meanDark, sdDark

avgLamp

numeric vector: mean spectrum of n scans of stable lamp

sdLamp

numeric vector: sd of the spectra acquired with a stable lamp

avgDC

numeric vector: mean spectrum of dark current measurements acquired with the same integration time as the measurements over the lamp

sdDC

numeric vector: sd of the dark current spectra acquired with with the same integration time as the measurements over the lamp

Value

numeric vector: ratio of signal and noise for each wavelength

Author(s)

Tommaso Julitta, Mirco Migliavacca, Thomas Wutzler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  





data("snr_data")


#perform statistics on spectra


lamp_mean<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_lamp,fun='mean')


#calculate mean of the lamp signal


lamp_sd<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_lamp,fun='sd')


#calculate standard deviation of the lamp signal


dc_mean<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_dc,fun='mean')


#calculate mean of the dark current signal


dc_sd<-StatsOnSpectra(wl=snr_data$wl,spectra=snr_data$data_dc,fun='sd')


#calculate standard deviation of the dark current signal


SNR<-SignalToNoiseRatio(avgLamp =lamp_mean,sdLamp = lamp_sd,avgDC = dc_mean,sdDC = dc_sd)


#plot results


x11();plot(snr_data$wl,SNR,type="l",ylab="SNR",xlab="WL [nm]")

tommasojulitta/FieldSpectroscopyCC documentation built on May 31, 2019, 6:19 p.m.