SPECTRA, IMAGES, SIMPLE FUNCTIONS, AND DENSITY FUNCTIONSNathan Hagen
Utsunomiya University, Department of Optical Engineering, Utsunomiya, Tochigi 321-8585 Japan
ABSTRACT
When working with spectra that represent optical power orphoton number, we must be very careful with our units. Since
most spectral transformations are nonlinear, the transformation Jacobian produces a nonlinear distortion of the spectrum.
A surprising number of researchers ignore these issues andmisrepresent their spectra in their publications.
Index Terms— spectrum, nonlinear transformation, density functions, distortion, Jacobian
1. INTRODUCTION
Most researchers, even in our field where they really should
know better, think of a spectrum as a simple graph. One canpoint to a location on a reflectivity spectrum curve and say
something like “look here — the reflectivity at λ = 600 nm is0.5.” If light reflects first from one surface and then another,
then we can simply multiply the two reflectance spectra together to get the overall reflectance of the combination. However, we cannot do this for an irradiance spectrum. We cannot
place a finger on a irradiance spectrum and say something like“see, the irradiance here at λ = 600 nm is 10 W m−2 ”. Unlike
the reflectance spectrum, the irradiance spectrum does not define the irradiance at a single point. Rather, it defines the differential irradiance with respect to the wavelength, as impliedby the units 10 W m−2 nm−1 , so that the irradiance value isgiven by integrating the spectrum over a specified range. As aresult, it also makes no sense to multiply two irradiance functions together.
While the distinction between these two forms of spectra
can be ignored in many circumstances, there are also many
situations in which they cannot, and inattention to this detail has produced errors in work published throughout ourfield. It is, for example, partly responsible for the surprisingly persistent fallacy that the human eye’s sensitivity ismatched to the peak of the Sun’s radiance spectrum.[1] The
fields of physics and engineering that use measurements of
optical spectra, like most other areas of physics, sometimes
forget to make clear distinctions between simple functions
and density functions. Very few textbooks even discuss theissue,[2] despite its fundamental importance in explaining theThis work was supported by JSPS KAKENHI Grant JP20K04516 Grantin-Aid for Scientific Research.

meaning of optical measurement. As a result, the relevance tospectrometry of the distinction between simple functions anddensity functions may not seem immediately obvious, but wewill show that while it can often be ignored in standard 2D
imaging, it often cannot be ignored in spectrometry withoutcausing severe errors.
One field where this distinction is introduced early on to
students, and hammered into their heads regularly in the curriculum, is probability theory, where the two are labelled as
mass functions and density functions. Here I will refer tothem as simple functions and density functions. While mathematicians who work in probability theory have a habit ofsaying that measure theory, Stieltjes integrals, and similar
20th century tools of mathematics are required tools in order to work with density functions,[3] these are unnecessary
for practical work. Physicists have been working with density
functions long before measure theoretic tools were developed,
and realize that one need only pay close attention to units andto the physical meaning of the quantities being manipulated.
2. WAVELENGTH ↔ WAVENUMBER
TRANSFORMATIONSThe Planck blackbody function provides a useful demonstration for how the units we use can affect the shape of the spectra we draw. The most common representation for the function is to calculate the spectral radiance in flux units of Watts
on a wavelength axis, using the expression
Le (λ) =
1
2hc2 
.
λ5 ehc/(λkbT ) − 1

