A suggested reference for Spectroscopy in the form of interactive textbook is available at the link http://astronomy.nju.edu.cn/~lixd/GA/AT4/AT404/HTML/AT40400.htm (use "Next" and "Previous" at the bottom for navigation). Initial notes below are based on the section "Spectral Lines".
An object can emit or absorb radiation. We use a spectroscope to analyze emission and absorption. In its simplest form, a spectroscope is a prism or a diffraction grating. We also need to place a structure with a slit in front in order to obtain a fine beam that will be analyzed.
A light bulb (and specifically its filament) emits in all colors of the visible spectrum and therefore we obtain a continuous spectrum.
If we heat some sodium powder with a flame, we will vaporize it and we will obtain a gaseous phase. If we direct the light from this to a spectroscope, we will see the emission of a bright yellow light, as shown in Figure 1 (flame test - note that a similar result is obtained with table salt which is NaCl)). If we analyse the emitted light, we will find out that it consists of just two spectral lines or just two wavelengths, around 589 nm as shown in Figure 2(a).
If we have a cold vapour of sodium and we shine light from the light bulb on it, we will see that it will absorb at the same wavelengths and leave two dark lines on the continuous spectrum that would be given by the bulb. This is shown in Figure 2(b).
Figure 1: The flame test of sodium shows a brilliant yellow color
By Søren Wedel Nielsen - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=185068 (https://en.wikipedia.org/wiki/Flame_test)
Figure 2: (a) Emission spectrum of sodium and (b) absorption spectrum of sodium.
If we consider a star, for instance the Sun ('we call in general '"sun" the star that is at the center of a planetary system), it has a hot core and a cold atmosphere which consists of different gases. Light from the hot core is absorbed from atoms of different elements in the atmosphere before it arrives to us and therefore specific wavelengths unique to those atmospheric gases are "subtracted" and specific absorption lines are generated.
It was the German physicist Fraunhofer that systematically mapped over 570 lines and attributed the letters A to K to the principal lines and other letters to weaker lines (Figure 3). Later Kirchhoff and Bunsen noticed that several Fraunhofer lines coincide with the emission lines of specific heated elements (cf. https://en.wikipedia.org/wiki/Fraunhofer_lines). For instance, the D1 and D2 lines were found to correspond to the emission spectrum of Na and respectively to wavelengths 589.592 and 588.995.
Figure 3: Solar spectrum with Fraunhofer lines
Figure 4 shows the emission spectra for H, He, Ne, Na and Hg (source for image and interesting discussion at the link https://bit.ly/2qqkaqT).
Figure 4: Emission spectra for H, He, Ne, Na and Hg (https://bit.ly/2qqkaqT).
How to create a spectroscope with a piece of a CD and a cereal box
DIY spectroscope and SpectraSnapp app
Use of a diffraction grating or CD piece in front of the iPhone camera and attachment of a paper tube.
Visit to a home decor store at the light section and examination of different lights e.g. neon etc.
Identification of the light source based on the absorption spectrum.
Figure 5: Screen capture from video https://youtu.be/FJ1xOWl5Axk?t=32s
DIY spectroscope and app
Can we calculate the spectral lines? In the case of hydrogen we can do calculations using Bohr's model.
For his model, Bohr used two assumptions (https://en.wikipedia.org/wiki/Bohr_model).
At the link https://www.khanacademy.org/science/physics/quantum-physics/atoms-and-electrons/v/bohr-model-radii-derivation-using-physics there is a video tutorial which describes Bohr’s model. As mentioned in the video, it was Bohr that came up with the second assumption.
The model predicts specific allowed orbits and energy levels for the electron (note that in quantum mechanics the term “orbital” is used).
If the electron absorbs a photon it will gain energy and will move to a higher energy level. It is then possible that the photon is emitted spontaneously and the electron falls back to a lower energy level. Given that the allowed energy levels are strictly defined, they are quantized as mentioned, only photons of specific energy can be absorbed. All other photons will have no influence on the atom. Therefore, if we shine light on a hydrogen atom, it will only absorb and subsequently emit specific wavelengths. These will correspond to the emission spectrum of hydrogen.
There is a demonstration of the calculation of the emission lines of hydrogen at a video tutorial from Khan academy found at the link: https://www.khanacademy.org/science/physics/quantum-physics/atoms-and-electrons/v/emission-spectrum-of-hydrogen
(cf. Figure 6 - Video figure ).
Figure 6 (Video-figure): Calculation of the emission lines of hydrogen using Bohr' model. From Khan academy (YouTube link: https://youtu.be/Kv-hRvEOjuA).
Let us consider the red line at the emission spectrum of hydrogen shown in Figures 4 and 6. If we examine it with high resolution, we will observe that it will be split in two closely spaced lines. This feature reflects the fine structure of hydrogen. It is caused by the internal magnetic field in the atom which is due to the interaction between the orbital angular momentum and the spin. It is called the spin-orbit interaction.
Reference link: http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/hydfin.html
The spin-orbit interaction is responsible in the case of sodium for the two spectral lines mentioned above. The D1 and D2 lines constitute the "sodium doublet", the centre wavelength of which (589.29 nm) is given the designation letter "D". The electronic configuration of Na which has 11 electrons is 1s2,2s2,2p6,3s1 (Ref. https://terpconnect.umd.edu/~wbreslyn/chemistry/electron-configurations/configurationSodium.html).
Upon excitation by photon absorption, the electron will move from the ground state to a p orbital (first excited state). As mentioned in Wikipedia at the link https://en.wikipedia.org/wiki/Fraunhofer_lines, "this historical designation for line D has stuck and is given to all the transitions between the ground state and the first excited state of the other alkali atoms as well. The D1 and D2 lines correspond to the fine-structure splitting of the excited states." Therefore, for historical reasons, this transition is given the name "D-transition". This may be confusing because there are also d orbitals.
Reference link: http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/sodzee.html
You can read more about the spin-orbit interaction here: http://www.information-book.com/physics/spin-orbit-interaction/
It may be useful to have a refresher about the structure of the atom and the quantum numbers using this link: http://www.information-book.com/physics/motion-in-microcosm-quantum-mechanics/
"It can be applied to a variety of types of spectroscopy including optical spectroscopy, infrared spectroscopy (FTIR, FT-NIRS), nuclear magnetic resonance (NMR) and magnetic resonance spectroscopic imaging (MRSI), mass spectrometry and electron spin resonance spectroscopy."
"The most straightforward way to measure a spectrum is to pass the light through a monochromator, an instrument that blocks all of the light except the light at a certain wavelength (the un-blocked wavelength is set by a knob on the monochromator). Then the intensity of this remaining (single-wavelength) light is measured. The measured intensity directly indicates how much light is emitted at that wavelength. By varying the monochromator's wavelength setting, the full spectrum can be measured. This simple scheme in fact describes how some spectrometers work.
Fourier-transform spectroscopy is a less intuitive way to get the same information. Rather than allowing only one wavelength at a time to pass through to the detector, this technique lets through a beam containing many different wavelengths of light at once, and measures the total beam intensity. Next, the beam is modified to contain a different combination of wavelengths, giving a second data point. This process is repeated many times. Afterwards, a computer takes all this data and works backwards to infer how much light there is at each wavelength."
"As mentioned, computer processing is required to turn the raw data (light intensity for each mirror position) into the desired result (light intensity for each wavelength). The processing required turns out to be a common algorithm called the Fourier transform (hence the name, "Fourier-transform spectroscopy"). The raw data is sometimes called an "interferogram"."