# Introduction
## What is this book for?

The purpose of this book is to begin down the long and winding road of Electrical Engineering. Previous books on electric circuits have laid a general groundwork, but again: that is not what electrical engineers usually do with their time. Very complicated integrated circuits exist for most applications that can be picked up at a local circuit shop or hobby shop for pennies, and there is no sense creating new ones. As such, this book will most likely spend little or no time discussing actual circuit implementations of any of the structures discussed. Also, this book will not stumble through much of the complicated mathematics, instead opting to simply point out and tabulate the relevant results. What this book will do, however, is attempt to provide some insight into a field of study that is considered very foreign and arcane to most outside observers. This book will be a theoretical foundation that future books will build upon. This book will likely not discuss any specific implementations (no circuits, transceivers, filters, etc...), as these materials will be better handled in later books.

## Who is this book for?

This book is designed to accompany a second year of study in electrical engineering at the college level. However, students who are not currently enrolled in an electrical engineering curriculum may also find some valuable and interesting information here. This book requires the reader to have a previous knowledge of differential calculus, and assumes familiarity with integral calculus as well. Barring previous knowledge, a concurrent course of study in integral calculus could accompany reading this book, with mixed results. Using Laplace Transforms, this book will avoid differential equations completely, and therefore no prior knowledge of that subject is needed.
Having a prior knowledge of other subjects such as physics (wave dynamics, energy, forces, fields) will provide a deeper insight into this subject, although it is not required. Also, having a mathematical background in probability, statistics, or random variables will provide a deeper insight into the mechanics of noise signals, but that also is not required.

## What will this book cover?

This book is going to cover the theory of LTI systems and signals. This subject will form the fundamental basis for several other fields of study, including signal processing, Digital Signal Processing, Communication Systems, and Control Systems.
This book will provide the basic theory of LTI systems and mathematical modeling of signals. We will also introduce the notion of a stochastic, or random, process. Random processes, such as noise or interference, are so common in the studies of these systems that it's impossible to discuss the practical use of filter systems without first discussing noise processes.
Later sections will introduce some more advanced topics, such as digital signals and systems, and filters. This book will not discuss these topics at length, however, preferring to direct the reader to more comprehensive books on these subjects.
This book will attempt, so far as is possible, to provide not only the materials but also discussions about the importance and relevance of those materials. Because the information in this book plays a fundamental role in preparing the reader for advanced discussions in other books.

## Where to go from here

Once a basic knowledge of signals and systems has been learned, the reader can then take one of several paths of study.
* Readers interested in the use of electric signals for long-distance communications can read Communication Systems and Communication Networks. This path will culminate in a study of Data Coding Theory.
* Readers more interested in the analysis and processing of signals would likely be more interested in reading about Signal Processing and Digital Signal Processing. These books will focus primarily on the "signals".
* Readers who are more interested in the use of LTI systems to exercise control over systems will be more interested in Control Systems. This book will focus primarily on the "systems".
All three branches of study are going to share certain techniques and foundations, so many readers may find benefit in trying to follow the different paths simultaneously.

# MATLAB
## What is MATLAB?

MATLAB - MATrix LABoratory is an industry standard tool in engineering applications. Electrical Engineers, working on topics related to this book will often use MATLAB to help with modeling. For more information on programming MATLAB, see MATLAB Programming.

## Obtaining MATLAB

MATLAB itself is a relatively expensive piece of software. It is available for a fee from the Mathworks website.

## MATLAB Clones

There are, however, free alternatives to MATLAB. These alternatives are frequently called "MATLAB Clones", although some of them do not mirror the syntax of MATLAB. The most famous example is Octave. Here are some resources if you are interested in obtaining Octave:
* SPM/MATLAB
* Octave Programming Tutorial
* MATLAB Programming/Differences between Octave and MATLAB
* "Scilab / Scicoslab"

## MATLAB Template

This book will make use of the {{MATLAB CMD}} template, that will create a note to the reader that MATLAB has a command to handle a particular task. In the individual chapters, this book will not discuss MATLAB outright, nor will it explain those commands. However, there will be some chapters at the end of the book that will demonstrate how to perform some of these calculations, and how to use some of these analysis tools in MATLAB.

# Signal and System Basics

| The Wikibook of: Control Systems and Control Engineering | Table of Contents | All Versions | PDF Version |
| The Wikibook of: Control Systems and Control Engineering | ← Engineering Function | | Glossary |

## Signals

What is a signal? Of course, we know that a signal can be a rather abstract notion, such as a flashing light on our car's front bumper (turn signal), or an umpire's gesture indicating that a pitch went over the plate during a baseball game (a strike signal). One of the definitions of signal in the Merriam-Webster dictionary is:
"A detectable physical quantity or impulse (as a voltage, current, or magnetic field strength) by which messages or information can be transmitted." or
"A signal is a function of independent variables that carry some information." or
"A signal is a source of information, generally a physical quantity, which varies with respect to time, space, temperature like any independent variable" or
"A signal is a physical quantity that varies with time, space, or any other independent variable by which information can be conveyed"
As per a new definition of signal proposed in- Pragnan Chakravorty, "What Is a Signal? [Lecture Notes]," IEEE Signal Processing Magazine, vol. 35, no. 5, pp. 175-177, Sept. 2018. doi: 10.1109/MSP.2018.2832195:
"A signal, as a function of one or more variables, may be defined as an observable change in a quantifiable entity"
These are the types of signals which will be of interest in this book. We will focus on two broad classes of signals, discrete-time and continuous-time. We will consider discrete-time signals later. For now, we will focus our attention on continuous-time signals. Fortunately, continuous-time signals have a very convenient mathematical representation. We represent a continuous-time signal as a function x(t) of the real variable t. Here, t represents continuous time and we can assign to t any unit of time we deem appropriate (seconds, hours, years, etc.). We do not have to make any particular assumptions about x(t) such as "boundedness" (a signal is bounded if it has a finite value). Some of the signals we will work with are in fact, not bounded (i.e. they take on an infinite value). However most of the continuous-time signals we will deal with in the real world are bounded.
Signal: a function representing some variable that contains some information about the behavior of a natural or artificial system. Signals are one part of the whole. Signals are meaningless without systems to interpret them, and systems are useless without signals to process.
Signal: the energy (a traveling wave) that carries some information.
Signal example: an electrical circuit signal may represent a time-varying voltage measured across a resistor.
A signal can be represented as a function x(t) of an independent variable t which usually represents time. If t is a continuous variable, x(t) is a continuous-time signal, and if t is a discrete variable, defined only at discrete values of t, then x(t) is a discrete-time signal. A discrete-time signal is often identified as a sequence of numbers, denoted by x[n], where n is an integer.
Signal: the representation of information. Signal; A signal is a physical quantity that contain information.

## Systems

A System is any physical set of components that takes a signal, and produces a signal. In terms of engineering, the input is generally some electrical signal X, and the output is another electrical signal(response) Y. However, this may not always be the case. Consider a household thermostat, which takes input in the form of a knob or a switch, and in turn outputs electrical control signals for the furnace.
A main purpose of this book is to try and lay some of the theoretical foundation for future dealings with electrical signals. Systems will be discussed in a theoretical sense only.

## Basic Functions

Oftentimes, complex signals can be simplified as linear combinations of certain basic functions (a key concept in Fourier analysis), which are useful to the field of engineering. These functions will be described here, and studied more in the following chapters.

## Unit Step Function

