Frequency-dependent input signals
From the previous module on FIR filters, we have seen that the output $y[n]$ of a system with impulse response $h[n]$ driven by an input signal $x[n]$ can be determined using the convolution operator $\ast$ as \begin{equation}\label{eq:outputconv} y[n] = x[n] \ast h[n] = h[n] \ast x[n] = \sum_{k=-\infty}^\infty h[k]x[n-k], \end{equation} where the convolution operator denotes the infinite sum of delayed input samples $x[n-k]$ weighted by the impulse response values $h[k]$.
In practice most signals contain multiple sinusoidal signals with different frequencies. A thorough understanding of the operations of a filter can be obtained by evaluating the output of a filter when applying a sinusoidal signal with arbitrary frequency. Suppose the input signal resembles a phasor with relative frequency $\theta$ as $x[n] = \mathrm{e}^{jn\theta}$. Using \eqref{eq:outputconv}, the output of a filter with impulse response $h[n]$ when driven by a phasor can be determined as \begin{equation} \begin{split} y[n] &= \sum_{k=-\infty}^\infty h[k]x[n-k] \newline &= \sum_{k=-\infty}^\infty h[k]\mathrm{e}^{j(n-k)\theta} \newline &= \left( \sum_{k=-\infty}^\infty h[k]\mathrm{e}^{-jk\theta} \right) \ \mathrm{e}^{jn\theta} \newline &= H(\mathrm{e}^{j\theta}) \mathrm{e}^{jn\theta}. \end{split}\label{eq:outputphasor} \end{equation} The impact and consequences of this derivation are the main learning goal of this entire module. So, what have we shown? If an LTI system with impulse response $h[n]$ is driven by a phasor with relative frequency $\theta$, the output is a weighted version of the input signal. This weight is denoted in \eqref{eq:outputphasor} by the so-called frequency response $H(\mathrm{e}^{j\theta})$. This complex weight is frequency dependent and therefore different frequencies are affected to a different extent. The linearity property of LTI systems allows for simple calculations of the filter output when dealing with sums of sinusoidal signals with different frequencies.
Frequency response using the FTD
From its definition in \eqref{eq:outputphasor} the frequency response is defined as \begin{equation}\label{eq:FTDhH} H(\mathrm{e}^{j\theta}) = \sum_{n=-\infty}^\infty h[n] \mathrm{e}^{-jn\theta}. \end{equation} By comparison with the Fourier transform for discrete-time systems (FTD), we can concluded that the frequency response is the FTD pair of the impulse response. Similarly, we can conclude that the impulse response is then the IFTD pair of the frequency response as \begin{equation}\label{eq:IFTDHh} h[n] = \frac{1}{2\pi}\int_{-\pi}^\pi H(\mathrm{e}^{j\theta})\mathrm{e}^{jn\theta} \mathrm{d}\theta. \end{equation}
Properties
The frequency response $H(\mathrm{e}^{j\theta})$ has interesting properties that often can be used to simplify analysis. This subsection will describe the most important properties of the frequency response to allow for easy calculations.
Complex-valued
Since the frequency response $H(\mathrm{e}^{j\theta})$ is the FTD pair of the impulse response, it is at the same time complex-valued. In polar notation the frequency response can be written as \begin{equation} \label{eq:propcomplex} H(\mathrm{e}^{j\theta}) = \vert H(\mathrm{e}^{j\theta}) \vert \mathrm{e}^{j\angle H(\mathrm{e}^{j\theta})}, \end{equation} where $\vert H(\mathrm{e}^{j\theta}) \vert$ represents the amplitude of the frequency response and is commonly known as the magnitude response. Furthermore, $\angle H(\mathrm{e}^{j\theta})$ represents the phase angle of the frequency response, which is commonly known as the phase response.
Periodicity
The frequency response is periodic over $\theta$ with period $2\pi$ as \begin{equation} H(\mathrm{e}^{j\theta}) = H(\mathrm{e}^{j(\theta+k\cdot 2\pi)}), \end{equation} where $k$ is an integer. The periodicity in the frequency response is caused by the periodicity of the phasor $\mathrm{e}^{j\theta}$, since $\mathrm{e}^{j(\theta+k\cdot 2\pi)} = \mathrm{e}^{j\theta}(\mathrm{e}^{j2\pi})^k = \mathrm{e}^{j\theta}\cdot 1^k = \mathrm{e}^{j\theta}$.
Conjugate symmetry
In the case that the impulse response $h[n]$ is real valued, the frequency response is a complex conjugated function of its relative frequency as \begin{equation} H(\mathrm{e}^{-j\theta}) = H^\ast (\mathrm{e}^{j\theta}). \end{equation} This implies that the magnitude of the frequency response is an even function, i.e. $\vert H(\mathrm{e}^{j\theta}) \vert = \vert H(\mathrm{e}^{-j\theta}) \vert$ , and its phase is an odd function of frequency $\angle H(\mathrm{e}^{j\theta}) = - \angle H(\mathrm{e}^{-j\theta})$.
Convolution
Similar as in the module on the FTD, convolution in the time-domain can be performed as a multiplication in the frequency domain as \begin{equation}\label{eq:convprop} y[n] = x[n] \ast h[n] \qquad \circ \hspace{-1.7mm} - \hspace{-1.7mm} \circ \qquad Y(\mathrm{e}^{j\theta}) = X(\mathrm{e}^{j\theta}) \cdot H(\mathrm{e}^{j\theta}). \end{equation}
The first step of the proof is to use the expression for the convolution sum between $x[n]$ and $h[n]$: \begin{equation} \mathcal{F} \left\{ x[n] \ast h[n] \right\} = \sum_{n=-\infty}^{\infty} \left( \sum_{p=-\infty}^{\infty} x[p] h[n-p] \right) \mathrm{e}^{-jn \theta} \end{equation} Then we can interchange the two summations and multiply in the first summation the samples $x[p]$ with $\mathrm{e}^{-jp \theta}$, which has to be compensated in the second summation by $\mathrm{e}^{jp \theta}$: \begin{equation} \mathcal{F} \left\{ x[n] \ast h[n] \right\} = \sum_{p=-\infty}^{\infty} x[p] \mathrm{e}^{-jp \theta} \cdot \left( \sum_{n=-\infty}^{\infty}h[n-p] \mathrm{e}^{-j(n-p) \theta} \right) \end{equation} As a final step we substitute a new variable $m=n-p$ and since both variables $n$ and $p$ range from minus to plus infinity, this implies that the new variable also ranges from minus to plus infinity: \begin{equation} \mathcal{F} \left\{ x[n] \ast h[n] \right\} \overset{m= n-p}{=} \sum_{p=-\infty}^{\infty} x[p] \mathrm{e}^{-jp \theta} \cdot \left( \sum_{m=-\infty}^{\infty}h[m] \mathrm{e}^{-jm \theta} \right) = X(\mathrm{e}^{j\theta}) \cdot H(\mathrm{e}^{j\theta}) \end{equation} which finalizes the proof.
Frequency response from impulse response
The frequency response can be determined easily from the impulse response from the definition of \eqref{eq:FTDhH}. This approach will be explained through the following example.
Example
For the system with impulse response \begin{equation} h[n] = \delta[n-1] + \delta[n-2] + \delta[n-3], \end{equation} determine the analytical expression of the frequency response and draw the corresponding magnitude and phase plots.
Frequency response from the difference equation
Another way of calculating the frequency response is through the use of the difference equation. This method turns out to be particularly useful when dealing with IIR systems. This approach will be explained through the following example.
Example
Calculate the frequency response of a first-order auto-regressive filter with difference equation \begin{equation} y[n] = x[n] + \alpha y[n-1], \end{equation} where $\vert \alpha \vert < 1$ and $y[n] = 0$ for $n<0$.
The frequency response can be determined from the difference equation by first calculating the FTD of both the left and right side of the difference equation by making use of the shift property of the FTD. This leads to \begin{equation} Y(\mathrm{e}^{j\theta}) = X(\mathrm{e}^{j\theta}) + \alpha Y(\mathrm{e}^{j\theta}) e^{-j\theta}. \end{equation} The frequency response can be determined by first rearranging the terms, such that terms $X(\mathrm{e}^{j\theta})$ and $Y(\mathrm{e}^{j\theta})$ are both on the opposite side of the equality sign as \begin{equation} Y(\mathrm{e}^{j\theta})(1-\alpha \mathrm{e}^{-j\theta}) = X(\mathrm{e}^{j\theta}). \end{equation} Using \eqref{eq:convprop}, the frequency response can then be determined as \begin{equation}\label{eq:example:alpha} H(\mathrm{e}^{j\theta}) = \frac{Y(\mathrm{e}^{j\theta})}{X(\mathrm{e}^{j\theta})} = \frac{1}{1-\alpha \mathrm{e}^{-j\theta}}. \end{equation} The figure below shows several magnitude and frequency responses for different values of $\alpha$.
Impulse response from difference equation
Through the use of the FTD pairs and the convolution property, the impulse response can be modelled from the input and output signal. Instead of directly trying to solve \begin{equation} y[n] = x[n] \ast h[n] \end{equation} for $h[n]$, the problem is transformed to the frequency domain for easier analysis. This procedure is as follows. The difference equatio can be transformed to the frequency domain through the FTD, under the assumption that the initial conditions are zero. Here the shift-property of the FTD is crucial. By calculating the FTD of both sides of the difference equation, the following equality \begin{equation} Y(\mathrm{e}^{j\theta}) = \sum_{k=0}^{M-1} b_k X(\mathrm{e}^{j\theta})e^{-jk\theta} + \sum_{k=1}^{N-1} a_k Y(\mathrm{e}^{j\theta})e^{-jk\theta} \end{equation} is obtained. By rearranging the term we obtain \begin{equation} Y(\mathrm{e}^{j\theta}) \left(1-\sum_{k=1}^{N-1}a_k \mathrm{e}^{-jk\theta}\right) = X(\mathrm{e}^{j\theta})\left(\sum_{k=0}^{M-1}b_k \mathrm{e}^{-jk\theta}\right). \end{equation} By using the convolution property from \eqref{eq:convprop}, the frequency response can be determined as \begin{equation} H(\mathrm{e}^{j\theta}) = \frac{Y(\mathrm{e}^{j\theta})}{X(\mathrm{e}^{j\theta})} = \frac{\sum_{k=0}^{M-1}b_k \mathrm{e}^{-jk\theta}}{1-\sum_{k=1}^{N-1}a_k\mathrm{e}^{-jk\theta}} = \frac{B(\mathrm{e}^{j\theta})}{A(\mathrm{e}^{j\theta})}. \end{equation} Finally, through \eqref{eq:IFTDHh} the impulse response can be determined as the IFTD from $H(\mathrm{e}^{j\theta})$.