NMR is a form of spectroscopy which uses the fact that certain nuclei can, depending on their structure, behave like tiny spinning magnets. Two of the most common nuclei used for NMR spectroscopy are 1H and 13C. When materials that contain carbon or hydrogen atoms in them are placed in a magnetic field, there are two possible orientations of these nuclei can exist in with respect to the field: a low energy orientation in which the nuclear magnet is aligned with the field, and a high energy orientation in which the nuclear magnet is aligned against the field. The effect of this is to split the energy levels of the nuclei. This makes it possible to cause a transition between the two energy levels by the absorption of electromagnetic radiation of appropriate energy- which in this instance, is in the radio wave range.
The exact energy of these changes depends upon the environment of the nuclei, if the C or H is in an electron deficient environment it will appear at a different frequency in the spectrum than a C or H that is surrounded by more electron density (the nucleus is said to be shielded by the electrons.) From a study of the different energies absorbed as the nucleus flips from one spin state to another, it is possible derive information about the structure of the compound.
Spectrum of cyclohexenone
The information that can be obtained from simple NMR spectra has to do with the number and type of nuclei that are in a certain compound. The simplest type of NMR spectrum is based on 13C. 13C is a minor isotope of carbon (about 1% of natural abundance) and is present in all naturally occurring samples of carbon compounds. In a 13C spectrum, each carbon atom in the molecule will give rise to a signal or peak in the spectrum based on its chemical environment. For example, ethanol (CH3CH2OH) has two peaks in its 13C spectrum because there are two, and only two distinct chemical environments that a carbon atom can “inhabit”. In contrast, cyclohexenone produces a spectrum that has six distinct peaks, because each of the six carbon atoms in the molecule inhabits a distinctly different environment. Benzene (C6H6) on the other hand has only one signal in its 13C NMR spectrum since there is only one type of carbon in this molecule, all the positions in the ring are equivalent. (Draw out the Lewis structure to convince yourself that this is true)
Proton or 1H NMR spectra appear more complicated because each hydrogen atom tends to give a signal that is split into several different peaks. This is because each H nucleus can be affected by the neighboring nuclei. This produces multiple energy levels for each H, which results in more complex spectra. 13C appears simpler because there are typically only one (or zero) 13C nucleus in any molecule, therefore there are no interactions by nearby carbons (12C does not have different nuclear energy levels in a magnetic field). Note that this 1H NMR spectrum is much more complex than the 13C NMR. However, there are five distinct clusters of signals and there are five kinds of protons in the compound that gives rise to this spectrum
A variant of NMR is Magnetic Resonance Imaging (MRI), which is based on the same underlying nuclear behaviors, but uses a somewhat different approach. In MRI the material (usually a person) from which you want to record the spectrum is placed in a large magnet which separates the nuclear spin states as described above. The target is irradiated with a pulse of radiowaves that promotes all the nuclei up to their highest accessible energy state. As the nuclei decay back to the lower spin state they emit photons. Instead of detecting the energies of these photons, the system records the times it takes for photons to be emitted as the nuclei drop back to their lowest energy states. These times are dependent on the environment of the nuclei making it possible, through data manipulation, to develop internal visualizations of the body in the scanner.
These are just a few types of examples of spectroscopy. There are many more that you may encounter, but typically these methods all depend on recording how matter and energy interact and using that data to determine the arrangement of the atoms in the matter that is under investigation.