The unit step function and the impulse function are considered to be fundamental functions in engineering, and it is strongly recommended that the reader becomes very familiar with both of these functions.
The unit step function, also known as the Heaviside function, is defined as such:
    $u(t)=\left\{{\begin{matrix}0,&{\mbox{if }}t<0\\1,&{\mbox{if }}t\geq 0\end{matrix}}\right.$
Sometimes, u(0) is given other values, usually either 0 or 1. For many applications, it is irrelevant what the value at zero is. u(0) is generally written as undefined.

### Derivative

The unit step function is level in all places except for a discontinuity at t = 0. For this reason, the derivative of the unit step function is 0 at all points t, except where t = 0. Where t = 0, the derivative of the unit step function is infinite.
The derivative of a unit step function is called an impulse function. The impulse function will be described in more detail next.

### Integral

The integral of a unit step function is computed as such:
    $\int _{-\infty }^{t}u(s)ds=\left\{{\begin{matrix}0,&{\mbox{if }}t<0\\\int _{0}^{t}ds=t,&{\mbox{if }}t\geq 0\end{matrix}}\right\}=tu(t)$
In other words, the integral of a unit step is a "ramp" function. This function is 0 for all values that are less than zero, and becomes a straight line at zero with a slope of +1.

### Time Inversion

if we want to reverse the unit step function, we can flip it around the y axis as such: u(-t). With a little bit of manipulation, we can come to an important result:
    $u(-t)=1-u(t)$, while $t\neq 0$

### Other Properties

Here we will list some other properties of the unit step function:
* $u(\infty )=1$
* $u(-\infty )=0$
* $u(t)+u(-t)=1$, while $t\neq 0$
These are all important results, and the reader should be familiar with them.

## Impulse Function

An impulse function is a special function that is often used by engineers to model certain events. An impulse function is not realizable, in that by definition the output of an impulse function is infinity at certain values. An impulse function is also known as a "delta function", although there are different types of delta functions that each have slightly different properties. Specifically, this unit-impulse function is known as the Dirac delta function. The term "Impulse Function" is unambiguous, because there is only one definition of the term "Impulse".
Let's start by drawing out a rectangle function, D(t), as such:
We can define this rectangle in terms of the unit step function:
    $D(t)={\frac {1}{A}}[u(t+A/2)-u(t-A/2)]$
Now, we want to analyze this rectangle, as A becomes infinitesimally small. We can define this new function, the delta function, in terms of this rectangle:
    $\delta (t)=\lim _{A\to 0}{\frac {1}{A}}[u(t+A/2)-u(t-A/2)]$
We can similarly define the delta function piecewise, as such:
* $\delta (t)=0{\mbox{ for }}t\neq 0$.
* $\delta (t)=+\infty {\mbox{ for }}t=0$.
* $\int _{-\infty }^{\infty }\delta (t)dt=1$.
Although, this definition is less rigorous than the previous definition.

### Integration

From its definition it follows that the integral of the impulse function is just the step function:
    $\int \delta (t)dt=u(t)$
Thus, defining the derivative of the unit step function as the impulse function is justified.

### Shifting Property

Furthermore, for an integrable function f:
    $\int _{-\infty }^{\infty }\delta (t-A)f(t)dt=f(A)$
This is known as the shifting property (also known as the sifting property or the sampling property) of the delta function; it effectively samples the value of the function f, at location A.
The delta function has many uses in engineering, and one of the most important uses is to sample a continuous function into discrete values.
Using this property, we can extract a single value from a continuous function by multiplying with an impulse, and then integrating.

### Types of Delta

There are a number of different functions that are all called "delta functions". These functions generally all look like an impulse, but there are some differences. Generally, this book uses the term "delta function" to refer to the Dirac Delta Function.
* w:Dirac delta function
* w:Kronecker delta

## Sinc Function

There is a particular form that appears so frequently in communications engineering, that we give it its own name. This function is called the "Sinc function" and is discussed below:
The Sinc function is defined in the following manner:
    $\operatorname {sinc} (x)={\frac {\sin(\pi x)}{\pi x}}{\mbox{ if }}x\neq 0$
and
    $\operatorname {sinc} (0)=1$
The value of sinc(x) is defined as 1 at x = 0, since
    $\lim _{x\rightarrow 0}\operatorname {sinc} (x)=1$.
This fact can be proven by noting that for x near 0,
    $1>{\frac {\sin {(x)}}{x}}>\cos {(x)}$.
Then, since cos(0) = 1, we can apply the Squeeze Theorem to show that the sinc function approaches one as x goes to zero. Thus, defining sinc(0) to be 1 makes the sinc function continuous.
Also, the Sinc function approaches zero as x goes towards infinity, with the envelope of sinc(x) tapering off as 1/x.

## Rect Function

The Rect Function is a function which produces a rectangular-shaped pulse with a width of 1 centered at t = 0. The Rect function pulse also has a height of 1. The Sinc function and the rectangular function form a Fourier transform pair.
A Rect function can be written in the form:
    $\operatorname {rect} \left({\frac {t-X}{Y}}\right)$
where the pulse is centered at X and has width Y. We can define the impulse function above in terms of the rectangle function by centering the pulse at zero (X = 0), setting its height to 1/A and setting the pulse width to A, which approaches zero:
    $\delta (t)=\lim _{A\to 0}{\frac {1}{A}}\operatorname {rect} \left({\frac {t-0}{A}}\right)$
We can also construct a Rect function out of a pair of unit step functions:
    $\operatorname {rect} \left({\frac {t-X}{Y}}\right)=u(t-X+Y/2)-u(t-X-Y/2)$
Here, both unit step functions are set at distance of Y/2 away from the center point of (t - X).

## Square Wave

A square wave is a series of rectangular pulses. Here are some examples of square waves:
* These two square waves have the same amplitude, but the second has a lower frequency. We can see that the period of the second is approximately twice as large as the first, and therefore that the frequency of the second is about half the frequency of the first. |
* These two square waves have the same frequency and the same peak-to-peak amplitude, but the second wave has no DC offset. Notice how the second wave is centered on the x axis, while the first wave is completely above the x axis. |
There are many tools available to analyze a system in the time domain, although many of these tools are very complicated and involved. Nonetheless, these tools are invaluable for use in the study of linear signals and systems, so they will be covered here.

## Linear Time-Invariant (LTI) Systems

This page will contain the definition of a LTI system and this will be used to motivate the definition of convolution as the output of a LTI system in the next section. To begin with a system has to be defined and the LTI properties have to be listed. Then, for a given input it can be shown (in this section or the following) that the output of a LTI system is a convolution of the input and the system's impulse response, thus motivating the definition of convolution.
Consider a system for which an input of x$_i$(t) results in an output of y$_i$(t) respectively for i = 1, 2.

### Linearity

There are 2 requirements for linearity. A function must satisfy both to be called "linear".
* Additivity: An input of $x_{3}(t)=x_{1}(t)+x_{2}(t)$ results in an output of $y_{3}(t)=y_{1}(t)+y_{2}(t)$.
* Homogeneity: An input of $ax_{1}$ results in an output of $ay_{1}$
Being linear is also known in the literature as "satisfying the principle of superposition". Superposition is a fancy term for saying that the system is additive and homogeneous. The terms linearity and superposition can be used interchangeably, but in this book we will prefer to use the term linearity exclusively.
We can combine the two requirements into a single equation: In a linear system, an input of $a_{1}x_{1}(t)+a_{2}x_{2}(t)$ results in an output of $a_{1}y_{1}(t)+a_{2}y_{2}(t)$.

### Additivity

A system is said to be additive if a sum of inputs results in a sum of outputs. To test for additivity, we need to create two arbitrary inputs, x$_1$(t) and x$_2$(t). We then use these inputs to produce two respective outputs:
    $y_{1}(t)=f(x_{1}(t))$
    $y_{2}(t)=f(x_{2}(t))$
Now, we need to take a sum of inputs, and prove that the system output is a sum of the previous outputs:
    $y_{1}(t)+y_{2}(t)=f(x_{1}(t))+f(x_{2}(t))$
If this final relationship is not satisfied for all possible inputs, then the system is not additive.

### Homogeneity

Similar to additivity, a system is homogeneous if a scaled input (multiplied by a constant) results in a scaled output. If we have two inputs to a system:
    $y_{1}(t)=f(x_{1}(t))$
    $y_{2}(t)=f(x_{2}(t))$
Where
    $x_{1}(t)=cx_{2}(t)$
Where c is an arbitrary constant. If this is the case then the system is homogeneous if
    $y_{1}(t)=cy_{2}(t)$
for any arbitrary c.

### Time Invariance

If the input signal x(t) produces an output y(t) then any time shifted input, x(t + δ), results in a time-shifted output y(t + δ).
This property can be satisfied if the transfer function of the system is not a function of time except expressed by the input and output.

### Example: Simple Time Invariance

To demonstrate how to determine if a system is time-invariant, consider the two systems:
* System A: $y(t)=t\,x(t)$
* System B: $\,\!b(t)=10x(t)$
Since system A explicitly depends on t outside of x(t) and y(t), it is time-variant. System B, however, does not depend explicitly on t so it is time-invariant (given x(t) is time-invariant).

### Example: Formal Proof

A more formal proof of why systems A & B from above are respectively time varying and time-invariant is now presented. To perform this proof, the second definition of time invariance will be used.

#### System A

    Start with a time shift of the input $x_{d}(t)=\,\!x(t+\delta )$
       $y(t)=t\,x(t)$
       $y_{1}(t)=t\,x_{d}(t)=t\,x(t+\delta )$
    Now describe the time shifted output by δ
       $y(t)=t\,x(t)$
       $y_{2}(t)=\,\!y(t+\delta )=(t+\delta )x(t+\delta )$
    Clearly $y_{1}(t)\,\!\neq y_{2}(t)$, therefore the system is not time-invariant.

#### System B

    Start with a time shift of the input $x_{d}(t)=\,\!x(t+\delta )$
       $y(t)=10\,x(t)$
       $y_{1}(t)=10\,x_{d}(t)=10\,x(t+\delta )$
    Now time shift the output by δ
       $y(t)=10\,x(t)$
       $y_{2}(t)=y(t+\delta )=10\,x(t+\delta )$
    Clearly $y_{1}(t)=\,\!y_{2}(t)$, therefore the system is time-invariant.

## Linear Time Invariant (LTI) Systems

The system is linear time-invariant (LTI) if it satisfies both the property of linearity and time-invariance. This book will study LTI systems almost exclusively, because they are the easiest systems to work with, and they are ideal to analyze and design.

## Other Function Properties

Besides being linear, or time-invariant, there are a number of other properties that we can identify in a function:

### Memory

A system is said to have memory if the output from the system is dependent on past inputs (or future inputs) to the system. A system is called memoryless if the output is only dependent on the current input. Memoryless systems are easier to work with, but systems with memory are more common in digital signal processing applications.

### Causality

Causality is a property that is very similar to memory. A system is called causal if it is only dependent on past or current inputs. A system is called non-causal if the output of the system is dependent on future inputs. Most of the practical systems are causal.

### Stability

Stability is a very important concept in systems, but it is also one of the hardest function properties to prove. There are several different criteria for system stability, but the most common requirement is that the system must produce a finite output when subjected to a finite input. For instance, if we apply 5 volts to the input terminals of a given circuit, we would like it if the circuit output didn't approach infinity, and the circuit itself didn't melt or explode. This type of stability is often known as "Bounded Input, Bounded Output" stability, or BIBO.
Studying BIBO stability is a relatively complicated course of study, and later books on the Electrical Engineering bookshelf will attempt to cover the topic.

## Linear Operators

Mathematical operators that satisfy the property of linearity are known as linear operators. Here are some common linear operators:
* Derivative
* Integral
* Fourier Transform

### Example: Linear Functions

Determine if the following two functions are linear or not:
* $y(t)=\int _{-\infty }^{\infty }x(t)dt$
* $y(t)={\frac {d}{dt}}x(t)$

## Impulse Response

Impulse response tells us how a system reacts when we hit it with an impulse signal (also called as dirac delta function). This impulse response is very important term in analyzing the behaviour of systems.

### Zero-Input Response

    $x(t)=u(t)$
    $h(t)=e^{-x}u(t)$

### Zero-State Response

zero state response means steady state or forced response. This is the system response y(t) to an input f(t) when the system is in zero state; that is, when all initial conditions are zero.

### Second-Order Solution

* Example. Finding the total response of a driven RLC circuit.

## Convolution

Convolution (folding together) is a complicated operation involving integrating, multiplying, adding, and time-shifting two signals together.
The convolution a * b of two functions a and b is defined as the function:
    $(a*b)(t)=\int _{-\infty }^{\infty }a(\tau )b(t-\tau )d\tau$
The Greek letter τ (tau) is used as the integration variable, because the letter t is already in use. τ is used as a "dummy variable" because we use it merely to calculate the integral.
In the convolution integral, all references to t are replaced with τ, except for the -t in the argument to the function b. Function b is time inverted by changing τ to -τ. Graphically, this process moves everything from the right-side of the y axis to the left side and vice-versa. Time inversion turns the function into a mirror image of itself.
Next, function b is time-shifted by the variable t. Remember, once we replace everything with τ, we are now computing in the tau domain, and not in the time domain like we were previously. Because of this, t can be used as a shift parameter.
We multiply the two functions together, time shifting along the way, and we take the area under the resulting curve at each point. Two functions overlap in increasing amounts until some "watershed" after which the two functions overlap less and less. Where the two functions overlap in the t domain, there is a value for the convolution. If one (or both) of the functions do not exist over any given range, the value of the convolution operation at that range will be zero.
After the integration, the definite integral plugs the variable t back in for remaining references of the variable τ, and we have a function of t again. It is important to remember that the resulting function will be a combination of the two input functions, and will share some properties of both.

### Properties of Convolution

The convolution function satisfies certain conditions:

#### Commutativity

    $f*g=g*f\,$

#### Associativity

    $f*(g*h)=(f*g)*h\,$

#### Distributivity

    $f*(g+h)=(f*g)+(f*h)\,$

#### Associativity With Scalar Multiplication

    $a(f*g)=(af)*g=f*(ag)\,$
for any real (or complex) number a.

#### Differentiation Rule

    $(f*g)'=f'*g=f*g'\,$

### Example 1

Find the convolution, z(t), of the following two signals, x(t) and y(t), by using (a) the integral representation of the convolution equation and (b) muliplication in the Laplace domain.
The signal y(t) is simply the Heaviside step, u(t).
The signal x(t) is given by the following infinite sinusoid, x$_0$(t), and windowing function, x$_w$(t):
       $x_{0}(t)=\sin(t)\,$
       $x_{w}(t)=u(t)-u(t-2\pi )\,$
Thus, the convolution we wish to perform is therefore:
       $z(t)=x(t)*y(t)\,$
       $z(t)=\sin(t)\left[u(t)-u(t-2\pi )\right]*u(t)\,$
       $z(t)=\left[\sin(t)u(t)-\sin(t)u(t-2\pi )\right]*u(t)\,$
From the distributive law:
       $z(t)=\sin(t)u(t)*u(t)-\sin(t)u(t-2\pi )*u(t)\,$

## Correlation

Akin to Convolution is a technique called "Correlation" that combines two functions in the time domain into a single resultant function in the time domain. Correlation is not as important to our study as convolution is, but it has a number of properties that will be useful nonetheless.
The correlation of two functions, g(t) and h(t) is defined as such:
    $R_{gh}(t)=\int _{-\infty }^{\infty }g(\tau )h(t+\tau )d\tau$
Where the capital R is the Correlation Operator, and the subscripts to R are the arguments to the correlation operation.
We notice immediately that correlation is similar to convolution, except that we don't time-invert the second argument before we shift and integrate. Because of this, we can define correlation in terms of convolution, as such:
    $R_{gh}(t)=g(t)*h(-t)$

### Uses of Correlation

Correlation is used in many places because it demonstrates one important fact: Correlation determines how much similarity there is between the two argument functions. The more the area under the correlation curve, the more is the similarity between the two signals.

### Autocorrelation

The term "autocorrelation" is the name of the operation when a function is correlated with itself. The autocorrelation is denoted when both of the subscripts to the Correlation operator are the same:
    $R_{xx}(t)=x(t)*x(-t)$
While it might seem ridiculous to correlate a function with itself, there are a number of uses for autocorrelation that will be discussed later. Autocorrelation satisfies several important properties:
* The maximum value of the autocorrelation always occurs at t = 0. The function always decreases, stays constant, or fluctuates (if the signal is periodic) as t approaches infinity.
* Autocorrelation is symmetric about the x axis.

### Crosscorrelation

Cross correlation is every instance of correlation that is not considered "autocorrelation". In general, crosscorrelation occurs when the function arguments to the correlation are not equal. Crosscorrelation is used to find the similarity between two signals.
    $R_{gh}(t)=\int _{-\infty }^{\infty }g(\tau )h(t+\tau )d\tau$

### Example: RADAR

RADAR (RAdio Detection And Ranging) is a system that uses pulses of electromagnetic waves to determine the position of a distant object. RADAR operates by sending out a signal, and then listening for echos. If there is an object in range, the signal will bounce off that object and return to the RADAR station. The RADAR will then take the cross correlation of two signals, the sent signal and the received signal. A spike in the cross correlation signal indicates that an object is present, and the location of the spike indicates how much time has passed (and therefore how far away the object is).
Noise is an unfortunate phenomenon that is the greatest single enemy of an electrical engineer. Without noise, digital communication rates would increase almost to the infinity

## White Noise (Gaussian Noise)

White Noise, or Gaussian Noise is called white because it affects all the frequency components of a signal equally. This noise can be modeled as a Gaussian noise process. Gaussian processes are stochastic processes for which the random variables are jointly Gaussian. We don't talk about Frequency Domain analysis till a later chapter, but it is important to know this terminology now.

## Colored Noise

Colored noise is different from white noise in that it affects different frequency components differently. For example, Pink Noise is random noise with an equal amount of power in each frequency octave band.

## White Noise and Autocorrelation

White Noise is completely random, so it would make intuitive sense to think that White Noise has zero autocorrelation. As the noise signal is time shifted, there is no correlation between the values. In fact, there is no correlation at all until the point where t = 0, and the noise signal perfectly overlaps itself. At this point, the correlation spikes upward. In other words, the autocorrelation of noise is an Impulse Function centered at the point t = 0.
    ${\mathcal {C}}[n(t),n(t)]=\delta (t)$
Where n(t) is the noise signal.

## Noise Power

Noise signals have a certain amount of energy associated with them. The more energy and transmitted power that a noise signal has, the more interference the noise can cause in a transmitted data signal. We will talk more about the power associated with noise in later chapters.

## Thermal Noise

Thermal noise is a fact of life in electronic components. As components heat up, the resistance of resistors change, and even the capacitance and inductance of energy storage elements can be affected. This change amounts to noise in the circuit output. In this chapter, we will study the effects of thermal noise.
The thermal noise which is an example of white noise is the random noise which is generated in a resistor or the resistive component of a complex impedance due to rapid and random motion of the molecules, atoms and electrons. According to the kinetic theory of thermodynamics, the temperature of a particle denotes its internal kinetic energy. This means that the temperature of a body expresses the rms value of the velocity of motion of the particles in a body. As per this kinetic theory, the kinetic energy of these particles becomes approximately zero (i.e. zero velocity) at absolute zero. Therefore, the noise power produced in a resistor is proportional to its absolute temperature. Also the noise power is proportional to the bandwidth over which the noise is measured. Therefore the expression for maximum noise power output of a resistor may be given as:
    $Vn^{2}=k\cdot T\cdot R\cdot B$
where
    k is Boltzmann's constant
    T is the absolute temperature, in Kelvin degrees
    B is the bandwidth of interest, in Hertz.
    R is the thermal resistance
Disclaimer: The above section contains significant errors. The noise power equation is wrong. The physical reasons given for Johnson noise are wrong. Do not use this source of information.

## Periodic Signals

A signal is a periodic signal if it completes a pattern within a measurable time frame, called a period and repeats that pattern over identical subsequent periods. The completion of a full pattern is called a cycle. A period is defined as the amount of time (expressed in seconds) required to complete one full cycle. The duration of a period represented by T, may be different for each signal but it is constant for any given periodic signal.

## Terminology

We will discuss here some of the common terminology that pertains to a periodic function. Let g(t) be a periodic function satisfying g(t + T) = g(t) for all t.

### Period

The period is the smallest value of T satisfying g(t + T) = g(t) for all t. The period is defined so because if g(t + T) = g(t) for all t, it can be verified that g(t + T') = g(t) for all t where T' = 2T, 3T, 4T, ... In essence, it's the smallest amount of time it takes for the function to repeat itself. If the period of a function is finite, the function is called "periodic". Functions that never repeat themselves have an infinite period, and are known as "aperiodic functions".
The period of a periodic waveform will be denoted with a capital T. The period is measured in seconds.

### Frequency

The frequency of a periodic function is the number of complete cycles that can occur per second. Frequency is denoted with a lower-case f. It is defined in terms of the period, as follows:
    $f={\frac {1}{T}}$
Frequency has units of hertz or cycle per second.

### Radial Frequency

The radial frequency is the frequency in terms of radians. It is defined as follows:
    $\omega =2\pi f$

### Amplitude

The amplitude of a given wave is the value of the wave at that point. Amplitude is also known as the "Magnitude" of the wave at that particular point. There is no particular variable that is used with amplitude, although capital A, capital M and capital R are common.
The amplitude can be measured in different units, depending on the signal we are studying. In an electric signal the amplitude will typically be measured in volts. In a building or other such structure, the amplitude of a vibration could be measured in meters.

### Continuous Signal

A continuous signal is a "smooth" signal, where the signal is defined over a certain range. For example, a sine function is a continuous signal, as is an exponential function or a constant function. A portion of a sine signal over a range of time 0 to 6 seconds is also continuous. Examples of functions that are not continuous would be any discrete signal, where the value of the signal is only defined at certain intervals.

### DC Offset

A DC Offset is an amount by which the average value of the periodic function is not centered around the x-axis.
A periodic signal has a DC offset component if it is not centered about the x-axis. In general, the DC value is the amount that must be subtracted from the signal to center it on the x-axis. by definition:
    $A_{0}=(1/T)*\int _{-T/2}^{T/2}f(x)dx$
With A$_0$ being the DC offset. If A$_0$ = 0, the function is centered and has no offset.

### Half-wave Symmetry

To determine if a signal with period 2L has half-wave symmetry, we need to examine a single period of the signal. If, when shifted by half the period, the signal is found to be the negative of the original signal, then the signal has half-wave symmetry. That is, the following property is satisfied:
       $f(t-L)=-f(t)\,$
Half-wave symmetry implies that the second half of the wave is exactly opposite to the first half. A function with half-wave symmetry does not have to be even or odd, as this property requires only that the shifted signal is opposite, and this can occur for any temporal offset. However, it does require that the DC offset is zero, as one half must exactly cancel out the other. If the whole signal has a DC offset, this cannot occur, as when one half is added to the other, the offsets will add, not cancel.
Note that if a signal is symmetric about the half-period point, it is not necessarily half-wave symmetric. An example of this is the function t$^3$, periodic on [-1,1), which has no DC offset and odd symmetry about t=0. However, when shifted by 1, the signal is not opposite to the original signal.
Half Wave Symmetric signals don't have even "sine and cosine" harmonics.

### Quarter-Wave Symmetry

If a signal has the following properties, it is said to quarter-wave symmetric:
* It is half-wave symmetric.
* It has symmetry (odd or even) about the quarter-period point (i.e. at a distance of L/2 from an end or the centre).
| Even Signal with Quarter-Wave Symmetry | Odd Signal with Quarter-Wave Symmetry |
Any quarter-wave symmetric signal can be made even or odd by shifting it up or down the time axis. A signal does not have to be odd or even to be quarter-wave symmetric, but in order to find the quarter-period point, the signal will need to be shifted up or down to make it so. Below is an example of a quarter-wave symmetric signal (red) that does not show this property without first being shifted along the time axis (green, dashed):
* Asymmetric Signal with Quarter-Wave Symmetry
An equivalent operation is shifting the interval the function is defined in. This may be easier to reconcile with the formulae for Fourier series. In this case, the function would be redefined to be periodic on (-L+Δ,L+Δ), where Δ is the shift distance.

### Discontinuities

Discontinuities are an artifact of some signals that make them difficult to manipulate for a variety of reasons.
In a graphical sense, a periodic signal has discontinuities whenever there is a vertical line connecting two adjacent values of the signal. In a more mathematical sense, a periodic signal has discontinuities anywhere that the function has an undefined (or an infinite) derivative. These are also places where the function does not have a limit, because the values of the limit from both directions are not equal.

## Common Periodic Signals

There are some common periodic signals that are given names of their own. We will list those signals here, and discuss them.

### Sinusoidal wave

The quintessential periodic waveform. These can be either Sine functions, or Cosine Function.
$V_{p}\,\sin(2\pi f\,t)$

### Square Wave

The square wave is exactly what it sounds like: a series of rectangular pulses spaced equidistant from each other, each with the same amplitude.

### Triangle Wave

The triangle wave is also exactly what it sounds like: a series of triangles. These triangles may touch each other, or there may be some space in between each wavelength.

### Example: Sinusoid, Square, Sawtooth and Triangle Waves

Here is an image that shows some of the common periodic waveforms, a sinusoid, a square wave, a triangle wave, and a sawtooth wave.

## Classifications

Periodic functions can be classified in a number of ways. one of the ways that they can be classified is according to their symmetry. A function may be Odd, Even, or Neither Even nor Odd. All periodic functions can be classified in this way.

### Even

Functions are even if they are symmetrical about the y-axis.
    $f(-x)=f(x)$
For instance, a cosine function is an even function.

### Odd

A function is odd if it is inversely symmetrical about the y-axis.
    $f(-x)=-f(x)$
The Sine function is an odd function.

### Neither Even nor Odd

Some functions are neither even nor odd. However, such functions can be written as a sum of even and odd functions. Any function f(x) can be expressed as a sum of an odd function and an even function: f(x)=f$_{even}$(x)+f$_{odd}$(x){\textstyle f(x)=f_{even}(x)+f_{odd}(x)} (Note that the first term is zero for odd functions and that the second term is zero for even functions.)
Using the above mentioned equations for even and odd signals in $f(-x)$ we get: $f(-x)=f_{even}(-x)+f_{odd}(-x)=f_{even}(x)-f_{odd}(x)$
    Hence, $f_{even}(x)={\frac {f(x)+f(-x)}{2}}$ and $f_{odd}(x)={\frac {f(x)-f(-x)}{2}}$

# Frequency Representation
## The Fourier Series

The Fourier Series is a specialized tool that allows for any periodic signal (subject to certain conditions) to be decomposed into an infinite sum of everlasting sinusoids. This may not be obvious to many people, but it is demonstrable both mathematically and graphically. Practically, this allows the user of the Fourier Series to understand a periodic signal as the sum of various frequency components. (Or) The representation of a signal over a certain interval of time in terms of linear combination of orthogonal function is called Fourier series.

## Rectangular Series

The rectangular series represents a signal as a sum of sine and cosine terms. The type of sinusoids that a periodic signal can be decomposed into depends solely on the qualities of the periodic signal.

### Calculations

If we have a function f(x), that is periodic with a period of 2L, we can decompose it into a sum of sine and cosine functions as such:
    $f(x)={\frac {1}{2}}a_{0}+\sum _{n=1}^{\infty }\left[a_{n}\cos \left({\frac {n\pi x}{L}}\right)+b_{n}\sin \left({\frac {n\pi x}{L}}\right)\right]$
The coefficients, a and b can be found using the following integrals:
    $a_{n}={\frac {1}{L}}\int _{-L}^{L}f(x)\cos \left({\frac {n\pi x}{L}}\right)\,dx$
    $b_{n}={\frac {1}{L}}\int _{-L}^{L}f(x)\sin \left({\frac {n\pi x}{L}}\right)\,dx$
"n" is an integer variable. It can assume positive integer numbers (1, 2, 3, etc...). Each value of n corresponds to values for A and B. The sinusoids with magnitudes A and B are called harmonics. Using Fourier representation, a harmonic is an atomic (indivisible) component of the signal, and is said to be orthogonal.
When we set n = 1, the resulting sinusoidal frequency value from the above equations is known as the fundamental frequency. The fundamental frequency of a given signal is the most powerful sinusoidal component of a signal, and is the most important to transmit faithfully. Since n takes on integer values, all other frequency components of the signal are integer multiples of the fundamental frequency.
If we consider a signal in time, the period, T$_0$ is analogous to 2L in the above definition. The fundamental frequency is then given by:
       $f_{0}={\frac {1}{T_{0}}}$
And the fundamental angular frequency is then:
       $\omega _{0}={\frac {2\pi }{T_{0}}}$
Thus we can replace every $\left({\frac {n\pi x}{L}}\right)$ term with a more concise $(n\omega _{0}x)$.

### Signal Properties

Various signal properties translate into specific properties of the Fourier series. If we can identify these properties before hand, we can save ourselves from doing unnecessary calculations.

#### DC Offset

If the periodic signal has a DC offset, then the Fourier Series of the signal will include a zero frequency component, known as the DC component. If the signal does not have a DC offset, the DC component has a magnitude of 0. Due to the linearity of the Fourier series process, if the DC offset is removed, we can analyse the signal further (e.g. for symmetry) and add the DC offset back at the end.

#### Odd and Even Signals

If the signal is even (symmetric over the reference vertical axis), it is composed of cosine waves. If the signal is odd (anti-symmetric over the reference vertical axis), it is composed out of sine waves. If the signal is neither even nor odd, it is composed out of both sine and cosine waves.

#### Discontinuous Signal

If the signal is discontinuous (i.e. it has "jumps"), the magnitudes of each harmonic n will fall off proportionally to 1/n.

#### Discontinuous Derivative

If the signal is continuous but the derivative of the signal is discontinuous, the magnitudes of each harmonic n will fall off proportionally to 1/n$^2$.

#### Half-Wave Symmetry

If a signal has half-wave symmetry, there is no DC offset, and the signal is composed of sinusoids lying on only the odd harmonics (1, 3, 5, etc...). This is important because a signal with half-wave symmetry will require twice as much bandwidth to transmit the same number of harmonics as a signal without:
$a_{0}=0\,$ $a_{n}={\begin{cases}0,&{\mbox{if }}n{\mbox{ is even}}\\{\frac {2}{L}}\int _{0}^{L}f(x)\cos(n\omega _{0}x)dx,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}$
$b_{n}={\begin{cases}0,&{\mbox{if }}n{\mbox{ is even}}\\{\frac {2}{L}}\int _{0}^{L}f(x)\sin(n\omega _{0}x)dx,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}$

#### Quarter-Wave Symmetry of an Even Signal

If a 2L-periodic signal has quarter-wave symmetry, then it must also be half-wave symmetric, so there are no even harmonics. If the signal is even and has quarter-wave symmetry, we only need to integrate the first quarter-period:
       $a_{n}={\begin{cases}0,&{\mbox{if }}n{\mbox{ is even}}\\{\frac {4}{L}}\int _{0}^{L/2}f(x)\cos(n\omega _{0}x)dx,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}$
We also know that because the signal is half-wave symmetric, there is no DC offset:
       $a_{0}=0\,$
Because the signal is even, there are are no sine terms:
       $b_{n}=0\,$

#### Quarter-Wave Symmetry of an Odd Signal

If the signal is odd, and has quarter wave symmetry, then we can say:
Because the signal is odd, there are no cosine terms:
       $a_{0}=0\,$
       $a_{n}=0\,$
There are no even sine terms due to half-wave symmetry, and we only need to integrate the first quarter-period due to quarter-wave symmetry.
       $b_{n}={\begin{cases}0,&{\mbox{if }}n{\mbox{ is even}}\\{\frac {4}{L}}\int _{0}^{L/2}f(x)\sin(n\omega _{0}x)dx,&{\mbox{if }}n{\mbox{ is odd}}\end{cases}}$

### Summary

By convention, the coefficients of the cosine components are labeled "a", and the coefficients of the sine components are labeled with a "b". A few important facts can then be mentioned:
* If the function has a DC offset, a$_0$ will be non-zero. There is no B$_0$ term.
* If the signal is even, all the b terms are 0 (no sine components).
* If the signal is odd, all the a terms are 0 (no cosine components).
* If the function has half-wave symmetry, then all the even coefficients (of sine and cosine terms) are zero, and we only have to integrate half the signal.
* If the function has quarter-wave symmetry, we only need to integrate a quarter of the signal.
* The Fourier series of a sine or cosine wave contains a single harmonic because a sine or cosine wave cannot be decomposed into other sine or cosine waves.
* We can check a series by looking for discontinuities in the signal or derivative of the signal. If there are discontinuities, the harmonics drop off as 1/n, if the derivative is discontinuous, the harmonics drop off as 1/n$^2$.

## Polar Series

The Fourier Series can also be represented in a polar form which is more compact and easier to manipulate.
If we have the coefficients of the rectangular Fourier Series, a and b we can define a coefficient x, and a phase angle φ that can be calculated in the following manner:
    $x_{0}=a_{0}\,$
    $x_{n}={\sqrt {a_{n}^{2}+b_{n}^{2}}}$
    $\phi _{n}=\tan ^{-1}\left({\frac {b_{n}}{a_{n}}}\right)$
We can then define f(x) in terms of our new Fourier representation, by using a cosine basis function:
    $f(x)=x_{0}+\sum _{n=1}^{\infty }x_{n}\cos(n\omega x-\phi _{n})$
The use of a cosine basis instead of a sine basis is an arbitrary distinction, but is important nonetheless. If we wanted to use a sine basis instead of a cosine basis, we would have to modify our equation for φ, above.

### Proof of Equivalence

We can show explicitly that the polar cosine basis function is equivalent to the "Cartesian" form with a sine and cosine term.
    $f(x)=x_{0}+\sum _{n=1}^{\infty }x_{n}\cos(n\omega x-\phi _{n})$
By the double-angle formula for cosines:
    $f(x)=x_{0}+\sum _{n=1}^{\infty }x_{n}\left[\cos(n\omega x)\cos(-\phi _{n})-\sin(n\omega x)\sin(-\phi _{n})\right]$
By the odd-even properties of cosines and sines:
    $f(x)=x_{0}+\sum _{n=1}^{\infty }x_{n}\left[\cos(n\omega x)\cos(\phi _{n})+\sin(n\omega x)\sin(\phi _{n})\right]$
Grouping the coefficents:
    $f(x)=x_{0}+\sum _{n=1}^{\infty }[x_{n}\cos(\phi _{n})\cos(n\omega x)+x_{n}\sin(\phi _{n})\sin(n\omega x)]$
This is equivalent to the rectangular series given that:
    $a_{n}=x_{n}\cos(\phi _{n})\,$
    $b_{n}=x_{n}\sin(\phi _{n})\,$
Dividing, we get:
    ${\frac {b_{n}}{a_{n}}}={\frac {x_{n}\sin(\phi _{n})}{x_{n}\cos(\phi _{n})}}=\tan(\phi _{n})$
    $\phi _{n}=\tan ^{-1}\left({\frac {b_{n}}{a_{n}}}\right)$
Squaring and adding, we get:
    $a_{n}^{2}+b_{n}^{2}=x_{n}^{2}\left[\cos ^{2}(\phi _{n})+sin^{2}(\phi _{n})\right]$
    $a_{n}^{2}+b_{n}^{2}=x_{n}^{2}\,$
    $x_{n}={\sqrt {a_{n}^{2}+b_{n}^{2}}}$
Hence, given the above definitions of x$_n$ and φ$_n$, the two are equivalent. For a sine basis function, just use the sine double-angle formula. The rest of the process is very similar.

## Exponential Series

Using Eulers Equation, and a little trickery, we can convert the standard Rectangular Fourier Series into an exponential form. Even though complex numbers are a little more complicated to comprehend, we use this form for a number of reasons:
* Only need to perform one integration
* A single exponential can be manipulated more easily than a sum of sinusoids
* It provides a logical transition into a further discussion of the Fourier Transform.
We can construct the exponential series from the rectangular series using Euler's formulae:
    $\sin(x)={\frac {-i}{2}}\left(e^{ix}-e^{-ix}\right);\quad \quad \cos(x)={\frac {1}{2}}\left(e^{ix}+e^{-ix}\right)$
The rectangular series is given by:
    $f(x)=a_{0}+\sum _{n=1}^{\infty }\left[a_{n}\cos(n\omega x)+b_{n}\sin(n\omega x)\right]$
Substituting Euler's formulae:
    $f(x)=a_{0}+\sum _{n=1}^{\infty }\left[{\frac {a_{n}}{2}}e^{in\omega x}+{\frac {a_{n}}{2}}e^{-in\omega x}-{\frac {ib_{n}}{2}}e^{in\omega x}+{\frac {ib_{n}}{2}}e^{-in\omega x}\right]$
Splitting into "positive n" and "negative n" parts gives us:
    $f(x)=a_{0}+\sum _{n=1}^{\infty }\left[{\frac {a_{n}}{2}}e^{in\omega x}-{\frac {ib_{n}}{2}}e^{in\omega x}\right]+\sum _{n=-\infty }^{-1}\left[{\frac {a_{-n}}{2}}e^{in\omega x}+{\frac {ib_{-n}}{2}}e^{in\omega x}\right]$
    $f(x)=a_{0}+\sum _{n=1}^{\infty }{\frac {1}{2}}(a_{n}-ib_{n})e^{in\omega x}+\sum _{n=-\infty }^{-1}{\frac {1}{2}}(a_{-n}+ib_{-n})e^{in\omega x}$
We now collapse this into a single expression:
[Exponential Fourier Series]
    $f(x)=\sum _{n=-\infty }^{\infty }c_{n}e^{in\omega x}$
Where we can relate c$_n$ to a$_n$ and b$_n$ from the rectangular series:
    $c_{n}={\begin{cases}{\frac {1}{2}}(a_{-n}+ib_{-n}),&n<0\\a_{0},&n=0\\{\frac {1}{2}}(a_{n}-ib_{n}),&n>0\end{cases}}$
This is the exponential Fourier series of f(x). Note that c$_n$ is, in general, complex. Also note that:
   * $\Re (c_{n})=\Re (c_{-n})$
   * $\Im (c_{n})=-\Im (c_{-n})$
We can directly calculate c$_n$ for a 2L-periodic function:
    $c_{n}={\frac {1}{2L}}\int _{-L}^{L}f(x)e^{-in\pi x/L}dx$
This can be related to the a$_n$ and b$_n$ definitions in the rectangular form using Euler's formula: $e^{ix}=\cos {x}+i\sin {x}$.

## Negative Frequency

The Exponential form of the Fourier series does something that is very interesting in comparison to the rectangular and polar forms of the series: it allows for negative frequency components. To this effect, the Exponential series is often known as the "Bi-Sided Fourier Series", because the spectrum has both a positive and negative side. This, of course, prods the question, "What is a negative Frequency?"
Negative frequencies seem counter-intuitive, and many people would be quick to dismiss them as being nonsense. However, a further study of electrical engineering (which is outside the scope of this book) will provide many examples of where negative frequencies play a very important part in modeling and understanding certain systems. While it may not make much sense initially, negative frequencies need to be taken into account when studying the Fourier Domain.
Negative frequencies follow the important rule of symmetry: For real signals, negative frequency components are always mirror-images of the positive frequency components. Once this rule is learned, drawing the negative side of the spectrum is a trivial matter once the positive side has been drawn.
However, when looking at a bi-sided spectrum, the effect of negative frequencies needs to be taken into account. If the negative frequencies are mirror-images of the positive frequencies, and if a negative frequency is analogous to a positive frequency, then the effect of adding the negative components into a signal is the same as doubling the positive components. This is a major reason why the exponential Fourier series coefficients are multiplied by one-half in the calculation: because half the coefficient is at the negative frequency.
Note: The concept of negative frequency is actually unphysical. Negative frequencies occur in the spectrum only when we are using the exponential form of the Fourier series. To represent a cosine function, Euler's relationship tells us that there are both positive and negative exponential required. Why? Because to represent a real function, like cosine, the imaginary components present in exponential notation must vanish. Thus, the negative exponent in Euler's formula makes it appear that there are negative frequencies, when in fact, there are not.

### Example: Ceiling Fan

Another way to understand negative frequencies is to use them for mathematical completeness in describing the physical world. Suppose we want to describe the rotation of a ceiling fan directly above our head to a person sitting nearby. We would say "it rotates at 60 RPM in an anticlockwise direction". However, if we want to describe its rotation to a person watching the fan from above then we would say "it rotates at 60 RPM in a clockwise direction". If we customarily use a negative sign for clockwise rotation, then we would use a positive sign for anticlockwise rotation. We are describing the same process using both positive and negative signs, depending on the reference we choose.

## Bandwidth

Bandwidth is the name for the frequency range that a signal requires for transmission, and is also a name for the frequency capacity of a particular transmission medium. For example, if a given signal has a bandwidth of 10kHz, it requires a transmission medium with a bandwidth of at least 10kHz to transmit without attenuation.
Bandwidth can be measured in either Hertz or Radians per Second. Bandwidth is only a measurement of the positive frequency components. All real signals have negative frequency components, but since they are only mirror images of the positive frequency components, they are not included in bandwidth calculations.

### Bandwidth Concerns

It's important to note that most periodic signals are composed of an infinite sum of sinusoids, and therefore require an infinite bandwidth to be transmitted without distortion. Unfortunately, no available communication medium (wire, fiber optic, wireless) have an infinite bandwidth available. This means that certain harmonics will pass through the medium, while other harmonics of the signal will be attenuated.
Engineering is all about trade-offs. The question here is "How many harmonics do I need to transmit, and how many can I safely get rid of?" Using fewer harmonics leads to reduced bandwidth requirements, but also results in increased signal distortion. These subjects will all be considered in more detail in the future.

### Pulse Width

Using our relationship between period and frequency, we can see an important fact:
    $f_{0}={\frac {1}{T}}$
As the period of the signal decreases, the fundamental frequency increases. This means that each additional harmonic will be spaced further apart, and transmitting the same number of harmonics will now require more bandwidth! In general, there is a rule that must be followed when considering periodic signals: Shorter periods in the time domain require more bandwidth in the frequency domain. Signals that use less bandwidth in the frequency domain will require longer periods in the time domain.

## Examples
### Example: x$^3$

Let's consider a repeating pattern based on a cubic polynomial:
    $f\left(x\right)=x^{3},\quad -\pi \leq x<\pi \,$
and f(x) is 2π periodic:
By inspection, we can determine some characteristics of the Fourier Series:
* The function is odd, so the cosine coefficients (a$_n$) will all be zero.
* The function has no DC offset, so there will be no constant term (a$_0$).
* There are discontinuities, so we expect a 1/n drop-off.
We therefore just have to compute the b$_n$ terms. These can be found by the following formula:
    $b_{n}={1 \over \pi }\int \limits _{-\pi }^{\pi }{f\left(x\right)\sin \left({nx}\right)dx}$
Substituting in the desired function gives
    $b_{n}={1 \over \pi }\int \limits _{-\pi }^{\pi }{x^{3}\sin \left({nx}\right)dx}$
Integrating by parts,
    $b_{n}={1 \over \pi }\left({\left[{-x^{3}{{\cos \left({nx}\right)} \over n}}\right]_{-\pi }^{\pi }+\int \limits _{-\pi }^{\pi }{3x^{2}{{\cos \left({nx}\right)} \over n}dx}}\right)$
Bring out factors:
    $b_{n}={1 \over {n\pi }}\left({\left[{-x^{3}\cos \left({nx}\right)}\right]_{-\pi }^{\pi }+3\int \limits _{-\pi }^{\pi }{x^{2}\cos \left({nx}\right)dx}}\right)$
Substitute limits into the square brackets and integrate by parts again:
    $b_{n}={1 \over {n\pi }}\left({-\left({\pi ^{3}\cos \left({n\pi }\right)+\pi ^{3}\cos \left({-n\pi }\right)}\right)+3\left({\left[{x^{2}{{\sin \left({nx}\right)} \over n}}\right]_{-\pi }^{\pi }-\int \limits _{-\pi }^{\pi }{2x{{\sin \left({nx}\right)} \over n}dx}}\right)}\right)$
Recall that cos(x) is an even function, so cos(-nπ) = cos(nπ). Also bring out the factor of 1/n from the integral:
    $b_{n}={1 \over {n\pi }}\left({-\left({\pi ^{3}\cos \left({n\pi }\right)+\pi ^{3}\cos \left({n\pi }\right)}\right)+{3 \over n}\left({\left[{x^{2}\sin \left({nx}\right)}\right]_{-\pi }^{\pi }-2\int \limits _{-\pi }^{\pi }{x\sin \left({nx}\right)dx}}\right)}\right)$
Simplifying the left part, and substituting in limits in the square brackets,
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)+{3 \over n}\left({\left({\pi ^{2}\sin \left({n\pi }\right)-\pi \sin \left({-n\pi }\right)}\right)-2\int \limits _{-\pi }^{\pi }{x\sin \left({nx}\right)dx}}\right)}\right)$
Recall that sin(nπ) is always equal to zero for integer n:
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)+{3 \over n}\left({0-2\int \limits _{-\pi }^{\pi }{x\sin \left({nx}\right)dx}}\right)}\right)$
Bringing out factors and integrating by parts:
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)-{6 \over n}\left[{-\left[{x{{\cos \left({nx}\right)} \over n}}\right]_{-\pi }^{\pi }+\int \limits _{-\pi }^{\pi }{{{\cos \left({nx}\right)} \over n}dx}}\right]}\right)$
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)-{6 \over {n^{2}}}\left[-{\left[{x\cos \left({nx}\right)}\right]_{-\pi }^{\pi }+\int \limits _{-\pi }^{\pi }{\cos \left({nx}\right)dx}}\right]}\right)$
Solving the now-simple integral and substituting in limits to the square brackets,
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)-{6 \over {n^{2}}}\left[{-\left({\pi \cos \left({n\pi }\right)+\pi \cos \left({-n\pi }\right)}\right)+\left[{\sin \left({nx}\right)}\right]_{-\pi }^{\pi }}\right]}\right)$
Since the area under one cycle of a sine wave is zero, we can eliminate the integral. We use the fact that cos(x) is even again to simplify:
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)-{6 \over {n^{2}}}\left[{-2\pi \cos \left({n\pi }\right)+0}\right]}\right)$
Simplifying:
    $b_{n}={1 \over {n\pi }}\left({-2\pi ^{3}\cos \left({n\pi }\right)+{{12\pi } \over {n^{2}}}\cos \left({n\pi }\right)}\right)$
    $b_{n}={{-2\pi ^{2}\cos \left({n\pi }\right)} \over n}+{{12\cos \left({n\pi }\right)} \over {n^{3}}}$
    $b_{n}=\cos \left({n\pi }\right)\left({{{-2\pi ^{2}n^{2}} \over {n^{3}}}+{{12} \over {n^{3}}}}\right)$
    $b_{n}={{-2\cos \left({n\pi }\right)} \over {n^{3}}}\left({\pi ^{2}n^{2}-6}\right)$