Here, L is the spectral radiance [W m−2 sr−1 µm−1 ], with thesubscript “e” indicating the use of energy-based flux units.
The constants are the speed of light c [m/s], kB Boltzmann
constant [J/K], and Planck constant h [J s], while T [K] is thetemperature parameter, and λ [µm] is the wavelength. For the
Planck blackbody function represented in a different domainsuch as wavenumber or frequency, see Tab. 1.
Next we look at what happens when we try to transform the blackbody spectrum from a wavelength basis toa wavenumber basis. Here we will use the definition ofwavenumber as σ = 1/λ. (A common alternative definitionof wavenumber is k = 2π/λ.) Any legitimate transformation of the spectrum must preserve the overall energy (ornormalized spectral radiance

1.0

(a)

frequency [THz] or energy [eV]. Since these units are proportional to wavenumber, however, they only change the axis
labels and not the shape of the curve. These four options forthe abscissa are what we can call the “density units” of thespectrum. Table 1 gathers together a set of Planck function
representations for each different choice of domain.

0.8

0.6

0.4
W / (m2 sr μm)(photons s-1) / (m2 sr μm)

0.2

W μm / (m2 sr)(photons s-1 μm) / (m2 sr)

0.0

400

spectral radiance [a.u. ∝ W μm, or phot μm]

1 .0

600

800
wavelength [nm]wavelength [μm]0 .5

0 .7 51000

3. POWER ↔ PHOTON NUMBER
TRANSFORMATIONS

1200

0 .4

0 .3

1 .0
2

W μm / (m sr)(photons s-1 μm) / (m2 sr)
0 .8

0 .6

0 .4

0 .2

0 .0

(b)
1 .0

1 .5

2 .0

2 .5

3 .0

wavenumber [μm-1]

Fig. 1. (a) The Planck blackbody spectrum for a 5770 K
source (an approximation to the above-atmosphere solar radiance spectrum), normalized to a peak value of 1. The
black and blue curves are calculated in wavelength space,
while the red and green curves are calculated in wavenumber space, then re-sampled onto a linear wavelength grid inorder to demonstrate the change in shape. (b) The red andgreen curves calculated in a linear wavenumber space.
photon number) of the integrated spectrum. With this constraint, we can either work directly with infinitesimals towrite dσ = −dλ/λ2 or equivalently work with the integral
directly to write
Z λ2

Z σ(λ2 )dλdσ
dσσ(λ1 )Z σ(λ2 )Z σ2=L(λ(σ)) (−λ2 ) dσ =L(σ) λ2 dσL(λ) dλ =λ1

σ(λ1 )L(λ(σ))

σ1

where the last line uses the negative sign to swap the order ofintegration. The factor of λ2 inside the integral tells us that theresulting curve will have a different shape, as we see in Fig. 1,
where the above transformation is indicated by the black andred curves. Since the two curves are plotted together on thesame linear wavelength abscissa, one might justifiably feelthat doing this for the wavenumber-space representation is illegitimate. Indeed, drawing the curve this way does not preserve the energy of the integral. It does, however, preserve theshape of the function, so that we can demonstrate changes in
the location of the peak.
In addition to the wavelength and wavenumber axes, othercommon representations of optical spectra use abscissae of

While the wavelength-wavenumber transformation of thespectrum is widely recognized, and mistakes regarding it are
not so common in the literature, the transformation of flux
units from power (Watts) or photon number is abused almost
everywhere. Since the energy of a photon is wavelength
dependent, transforming the ordinate of the spectrum from
Watts to photons/sec causes a shift in the shape of a spectrum.
As a result, it matters very much which ordinate we choose.
In Fig. 1, two of the curves are representations for the Planck
blackbody curve using an ordinate proportional to photon
number rather than Watts. Since the number of photons perunit energy is larger at longer wavelengths, the transformation from Watts to photons lifts up the long-wavelength endof the spectrum — shifting the peak of the curve to the red.
The majority of detectors that we use in research thesedays are integrating sensors, such as the CCD and CMOS detector arrays used in imaging and spectrometry, as well as
cryo-cooled infrared detector arrays. The digital number thatthese sensors return is proportional to the number of photoelectrons collected by the sensor during the integration period. As a result, if we plot data from a digital spectrometer,
we should almost always choose the spectrum ordinate to be
proportional to photon number and not Watts.
The second category of detectors are flux sampling sensors, which include photodiodes and bolometers (among others). The digital number returned by these detectors is proportional to the instantaneous optical power incident on the faceof the sensor. Thus, if we plot data from a spectrometer using a microbolometer detector array, the appropriate ordinate
would be proportional to Watts.
The largest number of mistakes occur when authors drawa spectrum measurement and write “intensity [a.u.]” for theordinate of the plot. If the abscissa is labelled as wavelength(or wavenumber), then we can infer that the intensity mustalso be represented in wavelength (or wavenumber) space. If
the writer is discussing a modern detector array as the sourceof the measurements, then we can also infer that the ordinate must be proportional to photon number. In older publications, especially before the 1990s, almost all sensors were
flux-sampling, and so we can infer that the ordinate will be
proportional to optical power. However, the momentum ofhistory has been such that many modern authors persist in discussing radiometric units of optical power while using CCD
and CMOS integrating sensor arrays. The result is a misla-intensity [a.u. ∝ phot/μm]

