Frequency spectrum
From Academic Kids

In mathematics, physics and signal processing, the frequency spectrum is a representation of a signal or other function in terms of frequency (in the "frequency domain"). It is the projection of the function onto a set of sinusoidal basis functions. It can be found from the result of a Fourierrelated transform.
A frequency spectrum contains both amplitude and phase information. The power spectrum describes how much of the "energy" (loosely defined) of the function or signal lies in any given frequency band, without regard for the phase.
Contents 
Of a discrete signal
Ideally, if one has a continuous signal, one would use the full Fourier transform to compute the frequency spectrum, but often only a finite set of discrete samples is available, in which case one generally applies spectral estimation techniques to some form of discrete Fourier transform. Also, some signals are inherently discrete. This is also called nonparametric spectrum estimation, as no prior knowledge or assumption goes into the calculation. The contrasting approach is parametric spectrum estimation, e. g. using an autoregressive moving average model.
Frequencyamplitude spectrum
Besides being important in mathematics and physics, the spectrum amplitude versus frequency is very important for digital signal processing and for audio processing software that needs to recognize the frequency of the signal before processing it.
Let x(t) be the equation of our sampled signal on the time domain.
Let [0, T] be the interval considered.
Let n be the number of sampled values of the signal.
Then the distance between two consecutive sampled values is dt=T/n, and the sampling frequency is f_{sampl} = 1/dt.
Let x_{k} = x(t_{k}) = x(k dt) be the sampled values of the signal.
Since x(t) is realvalued, and since we are analysing the amplitude without being interested in knowing the phase, the discrete Fourier transform can be simplified by using Euler's formula:
<math>f_j\,\!<math>  <math>= \sum_{k=0}^{n1} x_k e^{2 \pi i j k/n} <math> 
<math>= \sum_{k=0}^{n1} x_k \left ( \cos \left (\frac{2 \pi}{n} j k \right )  i \sin \left (\frac{2 \pi}{n} j k \right ) \right )<math>  
<math>= \sum_{k=0}^{n1} x_k \cos \left (\frac{2 \pi}{n} j k \right )  i \sum_{k=0}^{n1} x_k \sin \left (\frac{2 \pi}{n} j k \right )<math> 
Hence:
 <math>\left  f_j \right  = \sqrt{\left ( \sum_{k=0}^{n1} x_k \cos \left (\frac{2 \pi}{n} j k \right ) \right )^2 + \left ( \sum_{k=0}^{n1} x_k \sin \left (\frac{2 \pi}{n} j k \right ) \right )^2}<math>
The value 2f_{j}/n represents the amplitude of that component whose frequency is j/T.
Then it may be useful to draw a graph showing 2f_{j}/n in function of j/T, so that it is possible to have an idea of the dominant frequency components.
Since the Nyquist frequency is half of the sampling frequency, there is no use in considering an interval larger than [0, f_{samp} / 2] on the frequency domain.
Example
If the equation of the signal is the following:
 <math>x(t) = 1.2 \cdot \sin(2 \pi \cdot 8 \cdot t) + 0.6 \cdot \sin(2 \pi \cdot 10 \cdot t) + 0.8 \cdot \sin(2 \pi \cdot 12 \cdot t)<math>
The graph on the time domain is:
Missing image
GraphSignal01.gif
Image:GraphSignal01.gif
The graph on the frequency domain gives an idea of the frequency spectrum:
Missing image
FrequencySpectrum01.gif
Image:FrequencySpectrum01.gif
The same result would be obtained if the three components of the example had another phase. Even if they had three different phases, the result of the Amplitude versus Frequency analysis would be the same.
Frequencyphase spectrum
The spectrum phase versus frequency is less important, but it is useful if one wants to know the phase displacement of each frequency component. It can be found again from the result of a Discrete Fourier transform.
Window functions
The Fourier transform assumes that the signal can be reproduced by looping the sample. If the interval considered is not a multiple of the period, the end of the sample is not continuous with the beginning, the transform will contain errors and the frequency spectrum will not be so clear.
Then, it may be useful to multiply the signal by a window function before attempting any frequency analysis.
Of light
The "spectrum" of a sample of electromagnetic radiation (light), intuitively considered to be its decomposition into colors, can be interpreted more rigorously as the frequency spectrum of the oscillation of the electromagnetic field. However, for frequencies above the microwave range, this oscillation cannot be measured directly.
However, light is composed of discrete photons, whose frequency is directly related to their energy. Thus, a frequency spectrum of a beam of light can also be interpreted as the energy spectrum of a beam of photons.