# Signals and Systems/Fourier Series Analysis
## Plotting Results

From the polar form of the Fourier series, we can see that essentially, there are 2 quantities that Fourier series provides: Magnitude, and Phase shift. If we simplify the entire series into the polar form, we can see that instead of being an infinite sum of different sinusoids, we get simply an infinite sum of cosine waves, with varying magnitude and phase parameters. This makes the entire series easier to work with, and also allows us to begin working with different graphical methods of analysis.

### Magnitude Plots

It is important to remember at this point that the Fourier series turns a continuous, periodic time signal into a discrete set of frequency components. In essence, any plot of Fourier components will be a stem plot, and will not be continuous. The user should never make the mistake of attempting to interpolate the components into a smooth graph.
The magnitude graphs of a Fourier series representation plots the magnitude of the coefficient (either $X_{n}$ in polar, or $C_{n}$ in exponential form) against the frequency, in radians per second. The X-axis will have the independent variable, in this case the frequency. The Y-axis will hold the magnitude of each component. The magnitude can be a measure of either current or voltage, depending on how the original signal was represented. Keep in mind, however, that most signals, and their resulting magnitude plots, are discussed in terms of voltage (not current).

### Phase Plots

Similar to the magnitude plots, the phase plots of the Fourier representation will graph the phase angle of each component against the frequency. Both the frequency (X-axis), and the phase angle (Y-axis) will be plotted in units of radians per seconds. Occasionally, Hertz may be used for one (or even both), but this is not the normal case. Like the magnitude plot, the phase plot of a Fourier series will be discrete, and should be drawn as individual points, not as smooth lines.

## Power

Frequently, it is important to talk about the power in a given periodic wave. It is also important to talk about how much power is being transmitted in each different harmonic. For instance, if a certain channel has a limited bandwidth, and is filtering out some of the harmonics of the signal, then it is important to know how much power is being removed from the signal by the channel.

### Normalization

Let us now take a look at our equation for power:
    $P=iv$
$v=ir$
If we use Ohm's Law to solve for v and i respectively, and then plug those values into our equation, we will get the following result:
    $P=i^{2}R={\frac {v^{2}}{R}}$
If we normalize the equation, and set R = 1, then both equations become much easier. In any case where the words "normalized power" are used, it denotes the fact that we are using a normalized resistance (R = 1).
To "de-normalize" the power, and find the power loss across a load with a non-normalized resistance, we can simply divide by the resistance (when in terms of voltage), and multiply by the resistance (when in terms of current).

### Power Plots

Because of the above result, we can assume that all loads are normalized, and we can find the power in a signal simply by squaring the signal itself. In terms of Fourier Series harmonics, we square the magnitude of each harmonic separately to produce the power spectrum. The power spectrum shows us how much power is in each harmonic.

## Parsevals Theorem

If the Fourier Representation and the Time-Domain Representation are simply two different ways to consider the same set of information, then it would make sense that the two are equal in many ways. The power and energy in a signal when expressed in the time domain should be equal to the power and energy of that same signal when expressed in the frequency domain. Parseval's Theorem relates the two.
Parsevals theorem states that the power calculated in the time domain is the same as the power calculated in the frequency domain. There are two ways to look at Parseval's Theorem, using the one-sided (polar) form of the Fourier Series, and using the two-sided (exponential) form:
    $P=\int _{0}^{T}f^{2}(t)dt=X_{0}^{2}+\sum _{n=1}^{\infty }{\frac {X_{n}^{2}}{2}}$
and
    $P=\sum _{-\infty }^{\infty }C_{n}C_{-n}=\sum _{-\infty }^{\infty }|C_{n}|^{2}$
By changing the upper-bound of the summation in the frequency domain, we can limit the power calculation to a limited number of harmonics. For instance, if the channel bandwidth limited a particular signal to only the first 5 harmonics, then the upper-bound could be set to 5, and the result could be calculated.

## Energy Spectrum

With Parseval's theorem, we can calculate the amount of energy being used by a signal in different parts of the spectrum. This is useful in many applications, such as filtering, that we will discuss later.
We know from Parseval's theorem that to obtain the energy of the harmonics of the signal that we need to square the frequency representation in order to view the energy. We can define the energy spectral density of the signal as the square of the Fourier transform of the signal:
    ${\mathcal {E}}_{F}(\theta )={\mathcal {F}}^{2}(\theta )$
The magnitude of the graph at different frequencies represents the amount energy located within those frequency components.

## Power Spectral Density

The energy in a signal is the amount of power in a signal. To find the power spectrum, or power spectral density (PSD) of a signal,
take the Fourier Transform of the Auto Correlation of the signal(which is in frequency domain).

## Signal to Noise Ratio

In the presence of noise, it is frequently important to know what is the ratio between the signal (which you want), and the noise (which you don't want). The ratio between the noise and the signal is called the Signal to Noise Ratio, and is abbreviated with the letters SNR.
There are actually 2 ways to represent SNR, one as a straight-ratio, and one in decibels. The two terms are functionally equivalent, although since they are different quantities, they cannot be used in the same equations. It is worth emphasizing that decibels cannot be used in calculations the same way that ratios are used.
    $SNR={\frac {Signal}{Noise}}$
Here, the SNR can be in terms of either power or voltage, so it must be specified which quantity is being compared. Now, when we convert SNR into decibels:
    $SNR_{db}=10log_{10}\left({\frac {Signal}{Noise}}\right)$
For instance, an SNR of 3db means that the signal is twice as powerful as the noise signal. A higher SNR (in either representation) is always preferable.