1.0

(a)

0.8
0.6
(uniformly sampled)
0.4
0.2
0.0

400

500

600

0.8
0.6
(non-uniformly sampled)
0.4
0.2
0.0

1.0

1.2

1.4

1.6
1.8
2.0
wavenumber [μm-1]

2.2

2.4

900

1000

1.0

(b)

intensity [a.u. ∝ phot/μm-1]

intensity [a.u. ∝ phot/channel]

1.0

700
800
wavelength [nm]

(c)

0.8

0.6
(uniformly sampled)
0.4

0.2

0.0

2.6

1.0

1.2

1.4

1.6
1.8
2.0
wavenumber [μm-1]

2.2

2.4

2.6

Fig. 2. (a) A spectrum measured with a modern grating spectrometer, so that the appropriate units for the ordinate are proportional to phot/µm. A low-resolution discrete spectrum is superimposed over the measured spectrum. (b) The spectrum shown in(a) resampled onto a nonuniform wavenumber grid. The nonuniform sampling is not clear when the samples are tightly spaced(grey curve) but are obvious in the low-resolution discrete spectrum (black lines). (c) If we interpolate the spectrum from (a)onto a uniformly-sampled wavenumber grid, we need to rescale the individual channel bins in order to conserve overall photon
count.
Table 1. Planck blackbody expressions in different domains.[6]Spectrum variable
Wavelength λ:Frequency ν = c/λ:Quantum fluxLq (λ) = λ2c4 ehc/(λk1 bT ) −1

Optical power21
Le (λ) = 2hchc/(λk
T
)
λ5
b
e
−1

−1
−1
[photon s−1 m−2 sr µm ][W m−2 sr−1 µm−1
]2
Lq (ν) = 2ν
c2



1

ehν/(kbT ) −1

[photon s−1 m−2 sr−1 Hz−1 ]Wavenumber σ = 1/λ:Wavenumber k = 2π/λ:Energy E = hc/λ (eV):22

Lq (E) = c2E2 h3

3[W m−2 sr−1 cm]1eh̄ck/(kbT ) −1

[photon s−1 m−2 sr−1
 cm]



1
ehν/(kbT ) −12hc σ
Le (σ) = ehcσ/(kbT ) −1

Lq (σ) = ehcσ/(kbT ) −1
ck2
Lq (k) = 4π
33

[W m−2 sr−1 Hz−1 ]

2cσ 2

−1
[photon s−1 m−2 sr cm]

Le (ν) = 2hν
c2



2 3

Le (k) = h̄c4πk31eh̄ck/(kbT ) −1

[W m−2 sr−1 cm]

1eE/(kbT ) −1

[photon s−1 m−2 sr−1 eV−1 ]3

Lp (E) = c2E
2 h3





1
eE/(kbT ) −1

[W m−2 sr−1 eV−1 ]normalized intensity

0.5
0.4
0.3
0.2
0.1
0.0
450

500
550
600
wavelength (nm)650

Fig. 3. (a) Original figure from Ref. [7]. (b) The black curve copied and (red, blue) transformed.