Now, use the fact that cos(nπ)=(-1)$^n$:
    $b_{n}={{-2\left({-1}\right)^{n}} \over {n^{3}}}\left({\pi ^{2}n^{2}-6}\right)$
This is our final b$_n$. We see that we have a approximate 1/n relationship (the constant "6" becomes insignificant as n grows), as we expected. Now, we can find the Fourier approximation according to
    $f\left(x\right)={1 \over 2}a_{0}+\sum \limits _{n=1}^{\infty }{\left[{a_{n}\cos \left({nx}\right)+b_{n}\sin \left({nx}\right)}\right]}$
Since all a terms are zero,
    $f\left(x\right)=\sum \limits _{n=1}^{\infty }{b_{n}\sin \left({nx}\right)}$
So, the Fourier Series approximation of f(x) = x$^3$ is:
    $f\left(x\right)=\sum \limits _{n=1}^{\infty }{\left[{{{-2\left({-1}\right)^{n}} \over {n^{3}}}\left({\pi ^{2}n^{2}-6}\right)\sin \left({nx}\right)}\right]}$
The graph below shows the approximation for the first 7 terms (red) and the first 15 terms (blue). The original function is shown in black.

### Example: Square Wave

We have the following square wave signal, as a function of voltage, traveling through a communication medium:
We will set the values as follows: A = 4 volts, T = 1 second. Also, it is given that the width of a single pulse is T/2.
Find the rectangular Fourier series of this signal.
First and foremost, we can see clearly that this signal does have a DC value: the signal exists entirely above the horizontal axis. DC value means that we will have to calculate our a$_0$ term. Next, we can see that if we remove the DC component (shift the signal downward till it is centered around the horizontal axis), that our signal is an odd signal. This means that we will have b$_n$ terms, but no a$_n$ terms. We can also see that this function has discontinuities and half-wave symmetry. Let's recap:
* DC value (must calculate a$_0$)
* Odd Function (a$_n$ = 0 for n > 0)
* Discontinuties (terms fall off as 1/n)
* Half-wave Symmetry (no even harmonics)
Now, we can calculate these values as follows:
    $a_{0}={\frac {1}{T}}\int _{0}^{T}f(t)dt$
    $a_{0}={\frac {1}{T}}\int _{0}^{T/2}4dt$
    $a_{0}={\frac {1}{T}}\left[4t\right]_{0}^{T/2}={\frac {4\times T}{T\times 2}}=2$
