# Signals and Systems/Frequency Response
## 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.