belling of the axes, or a distortion of the spectrum shape.
Even Soffer & Lynch, who have written the article [1]most often cited regarding the fallacy of the eye’s optimization to green, focus their discussion almost entirely on
the wavelength-wavenumber transformation rather than theenergy-photon transformation, even though the meaning of
the abscissa transformation is unclear in the case of the eye.
It is clear, however, that the ordinate of the radiance spectrum
should be represented in photons rather than energy, since theretina is a quantum detector and not a power detector.[4, 5]
So far the discussion has focused on continuous representations of spectra. For laboratory measurements, however,what we obtain are discrete functions. Discrete representations give us extra flexibility because the spectra have alreadybeen integrated across the passband of the individual spectral
channel. If we transform the spectrum from one domain to another, we need only change the width of each individual channel by the appropriate amount without having to rescale themeasured data. Figure 2 gives an example of this. Figure 2(a)shows a spectrum measured with a grating spectrometer, sothat the individual spectral channels are approximately uniformly sampled in wavelength — that is, the channel bins are
all approximately the same width. As a result, the ordinate of
the figure can be written with units proportional to phot/µm orphot/channel, whichever the user prefers. Figure 2(b) shows
the same spectrum in which the edges of the spectral channels
have been translated to the wavenumber domain, while thevalues of the bins have been left unchanged. This of course
preserves the overall photon number, but it produces nonuniform sampling — the individual channels are no longer thesame width. Here the only appropriate way to write the ordinate would be with units proportional to phot/channel. If wewant to interpolate this spectrum onto a uniformly sampled
grid, then we need to re-scale the heights of the individual
discrete channels according to the Jacobian of the transformation (dλ → −λ2 dσ), the result of which is shown in Fig. 2(c).
Here the ordinate can now be written with units proportional
to phot/µm−1 or phot/channel.
Although it is perhaps unfair to single out any single author for violating these rules, it is useful to have an example demonstrating how normalization errors affect publisheddata. Figure 3(a) shows a figure taken from the literature, using a normalized ordinate, and nonuniformly sampled points
on the abscissa.[7] The authors use this figure to compare
their reconstructed spectra to measurements with a standard
laboratory spectrometer, and state that they scale the measurements from the lab spectrometer by normalizing themwith the “energies” at each point. This is not the correct
way to transform data taken with a photon integrating detector in order to compare to another photon-integrating sensor, but perhaps the authors meant only normalization by theareas. Figure 3(b) replicates the black curve from (a) but
rescales it according to the channel widths (red curve) andtotal channel energies (blue curve), followed by normaliza-

Table 2. The Wien displacement law for peak wavelength,
expressed in different domains.[8, 9]Spectrum variable

Quantum flux

Optical power

Wavelength λ:λw = 3669.7T µm K

λw = 2897.8T µm K

Frequency ν = c/λ:Wavenumber σ = 1/λ:Wavenumber k = 2π/λ:Energy E = hc/λ (eV):λw = 9028.4T µm K
λw = 9028.4T µm K
λw = 9028.4T µm K
λw = 9028.4T µm K

λw = 5099.4T µm K
λw = 5099.4T µm K
λw = 5099.4T µm K
λw = 5099.4T µm K

tion such that the highest channel value in the spectrum is
unchanged. Each curve is also drawn together with its implied channel rectangles. Whereas the correct transformation
cannot be determined from the authors’ original figure, using
channel rectangles preserves the concept that any transformation will preserve the integral under the curve, and makes it
easier to choose the correct transformation. As we can see
from the figure, the difference in shapes between the three
spectra is clear enough to indicate a visible color difference
to our eyes, and a significant difference in any error metricused to compare results. Note that the sudden difference between the original curve and transformed curves at the third
point from the left is due to an odd change in the sampling
distance between the points there.
4. THE EFFECT OF DOMAIN CHOICE ON WIEN’S
LAW
As illustrated in Fig. 1, one of the striking changes caused by achange in the flux units or density units in which we represent
a spectrum is that the peak of the blackbody spectrum. For aspectrum represented in W/µm, the expression governing thelocation of this peak is
λw = (2897.8 µm K) T −1 .
Thus, when we approximate the solar spectrum with a blackbody spectrum of a 5770 K object, we find that the Wien peakis located at a wavelength of 502 nm. Table 2 gives expressions for the Wien law for blackbody spectra expressed inother domains. For a spectrum represented in photons/µm, thesolar Wien peak shifts to 636 nm. If we switch to wavenumber densities, then the solar Wien peaks become 884 nm (forW µm) and 1565 nm (for photons µm). Figure 4 illustrates thechanges in the spectral shapes and peak locations as a function of temperature and domain.
5. NONLINEAR TRANSFORMS IN IMAGING DATA
While spectral transformations are often nonlinear, such as
the wavelength-wavenumber and energy-photon transforms,
most image transformations are linear. When distorting images, or mapping 3D surfaces onto 2D, the transformations