This could also have been worked out intuitively, as the signal has a 50% duty-cycle, meaning that the average value is half of the maximum.
Due to the oddness of the function, there are no cosine terms:
    $a_{n}=0\quad {\mbox{ for all }}n>0$.
Due to the half-wave symmetry, there are only odd sine terms, which are given by:
    $b_{n}={\frac {1}{T/2}}\int _{0}^{T}f(t)\sin \left({\frac {2n\pi t}{T}}\right)dt$
    $b_{n}={\frac {2}{T}}\int _{0}^{T/2}4\sin \left(2n\pi t\right)dt$
    $b_{n}=-2\left[{\frac {4}{2n\pi }}\cos \left(2n\pi t\right)\right]_{0}^{1/2}$
    $b_{n}=-2\left[{\frac {4}{2n\pi }}\cos \left({\frac {2n\pi }{2}}\right)-{\frac {4}{2n\pi }}\cos \left(2n\pi \times 0\right)\right]$
    $b_{n}=-{\frac {4}{n\pi }}\left[\cos \left(n\pi \right)-1\right]$
Given that cos(nπ)=(-1)$^n$:
    $b_{n}=-{\frac {4\left((-1)^{n}-1\right)}{n\pi }}$
For any even n, this equals zero, in accordance with our predictions based on half-wave symmetry. It also decays as 1/n, as we expect, due to the presence of discontinuities.
Finally, we can put our Fourier series together as follows:
    $f(t)=a_{0}+\sum _{n=1}^{\infty }{b_{n}\sin \left({\frac {\pi nt}{\frac {L}{2}}}\right)}$
    $f(t)=2-{\frac {4}{\pi }}\sum _{n=1}^{\infty }{{\frac {(-1)^{n}-1}{n}}\sin(2\pi nt)}$
This is the same as
    $f(t)=2+{\frac {8}{\pi }}\sum _{n=1,3,5,\ldots }^{\infty }{{\frac {1}{n}}\sin(2\pi nt)}$
We see that the Fourier series closely matches the original function:

## Further Reading

Wikipedia has an article on the Fourier Series, although the article is very mathematically rigorous.

## 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.

## Aperiodic Signals

The opposite of a periodic signal is an aperiodic signal. An aperiodic function never repeats, although technically an aperiodic function can be considered like a periodic function with an infinite period.

## Background

If we consider aperiodic signals, it turns out that we can generalize the Fourier Series sum into an integral named the Fourier Transform. The Fourier Transform is used similarly to the Fourier Series, in that it converts a time-domain function into a frequency domain representation. However, there are a number of differences:
* Fourier Transform can work on Aperiodic Signals.
* Fourier Transform is an infinite sum of infinitesimal sinusoids.
* Fourier Transform has an inverse transform, that allows for conversion from the frequency domain back to the time domain.

## Fourier Transform

The Fourier Transform is the following integral:
    ${\mathcal {F}}(f(t))=F(j\omega )=\int _{-\infty }^{\infty }f(t)e^{-j\omega t}dt$
Examples of Fourier Transforms:
* Unit impulse function, $\delta (t)$: ${\mathcal {F}}(\delta (t))=\int _{-\infty }^{\infty }\delta (t)e^{-j\omega t}dt=1$
* Rectangular pulse function
* $\exp(-at)u(t)~~~a>0$

## Inverse Fourier Transform

And the inverse transform is given by a similar integral:
    ${\mathcal {F}}^{-1}\left\{F(j\omega )\right\}=f(t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }F(j\omega )e^{j\omega t}d\omega$
Using these formulas, time-domain signals can be converted to and from the frequency domain, as needed.

### Partial Fraction Expansion

One of the most important tools when attempting to find the inverse fourier transform is the Theory of Partial Fractions. The theory of partial fractions allows a complicated fractional value to be decomposed into a sum of small, simple fractions. This technique is highly important when dealing with other transforms as well, such as the Laplace transform and the Z-Transform.

## Duality

The Fourier Transform has a number of special properties, but perhaps the most important is the property of duality.
We will use a "double-arrow" signal to denote duality. If we have an even signal f, and it's fourier transform F, we can show duality as such:
    $f(t)\Leftrightarrow F(j\omega )$
This means that the following rules hold true:
    ${\mathcal {F}}\{f(t)\}=F(j\omega )$ AND ${\mathcal {F}}\{F(t)\}=f(j\omega )$
Notice how in the second part we are taking the transform of the transformed equation, except that we are starting in the time domain. We then convert to the original time-domain representation, except using the frequency variable. There are a number of results of the Duality Theorem.

### Convolution Theorem

The Convolution Theorem is an important result of the duality property. The convolution theorem states the following:

#### Convolution Theorem

    Convolution in the time domain is multiplication in the frequency domain. Multiplication in the time domain is convolution in the frequency domain.
Or, another way to write it (using our new notation) is such:
    $A\times B\Leftrightarrow A*B$

### Signal Width

Another principle that must be kept in mind is that signal-widths in the time domain, and bandwidth in the frequency domain are related. This can be summed up in a single statement:
    Thin signals in the time domain occupy a wide bandwidth. Wide signals in the time domain occupy a thin bandwidth.
This conclusion is important because in modern communication systems, the goal is to have thinner (and therefore more frequent) pulses for increased data rates, however the consequence is that a large amount of bandwidth is required to transmit all these fast, little pulses.

## Power and Energy
### Energy Spectral Density

Unlike the Fourier Series, the Fourier Transform does not provide us with a number of discrete harmonics that we can add and subtract in a discrete manner. If our channel bandwidth is limited, in the Fourier Series representation, we can simply remove some harmonics from our calculations. However, in a continuous spectrum, we do not have individual harmonics to manipulate, but we must instead examine the entire continuous signal.
The Energy Spectral Density (ESD) of a given signal is the square of its Fourier transform. By definition, the ESD of a function f(t) is given by F$^2$(jω). The power over a given range (a limited bandwidth) is the integration under the ESD graph, between the cut-off points. The ESD is often written using the variable E$_f$(jω).
    $E_{f}(j\omega )=F^{2}(j\omega )$

### Power Spectral Density

The Power Spectral Density (PSD) is similar to the ESD. It shows the distribution of power in the spectrum of a particular signal.
    $P_{f}(j\omega )=\int _{-\infty }^{\infty }F(j\omega )d\omega$
Power spectral density and the autocorrelation form a Fourier Transform duality pair. This means that:
    $P_{f}(j\omega )={\mathcal {F}}[R_{ff}(t)]$
If we know the auto correlation of the signal, we can find the PSD by taking the Fourier transform. Similarly, if we know the PSD, we can take the inverse Fourier transform to find the auto correlation signal.

## Frequency Response

Systems respond differently to inputs of different frequencies. Some systems may amplify components of certain frequencies, and attenuate components of other frequencies. The way that the system output is related to the system input for different frequencies is called the frequency response of the system.
The frequency response is the relationship between the system input and output in the Fourier Domain.
In this system, X(jω) is the system input, Y(jω) is the system output, and H(jω) is the frequency response. We can define the relationship between these functions as:
    $Y(j\omega )=H(j\omega )X(j\omega )$
    ${\frac {Y(j\omega )}{X(j\omega )}}=H(j\omega )$

## The Frequency Response Functions

Since the frequency response is a complex function, we can convert it to polar notation in the complex plane. This will give us a magnitude and an angle. We call the angle the phase.

### Amplitude Response

For each frequency, the magnitude represents the system's tendency to amplify or attenuate the input signal.
       $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|$

### Phase Response

The phase represents the system's tendency to modify the phase of the input sinusoids.
       $\phi \left(\omega \right)=\angle H\left({j\omega }\right)$.
The phase response, or its derivative the group delay, tells us how the system delays the input signal as a function of frequency.

## Examples
### Example: Electric Circuit

Consider the following general circuit with phasor input and output voltages:
Where
    $V_{o}\left({j\omega }\right)=V_{om}\cos \left({\omega t+\theta _{o}}\right)=V_{om}\angle \theta _{o}$
    $V_{i}\left({j\omega }\right)=V_{im}\cos \left({\omega t+\theta _{i}}\right)=V_{im}\angle \theta _{i}$
As before, we can define the system function, H(jω) of this circuit as:
    $H\left({j\omega }\right)={{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}$
    $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|={{\left|{V_{o}\left({j\omega }\right)}\right|} \over {\left|{V_{i}\left({j\omega }\right)}\right|}}={{V_{om}} \over {V_{im}}}$
    $\phi \left(\omega \right)=\angle H\left({j\omega }\right)=\angle \left({{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}\right)=\angle V_{o}\left({j\omega }\right)-\angle V_{i}\left({j\omega }\right)=\theta _{o}-\theta _{i}$
Rearranging gives us the following transformations:
    $V_{om}=A\left(\omega \right)V_{im}$
    $\theta _{o}=\theta _{i}+\phi \left(\omega \right)$

### Example: Low-Pass Filter

We will illustrate this method using a simple low-pass filter with general values as an example. This kind of circuit allows low frequencies to pass, but blocks higher ones.
Find the frequency response function, and hence the amplitude and phase response functions, of the following RC circuit (it is already in phasor form):
Firstly, we use the voltage divider rule to get the output phasor in terms on the input phasor:
       $V_{o}\left({j\omega }\right)=V_{i}\left({j\omega }\right)\cdot {{1 \over {j\omega C}} \over {R+{1 \over {j\omega C}}}}$
Now we can easily determine the frequency response:
       $H\left({j\omega }\right)={{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}={{1 \over {j\omega C}} \over {R+{1 \over {j\omega C}}}}$
This simiplifies down to:
       $H\left({j\omega }\right)={1 \over {1+j\omega RC}}$
From here we can find the amplitude and phase responses:
       $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|={1 \over {\sqrt {1+\left({\omega CR}\right)^{2}}}}$
       $\phi \left(\omega \right)=\angle H\left({j\omega }\right)=\tan ^{-1}\left({0 \over 1}\right)-\tan ^{-1}\left({{\omega RC} \over 1}\right)=-\tan ^{-1}\left({\omega RC}\right)$
The frequency response is pictured by the plots of the amplitude and phase responses:
It is often easier to interpret the graphs when they are plotted on suitable logarithmic scales:
This shows that the circuit is indeed a filter that removes higher frequencies. Such a filter is called a lowpass filter.
The amplitude and phase responses of an arbitrary circuit can be plotted using an instrument called a spectrum analyser or gain and phase test set. See Practical Electronics for more details on using these instruments.

## Filters

An important concept to take away from these examples is that by desiging a proper system called a filter, we can selectively attenuate or amplify certain frequency ranges. This means that we can minimize certain unwanted frequency components (such as noise or competing data signals), and maximize our own data signal
We can define a "received signal" r as a combination of a data signal d and unwanted components v:
    $r(t)=d(t)+v(t)$
We can take the energy spectral density of r to determine the frequency ranges of our data signal d. We can design a filter that will attempt to amplify these frequency ranges, and attenuate the frequency ranges of v. We will discuss this problem and filters in general in the next few chapters. More advanced discussions of this topic will be in the book on Signal Processing.

# Complex Frequency Representation
## The Laplace Transform

Whilst the Fourier Series and the Fourier Transform are well suited for analysing the frequency content of a signal, be it periodic or aperiodic, the Laplace transform is the tool of choice for analysing and developing circuits such as filters.
The Fourier Transform can be considered as an extension of the Fourier Series for aperiodic signals. The Laplace Transform can be considered as an extension of the Fourier Transform to the complex plane.

### Unilateral Laplace Transform

The Laplace Transform of a function f(t), defined for all real numbers t ≥ 0, is the function F(s), defined by:
    $F(s)={\mathcal {L}}\left\{f(t)\right\}=\int _{0}^{\infty }e^{-st}f(t)\,dt.$
The parameter s is the complex number:
    $s=\sigma +j\omega ,\,$ with a real part σ and an imaginary part ω.

### Bilateral Laplace Transform

The Bilateral Laplace Transform is defined as follows:
    $F(s)={\mathcal {L}}\left\{f(t)\right\}=\int _{-\infty }^{\infty }e^{-st}f(t)\,dt.$
Comparing this definition to the one of the Fourier Transform, one sees that the latter is a special case of the Laplace Transform for $s=j\omega$.
In the field of electrical engineering, the Bilateral Laplace Transform is simply referred as the Laplace Transform.

### Inverse Laplace Transform

The Inverse Laplace Transform allows to find the original time function on which a Laplace Transform has been made.:
:$>f(t)={\mathcal {L}}^{-1}\{F(s)\}={\frac {1}{2\pi i}}\lim _{T\to \infty }\int _{\gamma -iT}^{\gamma +iT}e^{st}F(s)\,ds,$

## Laplace Transform Examples

* Unit impulse function (dirac-delta function) $\delta (t)$
${\mathcal {L}}\left\{\delta (t)\right\}=\int _{-\infty }^{\infty }e^{-st}\delta (t)\,dt=1.$
* Unit step function, $u(t)$
${\mathcal {L}}\left\{u(t)\right\}=\int _{-\infty }^{\infty }e^{-st}u(t)\,dt=\int _{0}^{\infty }e^{-st}\,dt=-{\frac {e^{-st}}{s}}{\Biggr |}_{0}^{\infty }.$
The above integral converges only when $\Re (s)>0.$ For $\Re (s)>0$
${\mathcal {L}}\left\{u(t)\right\}={\frac {1}{s}}.$
* Exponential function, $e^{-at}u(t)$
${\mathcal {L}}\left\{e^{-at}u(t)\right\}=\int _{-\infty }^{\infty }e^{-st}e^{-at}u(t)\,dt=\int _{0}^{\infty }e^{-(s+a)t}\,dt=-{\frac {e^{-(s+a)t}}{s+a}}{\Biggr |}_{0}^{\infty }$
The above integral converges only when $\Re (s+a)>0.$
${\mathcal {L}}\left\{e^{-at}u(t)\right\}={\frac {1}{s+a}}$

## Differential Equations
### Integral and Derivative

The properties of the Laplace transform show that:
* the transform of a derivative corresponds to a multiplication with $s$
* the transform of an integral corresponds to a division with $s$
This is summarized in the following table:
| Time Domain | Laplace Domain |
| $x(t)$ | $X(s)={\mathcal {L}}\left\{x(t)\right\}$ |
| ${\dot {x}}(t)$ | $s\cdot X(s)$ |
| $\int x(t)dt$ | ${\frac {1}{s}}\cdot X(s)$ |
With this, a set of differential equations is transformed into a set of linear equations which can be solved with the usual techniques of linear algebra.

### Lumped Element Circuits

Lumped elements circuits typically show this kind of integral or differential relations between current and voltage:
       $U_{C}={\frac {1}{sC}}\cdot I_{C}$
       $U_{L}=sL\cdot I_{L}$
This is why the analysis of a lumped elements circuit is usually done with the help of the Laplace transform.

## Example
### Sallen-Key Lowpass Filter

The image on the side shows the circuit for an all-pole second order function.
Writing $v_{1}$ the potential between both resistances and $v_{2}$ the input of the op-amp follower circuit, gives the following relations:
    ${\begin{cases}R_{1}I_{R1}=V_{in}-V_{1}\\R_{2}I_{R2}=V_{1}-V_{2}\\I_{C2}=sC_{2}V_{2}\\I_{C1}=sC_{1}(V_{1}-V_{out})\\I_{R1}=I_{R2}+I_{C1}\\I_{R2}=I_{C2}\\V_{2}=V_{out}\end{cases}}$
Rewriting the current node relations gives:
    ${\begin{cases}R_{1}R_{2}I_{R1}=R_{1}R_{2}I_{R2}+R_{1}R_{2}I_{C1}\\R_{2}I_{R2}=R_{2}I_{C2}\end{cases}}$
    ${\begin{cases}R_{2}(V_{in}-V_{1})=R_{1}(V_{1}-V_{out})+R_{1}R_{2}sC_{1}(V_{1}-V_{out})\\V_{1}-V_{out}=R_{2}sC_{2}V_{out}\end{cases}}$
    ${\begin{cases}R_{2}V_{in}=(R_{1}+R_{2}+R_{1}R_{2}sC_{1})V_{1}-(R_{1}+R_{1}R_{2}sC_{1})V_{out}\\V_{1}=(1+sR_{2}C_{2})V_{out}\end{cases}}$
    $R_{2}V_{in}={\begin{bmatrix}(1+sR_{2}C_{2})(R_{1}+R_{2}+R_{1}R_{2}sC_{1})-R_{1}-R_{1}R_{2}sC_{1}\end{bmatrix}}V_{out}$
    $V_{in}={\begin{bmatrix}(1+sR_{2}C_{2})(R_{1}/R_{2}+1+sR_{1}C_{1}-R_{1}/R_{2}-sR_{1}C_{1}\end{bmatrix}}V_{out}$
    ${\frac {V_{in}}{V_{out}}}=R_{1}/R_{2}+1+sR_{1}C_{1}+sR_{1}C_{2}+sR_{2}C_{2}+s^{2}R_{1}R_{2}C_{1}C_{2}-R_{1}/R_{2}-sR_{1}C_{1}$
and finally:
    ${\frac {V_{out}}{V_{in}}}={\frac {1}{1+s(R_{1}+R_{2})C_{2}+s^{2}R_{1}R_{2}C_{1}C_{2}}}$
Thus, the transfer function is:
    $H(s)={\frac {\frac {1}{R_{1}R_{2}C_{1}C_{2}}}{s^{2}+{\frac {R_{1}+R_{2}}{R_{1}R_{2}}}{\frac {1}{C_{1}}}s+{\frac {1}{R_{1}R_{2}C_{1}C_{2}}}}}$

# Random Signals
## Probability

This section of the Signals and Systems book will be talking about probability, random signals, and noise. This book will not, however, attempt to teach the basics of probability, because there are dozens of resources (both on the internet at large, and on Wikipedia mathematics bookshelf) for probability and statistics. This book will assume a basic knowledge of probability, and will work to explain random phenomena in the context of an Electrical Engineering book on signals.

## Random Variable

A random variable is a quantity whose value is not fixed but depends somehow on chance. Typically the value of a random variable may consist of a fixed part and a random component due to uncertainty or disturbance. Other types of random variables takes their values as a result of the outcome of a random experiment.
Random variables are usually denoted with a capital letter. For instance, a generic random variable that we will use often is X. The capital letter represents the random variable itself and the corresponding lower-case letter (in this case "x") will be used to denote the observed value of X. x is one particular value of the process X.

## Mean

The mean or more precise the expected value of a random variable is the central value of the random value, or the average of the observed values in the long run. We denote the mean of a signal x as μ$_x$. We will discuss the precise definition of the mean in the next chapter.

## Standard Deviation

The standard deviation of a signal x, denoted by the symbol σ$_x$ serves as a measure of how much deviation from the mean the signal demonstrates. For instance, if the standard deviation is small, most values of x are close to the mean. If the standard deviation is large, the values are more spread out.
The standard deviation is an easy concept to understand, but in practice it's not a quantity that is easy to compute directly, nor is it useful in calculations. However, the standard deviation is related to a more useful quantity, the variance.

## Variance

The variance is the square of the standard deviation and is more of theoretical importance. We denote the variance of a signal x as σ$_x$$^2$. We will discuss the variance and how it is calculated in the next chapter.

## Probability Function

The probability function P is the probability that a certain event will occur. It is calculated based on the probability density function and cumulative distribution function, described below.
We can use the P operator in a variety of ways:
    $P[{\mbox{A coin is heads}}]={\frac {1}{2}}$
    $P[{\mbox{A dice shows a 3}}]={\frac {1}{6}}$

## Probability Density Function

The Probability Density Function (PDF) of a random variable is a description of the distribution of the values of the random variable. By integrating this function over a particular range, we can find the probability that the random variable takes on a value in that interval. The integral of this function over all possible values is 1.
We denote the density function of a signal x as f$_x$. The probability of an event x$_i$ will occur is given as:
    $P[x_{i}]=f_{x}(x_{i})$

## Cumulative Distribution Function

The Cumulative Distribution Function (CDF) of a random variable describes the probability of observing a value at or below a certain threshold. A CDF function will be nondecreasing with the properties that the value of the CDF at negative infinity is zero, and the value of the CDF at positive infinity is 1.
We denote the CDF of a function with a capital F. The CDF of a signal x will have the subscript f$_x$.
We can say that the probability of an event occurring less then or equal to x$_i$ is defined in terms of the CDF as:
    $P[x\leq x_{i}]=F_{x}(x_{i})$
Likewise, we can define the probability that an event occurs that is greater then x$_i$ as:
    $P[x>x_{i}]=1-F_{x}(x_{i})$
Or, the probability that an event occurs that is greater then or equal to x$_i$:
    $P[x\geq x_{i}]=1-F_{x}(x_{i})+f_{x}(x_{i})$

### Relation with PDF

The CDF and PDF are related to one another by a simple integral relation:
    $F_{x}(x)=\int _{-\infty }^{x}f_{x}(\tau )d\tau$
    $f_{x}(x)={\frac {d}{dx}}F_{x}(x)$

### Terminology

Several book sources refer to the CDF as the "Probability Distribution Function", with the acronym PDF. To avoid the ambiguity of having both the distribution function and the density function with the same acronym (PDF), some books will refer to the density function as "pdf" (lower case) and the distribution function as "PDF" upper case. To avoid this ambiguity, this book will refer to the distribution function as the CDF, and the density function as the PDF.

## Expected Value Operator

The Expected value operator is a linear operator that provides a mathematical way to determine a number of different parameters of a random distribution. The downside of course is that the expected value operator is in the form of an integral, which can be difficult to calculate.
The expected value operator will be denoted by the symbol:
    $\mathbb {E} [\cdot ]$
For a random variable X with probability density f$_x$, the expected value is defined as:
    $\mathbb {E} [X]=\int _{-\infty }^{\infty }xf_{X}(x)dx$.
provided the integral exists.
The Expectation of a signal is the result of applying the expected value operator to that signal. The expectation is another word for the mean of a signal:
    $\mu _{x}=\mathbb {E} [X]$

## Moments

The expected value of the N-th power of X is called the N-th moment of X or of its distribution:
    $\mathbb {E} [X^{N}]=\int _{-\infty }^{\infty }x^{N}f_{X}(x)dx$.
Some moments have special names, and each one describes a certain aspect of the distribution.

## Central Moments

Once we know the expected value of a distribution, we know its location. We may consider all other moments relative to this location and calculate the Nth moment of the random variable X - E[X]; the result is called the Nth central moment of the distribution. Each central moment has a different meaning, and describes a different facet of the random distribution. The N-th central moment of X is:
    $\mathbb {E} [(X-\mathbb {E} [X])^{N}]=\int _{-\infty }^{\infty }(x-\mathbb {E} [X])^{N}f_{X}(x)dx$.
For sake of simplicity in the notation, the first moment, the expected value is named:
    $\mathbb {E} [X]=\mu _{X}$,
The formula for the N-th central moment of X becomes then:
    $\mathbb {E} [(X-\mu _{X})^{N}]=\int _{-\infty }^{\infty }(x-\mu _{X})^{N}f_{X}(x)dx$.
It is obvious that the first central moment is zero:
    $\mathbb {E} [(X-\mu _{X})]=0$
The second central moment is the variance,
    $\mathbb {E} [(X-\mu _{X})^{2}]=\sigma ^{2}$

### Variance

The variance, the second central moment, is denoted using the symbol σ$_x$$^2$, and is defined as:
    $\sigma _{x}^{2}=\mathrm {var} (X)=\mathbb {E} [X-\mathbb {E} [X]]^{2}=\mathbb {E} [X^{2}]-\mathbb {E} [X]^{2}$

### Standard Deviation

The standard deviation of a random distribution is the square root of the variance, and is given as such:
    $\sigma _{x}={\sqrt {\sigma _{x}^{2}}}$

## Time-Average Operator

The time-average operator provides a mathematical way to determine the average value of a function over a given time range. The time average operator can provide the mean value of a given signal, but most importantly it can be used to find the average value of a small sample of a given signal. The operator also allows us a useful shorthand way for taking the average, which is used in many equations.
The time average operator is denoted by angle brackets (< and >) and is defined as such:
    $\langle f(t)\rangle ={\frac {1}{T}}\int _{0}^{T}f(t)dt$
There are a number of different random distributions in existence, many of which have been studied quite extensively, and many of which map very well to natural phenomena. This book will attempt to cover some of the most basic and most common distributions. This chapter will also introduce the idea of a distribution transformation, which can be used to turn a simple distribution into a more exotic distribution.

## Uniform Distribution

One of the most simple distributions is a Uniform Distribution. Uniform Distributions are also very easy to model on a computer, and then they can be converted to other distribution types by a series of transforms.
A uniform distribution has a PDF that is a rectangle. This rectangle is centered about the mean, <μ$_x$, has a width of A, and a height of 1/A. This definition ensures that the total area under the PDF is 1.

## Gaussian Distribution

The Gaussian (or normal) distribution is simultaneously one of the most common distributions, and also one of the most difficult distributions to work with. The problem with the Gaussian distribution is that its pdf equation is non-integratable, and therefore there is no way to find a general equation for the cdf (although some approximations are available), and there is little or no way to directly calculate certain probabilities. However, there are ways to approximate these probabilities from the Gaussian pdf, and many of the common results have been tabulated in table-format. The function that finds the area under a part of the Gaussian curve (and therefore the probability of an event under that portion of the curve) is known as the Q function, and the results are tabulated in a Q table.

### PDF and CDF

The PDF of a Gaussian random variable is defined as such:
    $f(x)={\frac {1}{\sqrt {2\pi \sigma ^{2}}}}e^{-{\frac {(x-\mu )^{2}}{2\sigma ^{2}}}}$
The CDF of the Gaussian function is the integral of this, which any mathematician will tell you is impossible to express in terms of regular functions.

### The Functions Φ and Q

The normal distribution with parameters μ = 0 and σ = 1, the so-called standard normal distribution, plays an important role, because all other normal distributions may be derived from it. The CDF of the standard normal distribution is often indicated by Φ:
    $\Phi (x)={\frac {1}{2\pi }}\int _{-\infty }^{x}e^{-{\frac {t^{2}}{2}}}dt$.
It gives the probability for a standard normal distributed random variable to attain values less than x.
The Q function is the area under the right tail of the Gaussian curve and hence nothing more than 1 - Φ. The Q function is hence defined as:
    $Q(x)=1-\Phi (x)={\frac {1}{2\pi }}\int _{x}^{\infty }e^{-{\frac {t^{2}}{2}}}dt$
Mathematical texts might prefer to use the erf(x) and erfc(x) functions, which are similar. However this book (and engineering texts in general) will utilize the Q and Phi functions.

## Poisson Distribution

The Poisson Distribution is different from the Gaussian and uniform distributions in that the Poisson Distribution only describes discrete data sets. For instance, if we wanted to model the number of telephone calls that are traveling through a given switch at one time, we cannot possibly count fractions of a phone call; phone calls come only in integer numbers. Also, you can't have a negative number of phone calls. It turns out that such situations can be easily modeled by a Poisson Distribution. Some general examples of Poisson Distribution random events are:
* The telephone calls arriving at a switch
* The internet data packets traveling through a given network
* The number of cars traveling through a given intersection

## Transformations

If we have a random variable that follows a particular distribution, we would frequently like to transform that random process to use a different distribution. For instance, if we write a computer program that generates a uniform distribution of random numbers, and we would like to write one that generates a Gaussian distribution instead, we can feed the uniform numbers into a transform, and the output will be random numbers following a Gaussian distribution. Conversely, if we have a random variable in a strange, exotic distribution, and we would like to examine it using some of the easy, tabulated Gaussian distribution tools, we can transform it.

## Further Reading

* Statistics/Distributions
* Probability/Important Distributions
* Engineering Analysis/Distributions

## Frequency Analysis

Noise, like any other signal, can be analyzed using the Fourier Transform and frequency-domain techniques. Some of the basic techniques used on noise (some of which are particular to random signals) are discussed in this section.
Gaussian white noise, one of the most common types of noise used in analysis, has a "flat spectrum". That is, the amplitude of the noise is the same at all frequencies.

## Power Spectral Density (PSD) of Gaussian White Noise

White noise has a level magnitude spectrum, and if we square it, it will also have a level Power Spectral Density (PSD) function. The value of this power magnitude is known by the variable N$_0$. We will use this quantity later.

## Wiener Khintchine Einstein Theorem

Using the duality property of the Fourier Transform, the Wiener-Khintchine-Einstein Theorem gives us an easy way to find the PSD for a given signal.
if we have a signal f(t), with autocorrelation R$_{ff}$, then we can find the PSD, S$_{xx}$ by the following function:
    $S_{xx}={\mathcal {F}}(R_{ff})$
Where the previous method for obtaining the PSD was to take the Fourier transform of the signal f(t), and then squaring it.

## Bandwidth

The bandwidth of a random function.

### Narrow band Systems
## Windowing

Many random signals are infinite signals, in that they don't have a beginning or an end. To this effect, the only way to really analyze the random signal is take a small chunk of the random signal, called a sample.
Let us say that we have a long random signal, and we only want to analyze a sample. So we take the part that we want, and destroy the part that we don't want. Effectively, what we have done is to multiply the signal with a rectangular pulse. Therefore, the frequency spectrum of our sampled signal will contain frequency components of the noise and the rectangular pulse. It turns out that multiplying a signal by a rectangular pulse is rarely the best way to sample a random signal. It also turns out that there are a number of other windows that can be used instead, to get a good sample of noise, while at the same time introducing very few extraneous frequency components.
Remember duality? multiplication in the time domain (multiplying by your windowing function) becomes convolution in the frequency domain. Effectively, we've taken a very simple problem (getting a sample of information), and created a very difficult problem, the deconvolution of the resultant frequency spectrum. There are a number of different windows that we can use.

### Hamming Window
# Introduction to Filters
## Frequency Response

Systems respond differently to inputs of different frequencies. Some systems may amplify components of certain frequencies, and attenuate components of other frequencies. The way that the system output is related to the system input for different frequencies is called the frequency response of the system.
The frequency response is the relationship between the system input and output in the Fourier Domain.
In this system, X(jω) is the system input, Y(jω) is the system output, and H(jω) is the frequency response. We can define the relationship between these functions as:
    $Y(j\omega )=H(j\omega )X(j\omega )$
    ${\frac {Y(j\omega )}{X(j\omega )}}=H(j\omega )$

## The Frequency Response Functions

Since the frequency response is a complex function, we can convert it to polar notation in the complex plane. This will give us a magnitude and an angle. We call the angle the phase.

### Amplitude Response

For each frequency, the magnitude represents the system's tendency to amplify or attenuate the input signal.
       $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|$

### Phase Response

The phase represents the system's tendency to modify the phase of the input sinusoids.
       $\phi \left(\omega \right)=\angle H\left({j\omega }\right)$.
The phase response, or its derivative the group delay, tells us how the system delays the input signal as a function of frequency.

## Examples
### Example: Electric Circuit

Consider the following general circuit with phasor input and output voltages:
Where
    $V_{o}\left({j\omega }\right)=V_{om}\cos \left({\omega t+\theta _{o}}\right)=V_{om}\angle \theta _{o}$
    $V_{i}\left({j\omega }\right)=V_{im}\cos \left({\omega t+\theta _{i}}\right)=V_{im}\angle \theta _{i}$
As before, we can define the system function, H(jω) of this circuit as:
    $H\left({j\omega }\right)={{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}$
    $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|={{\left|{V_{o}\left({j\omega }\right)}\right|} \over {\left|{V_{i}\left({j\omega }\right)}\right|}}={{V_{om}} \over {V_{im}}}$
    $\phi \left(\omega \right)=\angle H\left({j\omega }\right)=\angle \left({{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}\right)=\angle V_{o}\left({j\omega }\right)-\angle V_{i}\left({j\omega }\right)=\theta _{o}-\theta _{i}$
Rearranging gives us the following transformations:
    $V_{om}=A\left(\omega \right)V_{im}$
    $\theta _{o}=\theta _{i}+\phi \left(\omega \right)$

### Example: Low-Pass Filter

We will illustrate this method using a simple low-pass filter with general values as an example. This kind of circuit allows low frequencies to pass, but blocks higher ones.
Find the frequency response function, and hence the amplitude and phase response functions, of the following RC circuit (it is already in phasor form):
Firstly, we use the voltage divider rule to get the output phasor in terms on the input phasor:
       $V_{o}\left({j\omega }\right)=V_{i}\left({j\omega }\right)\cdot {{1 \over {j\omega C}} \over {R+{1 \over {j\omega C}}}}$
Now we can easily determine the frequency response:
       $H\left({j\omega }\right)={{V_{o}\left({j\omega }\right)} \over {V_{i}\left({j\omega }\right)}}={{1 \over {j\omega C}} \over {R+{1 \over {j\omega C}}}}$
This simiplifies down to:
       $H\left({j\omega }\right)={1 \over {1+j\omega RC}}$
From here we can find the amplitude and phase responses:
       $A\left(\omega \right)=\left|{H\left({j\omega }\right)}\right|={1 \over {\sqrt {1+\left({\omega CR}\right)^{2}}}}$
       $\phi \left(\omega \right)=\angle H\left({j\omega }\right)=\tan ^{-1}\left({0 \over 1}\right)-\tan ^{-1}\left({{\omega RC} \over 1}\right)=-\tan ^{-1}\left({\omega RC}\right)$
The frequency response is pictured by the plots of the amplitude and phase responses:
It is often easier to interpret the graphs when they are plotted on suitable logarithmic scales:
This shows that the circuit is indeed a filter that removes higher frequencies. Such a filter is called a lowpass filter.
The amplitude and phase responses of an arbitrary circuit can be plotted using an instrument called a spectrum analyser or gain and phase test set. See Practical Electronics for more details on using these instruments.

## Filters

An important concept to take away from these examples is that by desiging a proper system called a filter, we can selectively attenuate or amplify certain frequency ranges. This means that we can minimize certain unwanted frequency components (such as noise or competing data signals), and maximize our own data signal
We can define a "received signal" r as a combination of a data signal d and unwanted components v:
    $r(t)=d(t)+v(t)$
We can take the energy spectral density of r to determine the frequency ranges of our data signal d. We can design a filter that will attempt to amplify these frequency ranges, and attenuate the frequency ranges of v. We will discuss this problem and filters in general in the next few chapters. More advanced discussions of this topic will be in the book on Signal Processing.

## Terminology

When it comes to filters, there is a large amount of terminology that we need to discuss first, so the rest of the chapters in this section will make sense.

### Order (Filter Order)

    The order of a filter is an integer number, that defines how complex the filter is. In common filters, the order of the filter is the number of "stages" of the filter. Higher order filters perform better, but they have a higher delay, and they cost more.

### Pass Band

    In a general sense, the passband is the frequency range of the filter that allows information to pass. The passband is usually defined in the specifications of the filter. For instance, we could define that we want our passband to extend from 0 to 1000 Hz, and we want the amplitude in the entire passband to be higher than -1 db.

### Transition Band

    The transition band is the area of the filter between the passband and the stopband. Higher-order filters have a thinner transition band

### Stop Band

    The stop band of a filter is the frequency range where the signal is attenuated. Stop band performance is often defined in the specification for the filter. For instance, we might say that we want to attenuate all frequencies above 5000 Hz, and we want to attenuate them all by -40 db or more

### Cut-off Frequency

    The cut-off frequency of a filter is the frequency at which the filter "breaks", and changes (between pass band and transition band, or transition band and passband, for instance). The cut-off of a filter always has an attenuation of -3db. The -3 db point is the frequency that is cut in power by exactly 1/2.

## Lowpass

Lowpass filters allow low frequency components to pass through, while attenuating high frequency components.
Lowpass filters are some of the most important and most common filters, and much of our analysis is going to be focused on them. Also, transformations exist that can be used to convert the mathematical model of a lowpass filter into a model of a highpass, bandpass, or bandstop filter. This means that we typically design lowpass filters and then transform them into the appropriate type.

### Example: Telephone System

As an example of a lowpass filter, consider a typical telephone line. Telephone signals are bandlimited, which means that a filter is used to prevent certain frequency components from passing through the telephone network. Typically, the range for a phone conversation is 10Hz to 3˙000Hz. This means that the phone line will typically incorporate a lowpass filter that attenuates all frequency components above 3˙000Hz. This range has been chosen because it includes all the information humans need for clearly understanding one another, so the effects of this filtering are not damaging to a conversation. Comparatively, CD recordings comprise most of the human hearing and their frequency components range up to 20˙000Hz or 20kHz.

## Highpass

Highpass filters allow high frequency components to pass through, while attenuating low frequency components.

### Example: DSL Modems

Consider DSL modems, which are high-speed data communication devices that transmit over the existing telephone network. DSL signals operate in the high frequency ranges, above the 3000Hz limit for voice conversations. In order to separate the DSL data signal from the regular voice signal, the signal must be sent into two different filters: a lowpass filter to amplify the voice for the telephone signal, and a highpass filter to amplify the DSL data signal.

## Bandpass

A bandpass filter allows a single band of frequency information to pass the filter, but will attenuate all frequencies above the band and below the band.
A good example of a bandpass filter is an FM radio tuner. In order to focus on one radio station, a filter must be used to attenuate the stations at both higher and lower frequencies.

## Bandstop

A bandstop filter will allow high frequencies and low frequencies to pass through the filter, but will attenuate all frequencies that lay within a certain band.

## Gain/Delay equalizers

Filters that cannot be classified into one of the above categories, are called gain or delay equalizers. They are mainly used to equalize the gain/phase in certain parts of the frequency spectrum as needed. More discussion on these kinds of advanced topics will be in Signal Processing.
Filter design mostly bases on a limited set of widely used transfer functions. Optimization methods allow to design other types of filters, but the functions listed here have been studied extensively, and designs for these filters (including circuit designs to implement them) are readily available. The filter functions presented here are of lowpass type, and transformation methods allow to obtain other common filter types such as highpass, bandpass or bandstop.

## Butterworth Filters

The Butterworth filter function has been designed to provide a maximally flat amplitude response. This is obtained by the fact that all the derivatives up to the filter order minus one are zero at DC. The amplitude response has no ripple in the passband. It is given by:
    $A(j\omega )=|H(j\omega )|={\sqrt {\frac {1}{1+\omega ^{2n}}}}$
It should be noted that whilst the amplitude response is very smooth, the step response shows noticeable overshoots. They are due to the phase response which is not linear or, in other words, to the group delay which is not constant.
The amplitude response plot shows that the slope is 20n dB/decade, where n is the filter order. This is the general case for all-pole lowpass filters. Zeros in the transfer function can accentuate the slope close to their frequency, thus masking this general rule for zero-pole lowpass filters.
The plot also shows that whatever the order of the filter, all the amplitudes cross the same point at $A(\omega =1)={\frac {1}{\sqrt {2}}}$, which corresponds to approximatively -3 db. This -3 db reference is often used to specify the cutoff frequency of other kinds of filters.
Butterworth filters don't have a particularly steep drop-off but, together with Chebyshev type I filters, they are of all-pole kind. This particularity results in reduced hardware (or software, depending on the implementation method), which means that for a similar complexity, higher order Butterworth filters can be implemented, compared to functions with a steeper drop-off such as elliptic filters.

### Zeroes of the Butterworth function

The normalized Butterworth function is indirectly defined by:
    $H(s)\cdot H(-s)={\frac {1}{1+\omega ^{2n}}}$
This functions has zeros regularly placed on the unit circle. Knowing that a stable filter has all of its poles on the left half s-plane, it is clear that the left half poles on the unit circle belong to $H(s)$, whilst the right half poles on the right belong to $H(-s)$.
The normalized Butterworth function has a cutoff frequency at $f_{c}=\omega _{c}/(2\pi )=1/(2\pi )[Hz]$. A different cutoff frequency is achieved by scaling the circle radius to $\omega _{c}=2\pi f_{c}$.

### Butterworth Transfer Function

The transfer function of a Butterworth filter is of the form:
    $H(s)={\frac {1}{den(s)}}$
It can also be written as a function of the poles:
    $H(s)={\frac {k}{\prod _{i=1}^{N}(s-p_{i})}}$
With this, the denominator ploynom is found from the values of the poles.

## Chebyshev Filters

In comparison to Butterworth filters, Chebyshev filters have a supplemental parameter: a ripple in amplitude. This ripple, which could be considered as non ideal, has the tremendous advantage to allow a steeper roll-off between passband and stopband.
The ripple can happen in the passband, which is the case for Type I Chebyshev filters, or in the stopband for Type II filters.

### Chebyshev Polynomials

Chebyshev Polynomials have the property to remain in the range $-1<T_{n}(x)<1$ for an input in the range −1 < x < 1 and then rapidly grow outside this range. This characteristic is a good prerequisite for devising transfer functions with limited oscillations in a given frequency range and steep roll-offs at its borders.
The Chebyshev polynomials of the first kind are defined by the recurrence relation:
    ${\begin{aligned}T_{0}(x)&=1\\T_{1}(x)&=x\\T_{n+1}(x)&=2x\cdot T_{n}(x)-T_{n-1}(x).\end{aligned}}$
The first Chebyshev polynomials of the first kind are:
    $T_{0}(x)=1$
    $T_{1}(x)=x$
    $T_{2}(x)=2x^{2}-1$
    $T_{3}(x)=4x^{3}-3x$
    $T_{4}(x)=8x^{4}-8x^{2}+1$

### Chebyshev Type I

Chebyshev type I filters show a ripple in the passband. The amplitude response as a function of angular frequency $\omega$ of the nth-order low-pass filter is:
    $G_{n}(\omega )=\left|H_{n}(j\omega )\right|={\frac {1}{\sqrt {1+\varepsilon ^{2}T_{n}^{2}\left({\frac {\omega }{\omega _{0}}}\right)}}}$
where $\varepsilon$ is the ripple factor, $\omega _{0}$ is the cutoff frequency and $T_{n}$ is a Chebyshev polynomial of order $n$.
The passband exhibits equiripple behavior, with the ripple determined by the ripple factor $\varepsilon$. In the passband, the Chebyshev polynomial alternates between 0 and 1 so the filter gain will alternate between maxima at G = 1 and minima at $G=1/{\sqrt {1+\varepsilon ^{2}}}$. At the cutoff frequency $\omega _{0}$ the gain again has the value $1/{\sqrt {1+\varepsilon ^{2}}}$ but continues to drop into the stop band as the frequency increases. This behavior is shown in the diagram on the right. The common practice of defining the cutoff frequency at −3 dB is usually not applied to Chebyshev filters; instead the cutoff is taken as the point at which the gain falls to the value of the ripple for the final time.

### Chebyshev Type II

Chebyshev Type II filters have ripples in the stopband. The amplitude response is:
    $G_{n}(\omega ,\omega _{0})={\frac {1}{\sqrt {1+{\frac {1}{\varepsilon ^{2}T_{n}^{2}\left(\omega _{0}/\omega \right)}}}}}.$
In the stopband, the gain will always be smaller than
    ${\frac {1}{\sqrt {1+{\frac {1}{\varepsilon ^{2}}}}}}$
Also known as inverse Chebyshev, this filter function is less common because it does not roll-off as fast as type I, and requires more components. Indeed, the transfer function exhibits not only poles but also zeros.

## Elliptic Filters

Elliptic filters, also called Cauer filters, suffer from a ripple effect like Chebyshev filters. However, unlike the type 1 and Type 2 Chebyshev filters, Elliptic filters have ripples in both the passband and the stopband. To counteract this limitation, Elliptic filters have a very aggressive rolloff, which often more than makes up for the ripples.

## Comparison

The following image shows a comparison between 5th order Butterworth, Chebyshev and elliptic filter amplitude responses.

## Filter Design

Using what we've learned so far about filters, this chapter will discuss filter design, and will show how to make decisions as to the type of filter (Butterworth, Chebyshev, Elliptic), and will help to show how to set parameters to achieve a set of specifications.

## Normalized Lowpass Filter

When designing a filter, it is common practice to first design a normalized low-pass filter, and then use a spectral transform to transform that low-pass filter into a different type of filter (high-pass, band-pass, band-stop).
The reason for this is because the necessary values for designing lowpass filters are extensively described and tabulated. From this, filter design can be reduced to the task of looking up the appropriate values in a table, and then transforming the filter to meet the specific needs.

## Lowpass to Lowpass Transformation

Converting a normalized lowpass filter to another lowpass filter allows to set the cutoff frequency of the resulting filter. This is also called frequency scaling.

### Transformation

Having a normalized transfer function, with cutoff frequency of 1 Hz, one can modify it in order to move the cutoff frequency to a specified value $f_{c}$.
This is done with the help of the following replacement:
    $s\to f_{c}\cdot s$

### Transfer Function

As an example, the biquadratic transfer function
    $H(s)={\frac {Y(s)}{X(s)}}={\frac {b_{2}s^{2}+b_{1}s+b_{0}}{a_{2}s^{2}+a_{1}s+a_{0}}}$
will be transformed into:
    $H(s)={\frac {Y(s)}{X(s)}}={\frac {b_{2}f_{c}^{2}s^{2}+b_{1}f_{c}s+b_{0}}{a_{2}f_{c}^{2}s^{2}+a_{1}f_{c}s+a_{0}}}$
In the transfer function, all coefficients are multiplied by the corresponding power of $f_{c}$.

### Analog Element Values

If the filter is given by a circuit and its R, L and C element values found in a table, the transfer function is scaled by changing the element values.
The resistance values will stay as they are (a further impedance scaling can be done).
The capacitance values are changed according to:
    ${\frac {1}{sC}}\to {\frac {1}{sf_{c}{\frac {C}{f_{c}}}}}$
The inductance values are changed according to:
    $sL\to sf_{c}{\frac {L}{f_{c}}}$
In the circuit, all capacitances and inductances values are divided by $f_{c}$.

## Lowpass to Highpass

Converting a lowpass filter to a highpass filter is one of the easiest transformations available. To transform to a highpass, we will replace all S in our equation with the following:
$S={\frac {\Omega _{p}{\hat {\Omega _{p}}}}{\hat {S}}}$

## Lowpass to Bandpass

To Convert from a low-pass filter to a bandpass filter requires that we replace S with the following:
$S=U*I/K$

## Lowpass to Bandstop

To convert a lowpass filter to a bandstop filter, we replace every reference to S with:
$S=$
The Laplace transform allows analyzing the frequency response of circuits based on the differential equations of their capacitive and inductive components. Filter design starts with finding the proper transfer function in order to amplify selected parts of a signal and to damp other ones as a function of their frequency.
Choosing the proper filter structure and deriving the coefficient values is a further topic prensented in the wikibook Signal Processing which deals with the application of signal and systems.

## Brick-wall filters

Separating signal from noise or different signals in the same transmission channel basing on their frequency content is best done with a brick-wall filter which shows full transmission in the passband and complete attenuation in the nearby stopbands, with abrupt transitions.
This can be done with the help of the Fourier transform which provides complete information of the frequency content of a given signal. Having calculated a Fourier transform, one can zero out unwanted frequency contents and calculate the inverse Fourier Transform, in order to provide the signal filtered with a brick-wall gauge.
The Fourier transform being given by:
    ${\mathcal {F}}(f(t))=F(j\omega )=\int _{-\infty }^{\infty }f(t)e^{-j\omega t}dt$
one finds out that the Fourier transform integral, with its infinite bounds, would have to be calculated from the day of the creation of our universe and all the way up to the day of its decay before the integral could have been fully calculated. And only then can the ideal brick-wall filtered signal be delivered.
In more technical terms, the ideal brick-wall filter suffers from an infinite latency.

## Analog filters

The analysis of analog circuits shows that their outputs are related to their input by a set of differential equations. The Laplace transform rewrites these differential equations as a set of linear equations of the complex variable $s$. With this, a polynomial function multiplying the Laplace transform of the input signal can be equated to another polynomial function multiplying the Laplace transform of the ouput signal:
    $(b_{m}s^{m}+b_{m-1}s^{m-1}+\ldots +b_{1}s+b_{0})\cdot X(s)=(a_{n}s^{n}+a_{n-1}s^{n-1}+\ldots +a_{1}s+a_{0})\cdot Y(s)$
Thus, the transfer function of a realizable analog filter can be written as the ratio of two polynomial functions of $s$:
    $H(s)={\frac {Y(s)}{X(s)}}={\frac {b_{m}s^{m}+b_{m-1}s^{m-1}+\ldots +b_{1}s+b_{0}}{a_{n}s^{n}+a_{n-1}s^{n-1}+\ldots +a_{1}s+a_{0}}}$
Hence, the problem of analog filter design is to find a pair of polynomial functions which, put together, best approximate the ideal but not realizable brick-wall transfer function.
In the early days of electric signal processing, scientists have come up with filter functions which are still largely used today. The functions they have devised are all of lowpass type. Frequency transformation techniques allow to find polynomials for other filter types such as highpass and bandpass.

## The Complex Plane

The transfer function of an analog filter is the ratio of two polynomial functions of $s$:
    $H(s)={\frac {Y(s)}{X(s)}}={\frac {num(s)}{den(s)}}$
The variable $s$ is a complex number which can be written as $s=\sigma +i\cdot \omega$. The complex plane is a plane with the imaginary axis vertical and the horizontal axis as the real part.
The roots of the transfer function numerator polynom are called the transfer function zeroes. The roots of the transfer function denominator polynom are called the transfer function poles.
The transfer function can be written as a function of its zeroes $z_{i}$, its poles $p_{i}$ and an additional gain factor $k$ in the form:
    $H(s)=k\cdot {\frac {\prod _{i=1}^{M}(s-z_{i})}{\prod _{i=1}^{N}(s-p_{i})}}$
The poles and the zeroes of a transfer function can be drawn in the complex plane. Their position provide information about the frequency response of the system. Indeed, the frequency response is equal to the transfer function taken for $s=i\omega$, which is along the imaginary axis.
    ${\frac {Y(i\omega )}{X(i\omega )}}=H(s=i\omega )$

### Effect of Poles

A stable LTI system has all its poles on the left side half plane of $s$.
If a pole would be located on the imaginary axis, at $p=i\omega _{p}$, then the factor $1/{(s-p)}$ of the transfer function would be infinite at the point $s=i\omega _{p}$ and so would the global frequency response $H(s=i\omega _{p})$. A special case of this is the integrator: it has a pole at $p=0$, and indeed has a long-term infinite output for a constant, non-zero, input.
For poles close to the imaginary axis, the frequency response takes a large amplitude for frequencies close to them. In other words, poles close to the imaginary axis indicate the passband.

### Effect of Zeros

If a zero is located on the imaginary axis, at $z=i\omega _{z}$, then the factor $(s-z)$ of the transfer function is zero at the point $s=i\omega _{z}$ and so is the global frequency response $H(s=i\omega _{z})$.
Zeroes on, or close to the imaginary axis indicate the stopband.

## Designing Filters

Devising the proper transfer function for a given filter function goes through the following steps:
* selecting a normalized filter function
* transforming and scaling the function for the particular needs
The coefficients of the numerator and denominator coefficients are finally used to calculate the element values of a selected filter circuit.

### Example: Lowpass Filter

A reduced version of CCITT G712 input filter specification, giving only the lowpass part, is shown in the plot on the side.
The passband goes up to $3kHz$ and allows a maximal ripple of $0.125dB$. The stopband requires an attenuation of $14dB$ at $4kHz$ and an attenuation of $32dB$ above $4.6kHz$.

#### Filter Function

As a first step, we have to choose a filter function.
Programs such as Octave or Matlab provide functions which allow to determine the minimal filter order required to fulfill a given specification. This is a good help when choosing from the possible functions.
Let's however here arbitrarily choose a Butterworth transfer function.

#### Normalized Filter Function

The following Octave script allows to plot the amplitudes of normalized Butterworth transfer functions from order 8 to 16.
The following figure shows the result: one needs at least a 13th order Butterworth filter to meet the specifications.
On the graph, one can note that all the amplitude responses go through the same point at -3 dB.
The specification frequencies have been scaled down to fit to the normalized cutoff frequency of 1 Hz. In the script, one might have noted an additional scaling factor of fc = 0.87: this is due to the fact that the corner cutoff amplitude is -0.125 dB and not -3 dB. That value has been adjusted by hand for this example. Again, Octave or Matlab scripts automate this task.

#### Denormalized Filter Function

The frequency scaling of the normalized transfer function is done by replacing
$s\to f_{c}\cdot s$
The following Octave script does this by multiplying the numerator and denominator coefficients by the appropriate power of $f_{c}$.
The coefficients of the numerator and denominator coefficients are now ready to be used to calculate the element values of a selected filter circuit.

# Introduction to Digital Signals
## Sampled Systems

Digital signals are by essence sampled signals. In a circuit node, the numbers change at a given rate: the sampling rate or sampling frequency. The time between two changes of the signal is the inverse of the sampling frequency: it is the sampling period.
In processor systems, samples are stored in memory. In logic circuits, they correspond to register outputs. The sampling period is used to compute the next value of all signals in the system.
Digital circuits are not the only sampled systems: analog circuits such as switched capacitor filters also rely on switches and are sampled too.

## Sampling a signal
### The Nyquist Rate

Sampling a signal raises a major question: does one lose information during this process?
On the other side, sampling the traffic lights once per microsecond doesn't bring much more information than sampling it every millisecond.
Obviously, the traffic lights, as any other signals, have to be sampled at a faster rate than they change, but sampling them very much faster doesn't bring more information.
The Nyquist rate is the minimum sampling rate required to avoid loss of information.
    $f_{N}\ {\stackrel {\mathrm {def} }{=}}\ 2f_{b}$
where $f_{b}$ is the highest frequency of the signal to be sampled, also called bandwidth.
To avoid losing information, the sampling rate must be higher than the Nyquist rate:
    $f_{s}>f_{N}$
In practice, the sampling rate is taken with some margin, in order to more easily reconstruct the original signal.
The full range of human hearing is between 20 Hz and 20 kHz. Thus, audio content has to be sampled at more than 40 kHz.
And indeed:
* CD audio samples the signals at 44.1 kHz.
* Professional digital video equipment samples them at 48 kHz.
* DVD audio samples them at 96 kHz.
* High end DVD audio doubles this frequency to 192 kHz.

### Aliasing

Sampling a signal with a rate lower than the Nyquist Rate produces aliasing or folding.
The picture on the right shows a red sinewave of frequency 0.9 (and thus of a period close to 1.1). This signal should be sampled with a frequency larger than 1.8. However, the signal has been sampled with a rate of 1 (vertical lines and black dots). If one tries to draw a line between the samples, the result will look like the blue curve which is a sinewave of period 10, or of frequency 0.1.
If the signal would have been sampled at a rate of 0.9, the sampling points would always fall on the same point in the sine function and the resulting signal would seem to be a constant.
Sampling a signal of frequency 0.9 with a rate of 1 creates an alias with the frequency of $1-0.9=0.1$.
Sampling a signal of frequency 0.9 with a rate of 0.9 creates an alias at DC, and so with the frequency of $0.9-0.9=0$.
Sampling a signal of frequency 0.9 with a rate of 0.8 also creates an alias with the frequency of $0.9-0.8=0.1$, but with a different phase.
Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 100 Hz gives us the impression that is it turning at 100 Hz - 90 Hz = 10 Hz.
Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 90 Hz gives us the impression that is it standing still.
Illuminating a motor turning at a frequency of 90 Hz with a stroboscope switching at 80 Hz gives us the impression that is it turning at 90 Hz - 80 Hz = 10 Hz, but in the opposite direction.
This is the same effect seen in many American Western movies containing stagecoach scenes. At various rotational rates, the wheels on the stagecoach will appear to rotate forward, stand still, or rotate backward. See Wagon-wheel effect.
It is as if the spectrum of the signal has been folded back down at a point equal to half the sampling frequency.

### Undersampling

Sampling a frequency lower than the Nyquist rate, also called undersampling, creates sinewave aliases at a lower frequency. If the original signal also has content at these lower frequencies, then they will be mixed and there is a loss of information.
However, if the signal has only high-frequency content, then the undersampling process modulates the signal at a lower frequency.
This is a cheap alternative to modulating by the multiplication with a modulation sinewave.

### Oversampling

Oversampling corresponds to sampling with a frequency much higher (typically 100 to 1000) than the Nyquist rate. The interest of oversampling is to be able to represent the signal with a smaller amount of bits.
This can be explained by the mechanism used to gain the additional bits back: a signal sampled at 10 kHz can be downsampled at 5 kHz as long as the new sampling frequency remains greater than the Nyquist frequency. The downsampling implies having two times fewer samples. Rather than throwing every second sample away, one can calculate the mean value of two consecutive samples and use this result to build one sample of the new signal. Calculating the mean value corresponds to add the values and divide them by two. Rather than dividing the result by two and throwing away the bit after the decimal point, one can only add the consecutive samples two by two. With this, the amplitude of the 5 kHz signal is twice the one of the original 10 kHz signal. In other words, it has to be represented by 1 more bits.
A largely used application of oversampling is Pulse Width Modulation (PWM). The modulated signal is represented with a single bit switching at a frequency equal to ${2^{n}}\cdot f_{N}$, where $f_{N}$ is the Nyquist frequency of the original signal and $n$ the number of bits with which it is represented. This one bit signal is ideal to drive high-current loads with a single power switch. PWM is typically used for driving electric motors.
A more complex coding scheme for a result on a single bit is found in every CD player: sigma-delta modulation. There is more theory required for understanding its working. Let us state that it is able to represent a signal on a single bit at a lower sampling frequency than the PWM. On the other hand, the one bit signal switches back and forth more frequently at its sampling frequency and is thus less indicated for driving slower high-current switches. Sigma-delta modulation is used for driving lighter loads such as the cable between the CD player and the audio amplifier.
The SACD codes the audio in the form of a Direct Stream Digital signal coded on a single bit at 64 times the CD sampling rate of 44.1 kHz.

## Z Transform

The Z Transform is used to represent sampled signals and Linear Time Invariant (LTI) systems, such as filters, in a way similar to the Laplace transform representing continuous-time signals.

### Signal representation

The Z Transform is used to represent sampled signals in a way similar to the Laplace transform representing continuous-time signals.
A sampled signal is given by the sum of its samples, each one delayed by a different multiple of the sampling period. The Laplace transform represents a delay of one sampling period $T_{s}$ by:
    $z^{-1}{\stackrel {\mathrm {def} }{=}}e^{-sT_{s}}$
With this, the Z-transform can be represented as
    $X(z)={\mathcal {Z}}\{x[n]\}=\sum _{n=0}^{\infty }x[n]z^{-n}$
where the $x[n]$ are the consecutive values of the sampled signal.

### Linear time invariant systems

Continuous-time Linear Time Invariant (LTI) systems can be represented by a transfer function which is a fraction of two polynomials of the complex variable $s$.
    $H(s)={\frac {num(s)}{den(s)}}$
Their frequency response is estimated by taking $s=j\omega$, this is by estimating the transfer function along the imaginary axis.
In order to ensure stability, the poles of the transfer function (the roots of the denominator polynomial) must be on the left half plane of $s$.
Discrete-time LTI systems can be represented by the fraction of two polynomials of the complex variable $z$:
    $H(z)={\frac {num(z)}{den(z)}}$
From the definition:
    $z{\stackrel {\mathrm {def} }{=}}e^{sT_{s}}$
we find that their frequency response can be estimated by taking $z=e^{j\omega T_{s}}$, this is by estimating the transfer function around the unit circle.
In order to ensure stability, the poles of the transfer function (the roots of the denominator polynomial) must be inside the unit circle.

### Transfer function periodicity

The transfer function is estimated around the unit circle:
* The point at coordinate $z=1+j0$ corresponds to frequency $f=0$, which is DC.
* The point at coordinate $z=0+j1$ corresponds to frequency $f=f_{s}/4$, the quarter of the sampling frequency.
* The point at coordinate $z=-1+j0$ corresponds to frequency $f=f_{s}/2$, half the sampling frequency.
* The point at coordinate $z=0-j1$ corresponds to frequency $f=3f_{s}/4$.
* The point at coordinate $z=1+j0$ corresponds to frequency $f=f_{s}$ which is the sampling frequency.
So having turned once around the unit circle, one falls back to the starting point $z=1+j0$. From there, one can make another turn from $f_{s}$ to $2f_{s}$, and one more from $2f_{s}$ to $3f_{s}$ and so on... On each of these turns, the frequency response will be the same. In other words, the transfer function of a sampled system is periodic of period equal to the sampling frequency.
With real (as opposed to complex) signals, the transfer function is symmetric around half the sampling frequency: $f=f_{s}/2$. So the transfer function of a sampled system is usually only considered between $f=0$ and $f=f_{s}/2$.

# Appendices
## Fourier Transform

    $F(j\omega )={\mathcal {F}}\left\{f(t)\right\}=\int _{-\infty }^{\infty }f(t)e^{-j\omega t}dt$

## Inverse Fourier Transform

    ${\mathcal {F}}^{-1}\left\{F(j\omega )\right\}=f(t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }F(j\omega )e^{j\omega t}d\omega$

## Table of Fourier Transforms

This table contains some of the most commonly encountered Fourier transforms.
| | Time Domain | Frequency Domain |
| | $x(t)={\mathcal {F}}^{-1}\left\{X(\omega )\right\}$ | $X(\omega )={\mathcal {F}}\left\{x(t)\right\}$ |
| 1 | $X(j\omega )=\int _{-\infty }^{\infty }x(t)e^{-j\omega t}dt$ | $x(t)={\frac {1}{2\pi }}\int _{-\infty }^{\infty }X(\omega )e^{j\omega t}d\omega$ |
| 2 | $1\,$ | $2\pi \delta (\omega )\,$ |
| 3 | $-0.5+u(t)\,$ | ${\frac {1}{j\omega }}\,$ |
| 4 | $\delta (t)\,$ | $1\,$ |
| 5 | $\delta (t-c)\,$ | $e^{-j\omega c}\,$ |
| 6 | $u(t)\,$ | $\pi \delta (\omega )+{\frac {1}{j\omega }}\,$ |
| 7 | $e^{-bt}u(t)\,(b>0)$ | ${\frac {1}{j\omega +b}}\,$ |
| 8 | $\cos \omega _{0}t\,$ | $\pi \left[\delta (\omega +\omega _{0})+\delta (\omega -\omega _{0})\right]\,$ |
| 9 | $\cos(\omega _{0}t+\theta )\,$ | $\pi \left[e^{-j\theta }\delta (\omega +\omega _{0})+e^{j\theta }\delta (\omega -\omega _{0})\right]\,$ |
| 10 | $\sin \omega _{0}t\,$ | $j\pi \left[\delta (\omega +\omega _{0})-\delta (\omega -\omega _{0})\right]\,$ |
| 11 | $\sin(\omega _{0}t+\theta )\,$ | $j\pi \left[e^{-j\theta }\delta (\omega +\omega _{0})-e^{j\theta }\delta (\omega -\omega _{0})\right]\,$ |
| 12 | ${\mbox{rect}}\left({\frac {t}{\tau }}\right)\,$ | $\tau {\mbox{sinc}}\left({\frac {\tau \omega }{2\pi }}\right)\,$ |
| 13 | $\tau {\mbox{sinc}}\left({\frac {\tau t}{2\pi }}\right)\,$ | $2\pi {\mbox{rect}}\left({\frac {\omega }{\tau }}\right)\,$ |
| 14 | $\left(1-{\frac {2|t|}{\tau }}\right){\mbox{rect}}\left({\frac {t}{\tau }}\right)\,$ | ${\frac {\tau }{2}}{\mbox{sinc}}^{2}\left({\frac {\tau \omega }{4\pi }}\right)\,$ |
| 15 | ${\frac {\tau }{2}}{\mbox{sinc}}^{2}\left({\frac {\tau t}{4\pi }}\right)\,$ | $2\pi \left(1-{\frac {2|\omega |}{\tau }}\right){\mbox{rect}}\left({\frac {\omega }{\tau }}\right)\,$ |
| 16 | $e^{-a|t|},\Re \{a\}>0\,$ | ${\frac {2a}{a^{2}+\omega ^{2}}}\,$ |
| Notes: | ${\mbox{sinc}}(x)=\sin(\pi x)/(\pi x)$ ${\mbox{rect}}\left({\frac {t}{\tau }}\right)$ is the rectangular pulse function of width $\tau$ $u(t)$ is the Heaviside step function $\delta (t)$ is the Dirac delta function | ${\mbox{sinc}}(x)=\sin(\pi x)/(\pi x)$ ${\mbox{rect}}\left({\frac {t}{\tau }}\right)$ is the rectangular pulse function of width $\tau$ $u(t)$ is the Heaviside step function $\delta (t)$ is the Dirac delta function |
| This box: view • talk • |||

## Laplace Transform

    $F(s)={\mathcal {L}}\left\{f(t)\right\}=\int _{0^{-}}^{\infty }e^{-st}f(t)\,dt.$

## Inverse Laplace Transform

    ${\mathcal {L}}^{-1}\left\{F(s)\right\}={1 \over {2\pi i}}\int _{c-i\infty }^{c+i\infty }e^{ft}F(s)\,ds=f(t)$

## Laplace Transform Properties

| Property | Definition |
| Linearity | ${\mathcal {L}}\left\{af(t)+bg(t)\right\}=aF(s)+bG(s)$ |
| Differentiation | ${\mathcal {L}}\{f'\}=s{\mathcal {L}}\{f\}-f(0^{-})$ ${\mathcal {L}}\{f''\}=s^{2}{\mathcal {L}}\{f\}-sf(0^{-})-f'(0^{-})$ ${\mathcal {L}}\left\{f^{(n)}\right\}=s^{n}{\mathcal {L}}\{f\}-s^{n-1}f(0^{-})-\cdots -f^{(n-1)}(0^{-})$ |
| Frequency Division | ${\mathcal {L}}\{tf(t)\}=-F'(s)$ ${\mathcal {L}}\{t^{n}f(t)\}=(-1)^{n}F^{(n)}(s)$ |
| Frequency Integration | ${\mathcal {L}}\left\{{\frac {f(t)}{t}}\right\}=\int _{s}^{\infty }F(\sigma )\,d\sigma$ |
| Time Integration | ${\mathcal {L}}\left\{\int _{0}^{t}f(\tau )\,d\tau \right\}={\mathcal {L}}\left\{u(t)*f(t)\right\}={1 \over s}F(s)$ |
| Scaling | ${\mathcal {L}}\left\{f(at)\right\}={1 \over a}F\left({s \over a}\right)$ |
| Initial value theorem | $f(0^{+})=\lim _{s\to \infty }{sF(s)}$ |
| Final value theorem | $f(\infty )=\lim _{s\to 0}{sF(s)}$ |
| Frequency Shifts | ${\mathcal {L}}\left\{e^{at}f(t)\right\}=F(s-a)$ ${\mathcal {L}}^{-1}\left\{F(s-a)\right\}=e^{at}f(t)$ |
| Time Shifts | ${\mathcal {L}}\left\{f(t-a)u(t-a)\right\}=e^{-as}F(s)$ ${\mathcal {L}}^{-1}\left\{e^{-as}F(s)\right\}=f(t-a)u(t-a)$ |
| Convolution Theorem | ${\mathcal {L}}\{f(t)*g(t)\}=F(s)G(s)$ |
Where:
    $f(t)={\mathcal {L}}^{-1}\{F(s)\}$
    $g(t)={\mathcal {L}}^{-1}\{G(s)\}$
    $s=\sigma +j\omega$

## Table of Laplace Transforms

| No. | Time Domain $x(t)={\mathcal {L}}^{-1}\left\{X(s)\right\}$ | Laplace Domain $X(s)={\mathcal {L}}\left\{x(t)\right\}$ |
| 1 | ${\frac {1}{2\pi j}}\int _{\sigma -j\infty }^{\sigma +j\infty }X(s)e^{st}ds$ | $\int _{-\infty }^{\infty }x(t)e^{-st}dt$ |
| 2 | $\delta (t)\,$ | $1\,$ |
| 3 | $\delta (t-a)\,$ | $e^{-as}\,$ |
| 4 | $u(t)\,$ | ${\frac {1}{s}}$ |
| 5 | $u(t-a)\,$ | ${\frac {e^{-as}}{s}}$ |
| 6 | $tu(t)\,$ | ${\frac {1}{s^{2}}}$ |
| 7 | $t^{n}u(t)\,$ | ${\frac {n!}{s^{n+1}}}$ |
| 8 | ${\frac {1}{\sqrt {\pi t}}}u(t)$ | ${\frac {1}{\sqrt {s}}}$ |
| 9 | $e^{at}u(t)\,$ | ${\frac {1}{s-a}}$ |
| 10 | $t^{n}e^{at}u(t)\,$ | ${\frac {n!}{(s-a)^{n+1}}}$ |
| 11 | $\cos(\omega t)u(t)\,$ | ${\frac {s}{s^{2}+\omega ^{2}}}$ |
| 12 | $\sin(\omega t)u(t)\,$ | ${\frac {\omega }{s^{2}+\omega ^{2}}}$ |
| 13 | $\cosh(\omega t)u(t)\,$ | ${\frac {s}{s^{2}-\omega ^{2}}}$ |
| 14 | $\sinh(\omega t)u(t)\,$ | ${\frac {\omega }{s^{2}-\omega ^{2}}}$ |
| 15 | $e^{at}\cos(\omega t)u(t)\,$ | ${\frac {s-a}{(s-a)^{2}+\omega ^{2}}}$ |
| 16 | $e^{at}\sin(\omega t)u(t)\,$ | ${\frac {\omega }{(s-a)^{2}+\omega ^{2}}}$ |
| 17 | ${\frac {1}{2\omega ^{3}}}(\sin \omega t-\omega t\cos \omega t)$ | ${\frac {1}{(s^{2}+\omega ^{2})^{2}}}$ |
| 18 | ${\frac {t}{2\omega }}\sin \omega t$ | ${\frac {s}{(s^{2}+\omega ^{2})^{2}}}$ |
| 19 | ${\frac {1}{2\omega }}(\sin \omega t+\omega t\cos \omega t)$ | ${\frac {s^{2}}{(s^{2}+\omega ^{2})^{2}}}$ |

## Useful Mathematical Identities

| $\sin ^{2}\theta +\cos ^{2}\theta =1$ | $1+\tan ^{2}\theta =\sec ^{2}\theta$ |
| $\sin \left({\frac {\pi }{2}}-\theta \right)=\cos \theta$ | $\cos \left({\frac {\pi }{2}}-\theta \right)=\sin \theta$ |
| $\sec \left({\frac {\pi }{2}}-\theta \right)=\csc \theta$ | $\csc \left({\frac {\pi }{2}}-\theta \right)=\sec \theta$ |
| $\sin \left(-\theta \right)=-\sin \theta$ | $\cos \left(-\theta \right)=\cos \theta$ |
| $\sin 2\theta =2\sin \theta \cos \theta$ | $\cos 2\theta =\cos ^{2}-\sin ^{2}=2\cos ^{2}\theta -1=1-2\sin ^{2}\theta$ |
| $\sin ^{2}\theta ={\frac {1-\cos 2\theta }{2}}$ | $\cos ^{2}\theta ={\frac {1+\cos 2\theta }{2}}$ |
| $\sin \alpha +\sin \beta =2\sin \left({\frac {\alpha +\beta }{2}}\right)\cos \left({\frac {\alpha -\beta }{2}}\right)$ | $\sin \alpha -\sin \beta =2\cos \left({\frac {\alpha +\beta }{2}}\right)\sin \left({\frac {\alpha -\beta }{2}}\right)$ |
| $\cos \alpha +\cos \beta =2\cos \left({\frac {\alpha +\beta }{2}}\right)\cos \left({\frac {\alpha -\beta }{2}}\right)$ | $\cos \alpha -\cos \beta =-2\sin \left({\frac {\alpha +\beta }{2}}\right)\sin \left({\frac {\alpha -\beta }{2}}\right)$ |
| $\sin \alpha \sin \beta ={\frac {1}{2}}\left[\cos \left(\alpha -\beta \right)-\cos \left(\alpha +\beta \right)\right]$ | $\cos \alpha \cos \beta ={\frac {1}{2}}\left[\cos \left(\alpha -\beta \right)+\cos \left(\alpha +\beta \right)\right]$ |
| $\sin \alpha \cos \beta ={\frac {1}{2}}\left[\sin \left(\alpha +\beta \right)+\sin \left(\alpha -\beta \right)\right]$ | $1+\cot ^{2}=\csc ^{2}$ |
| $e^{j\theta }=\cos \theta +j\sin \theta$ | $\cos \theta ={\frac {e^{j\theta }+e^{-j\theta }}{2}}$ |
| $e^{-j\theta }=\cos \theta -j\sin \theta$ | $\sin \theta ={\frac {e^{j\theta }-e^{-j\theta }}{2j}}$ |
| $\tan \left({\frac {\pi }{2}}-\theta \right)=\cot \theta$ | $\cot \left({\frac {\pi }{2}}-\theta \right)=\tan \theta$ |
| $\tan(-\theta )=-\tan \theta$ | |
| $\tan ^{2}\theta ={\frac {1-\cos 2\theta }{1+\cos 2\theta }}$ | $\tan 2\theta ={\frac {2\tan \theta }{1-\tan ^{2}\theta }}$ |