35

Wien
curve

30
25

350K

20
15

300K

10

250K

5

0.40

5

100

10
wavelength (μm)

20

10wavelength (μm)
5
7

15

20

0.35

3

4

(c)

400K
Wien
curve

0.30
0.25

350K

0.20

300K

0.15

250K

0.10
0.05
0.00

0

500

1000

1500

2000

1.8

400K

1.6
1.4

(b)

Wien
curve

1.2

350K

1.0
0.8

300K

0.6
0.4

250K

0.2
0.0

5

10

15

20

wavelength (μm)

2500

3000

wavelength (μm)
100

×1019
spectral radiance (photons s-1 m-2 sr-1 cm)

spectral radiance (W m-2 sr-1 μm-1)

400spectral radiance (W m-2 sr-1 cm)

(a)

400K

spectral radiance (photons s-1 m-2 sr-1 μm-1)

×1021

45

20

3.0

10

7

5

4

2.5

350K

2.0

1.5

300K

1.0

250K

0.5

0.0
-1

wavenumber (cm )

3

(d)

400K

Wien
curve
0

500

1000

1500

2000

2500

3000

frequency (THz)wavenumber (cm-1)
frequency (THz)

Fig. 4. The Planck blackbody function and Wien law, for various temperatures, in the domains proportional to (a) W/µm, (b)photons/µm, (c) W cm, and (d) photons cm.
A

A

B

7. REFERENCES

B

Fig. 5. Distortion of images is a nonlinear transform.

are often nonlinear, so that the same warnings that we discussed above for spectra apply for images as well. Figure 5
gives a simple example of a distortion mapping. In the caseof images, the ordinate is typically irradiance [W/m2 ], and so
it is the 2D integral over the spatial dimension that gives us
the energy value, or photon number, that we must conserve inorder to retain the correct brightness everywhere in the image.

[1] B. H. Soffer and D. K. Lynch, “Some paradoxes, errors,
and resolutions concerning the spectral optimization ofhuman vision,” Am. J. Phys. vol. 67: pp. 946–953, 1999.
[2] C. F. Bohren and E. E. Clothiaux, Fundamentals of Atmospheric Radiation. Wiley, 2006.
[3] G.-C. Rota, “Ten lessons I wish I had learned before
teaching differential equations,” in Meeting of the Math.
Assoc. of Amer. at Simmons College (1997).
[4] A. Rose, “The sensitivity performance of the human eye
on an absolute scale,” J. Opt. Soc. Am. vol. 38: pp. 196–
208, 1948.
[5] R. C. Jones, “Quantum efficiency of human vision,” J.
Opt. Soc. Am. vol. 49: pp. 645–653, 1959.
[6] E. L. Dereniak and G. D. Boreman, Infrared Detectors
and Systems. Wiley-Interscience, 1996.

6. CONCLUSION
Although it is rare for textbooks to call attention to the distinction between simple functions and density functions (Ref. [2]being a rare exception), we should be aware of the distinction between the two, and for most of us, we should makean effort to move away from using Watts when discussing
measurements taken with integrating sensors. For prism spectrometers or tunable filter spectrometers, in which the spectral
bins are nonuniformly spaced, being careful with these transformations is a necessity.

[7] L. Wang et al., “High-speed hyperspectral video acquisition by combining Nyquist and compressive sampling”,
IEEE Patt. Anal. Mach. Intel. vol. 41: pp. 857–870(2019).
[8] M. A. Heald, “Where is the “Wien peak”?” Amer. J. Phys.
vol. 71: pp. 1322–1326, 2003.
[9] S. M. Stewart, “Blackbody radiation functions and polylogarithms,” J. Quant. Spect. Rad. Trans. vol. 113:
pp. 232–238, 2012.