Vinay K. Ingle, John G. Proakis
Chapter 3
THE DISCRETE-TIME FOURIER ANALYSIS - all with Video Answers
Educators
Chapter Questions
Using the matrix-vector multiplication approach discussed in this chapter, write a MATLAB function to compute the DTFT of a finite-duration sequence. The format of the function should be
```
function [X] = dtft(x,n,w)
% Computes Discrete-time Fourier Transform
% [X] = dtft (x,n,w)
% X = DTFT values computed at w frequencies
% x = finite duration sequence over n
% n}=\mathrm{ sample position vector
% w = frequency location vector
```
Use this function to compute the DTFT $X\left(e^{j \omega}\right)$ of the following finite-duration sequences over $-\pi \leq \omega \leq \pi$. Plot DTFT magnitude and angle graphs in one figure window.
1. $x(n)=(0.6)^{|n|}[u(n+10)-u(n-11)]$. Comment on the angle plot.
2. $x(n)=n(0.9)^n[u(n)-u(n-21)]$.
3. $x(n)=[\cos (0.5 \pi n)+j \sin (0.5 \pi n)][u(n)-u(n-51)]$. Comment on the magnitude plot.
4. $x(n)=\{4,3,2,1,1,2,3,4\}$. Comment on the angle plot.
5. $x(n)=\{4,3,2,1,-1,-2,-3,-4\}$. Comment on the angle plot.
Check back soon!
Let $x_1(n)=\{1,2,2,1\}$. A new sequence $x_2(n)$ is formed using
$$
x_2(n)= \begin{cases}x_1(n), & 0 \leq n \leq 3 ; \\ x_1(n-4), & 4 \leq n \leq 7 ; \\ 0, & \text { Otherwise. }\end{cases}
$$
1. Express $X_2\left(e^{j \omega}\right)$ in terms of $X_1\left(e^{j \omega}\right)$ without explicitly computing $X_1\left(e^{j \omega}\right)$.
2. Verify your result using MATLAB by computing and plotting magnitudes of the respective DTFTs.
Check back soon!
Determine analytically the DTFT of each of the following sequences. Plot the magnitude and angle of $X\left(e^{j \omega}\right)$ over $0 \leq \omega \leq \pi$.
1. $x(n)=2(0.5)^n u(n+2)$.
2. $x(n)=(0.6)^{|n|}[u(n+10)-u(n-11)]$.
3. $x(n)=n(0.9)^n u(n+3)$.
4. $x(n)=(n+3)(0.8)^{n-1} u(n-2)$.
5. $x(n)=4(-0.7)^n \cos (0.25 \pi n) u(n)$.
Check back soon!
The following finite-duration sequences are called windows and are very useful in DSP.
$$
\begin{aligned}
\text { Rectangular: } \mathcal{R}_M(n) & = \begin{cases}1,0 \leq n<M \\
0, & \text { otherwise }\end{cases} \\
\text { Hanning: } \mathcal{C}_M(n) & =0.5\left[1-\cos \frac{2 \pi n}{M-1}\right] \mathcal{R}_M(n) \\
\text { Triangular: } \mathcal{T}_M(n) & =\left[1-\frac{|M-1-2 n|}{M-1}\right] \mathcal{R}_M(n) ; \\
\text { Hamming: } \mathcal{H}_M(n) & =\left[0.54-0.46 \cos \frac{2 \pi n}{M-1}\right] \mathcal{R}_M(n)
\end{aligned}
$$
For each of these windows, determine their DTFTs for $M=10,25,50,101$. Scale transform values so that the maximum value is equal to 1 . Plot the magnitude of the normalized DTFT over $-\pi \leq \omega \leq \pi$. Study these plots and comment on their behavior as a function of $M$.
Check back soon!
Using the definition of the DTFT in (3.1), determine the sequences corresponding to the following DTFTs:
1. $X\left(e^{j \omega}\right)=3+2 \cos (\omega)+4 \cos (2 \omega)$.
2. $X\left(e^{j \omega}\right)=[1-6 \cos (3 \omega)+8 \cos (5 \omega)] e^{-\jmath 3 \omega}$.
3. $X\left(e^{j \omega}\right)=2+j 4 \sin (2 \omega)-5 \cos (4 \omega)$.
4. $X\left(e^{j \omega}\right)=[1+2 \cos (\omega)+3 \cos (2 \omega)] \cos (\omega / 2) e^{-j 5 \omega / 2}$.
5. $X\left(e^{j \omega}\right)=j[3+2 \cos (\omega)+4 \cos (2 \omega)] \sin (\omega) e^{-j 3 \omega}$.
Check back soon!
Using the definition of the inverse DTFT in (3.2), determine the sequences corresponding to the following DTFTs:
1. $X\left(e^{j \omega}\right)= \begin{cases}1, & 0 \leq|\omega| \leq \pi / 3 \\ 0, & \pi / 3<|\omega| \leq \pi\end{cases}$
2. $X\left(e^{j \omega}\right)= \begin{cases}0, & 0 \leq|\omega| \leq 3 \pi / 4 ; \\ 1, & 3 \pi / 4<|\omega| \leq \pi\end{cases}$
3. $X\left(e^{j \omega}\right)= \begin{cases}2, & 0 \leq|\omega| \leq \pi / 8 ; \\ 1, & \pi / 8<|\omega| \leq 3 \pi / 4 . \\ 0, & 3 \pi / 4<|\omega| \leq \pi .\end{cases}$
4. $X\left(e^{j \omega}\right)= \begin{cases}0, & -\pi \leq|\omega|<\pi / 4 ; \\ 1, & \pi / 4 \leq|\omega| \leq 3 \pi / 4 . \\ 0, & 3 \pi / 4<|\omega| \leq \pi .\end{cases}$
5. $X\left(e^{j \omega}\right)=\omega e^{j(\pi / 2-10 \omega)}$.
Remember that the above transforms are periodic in $\omega$ with period equal to $2 \pi$. Hence, functions are given only over the primary period of $-\pi \leq \omega \leq \pi$.
Check back soon!
A complex-valued sequence $x(n)$ can be decomposed into a conjugate symmetric part $x_e(n)$ and an conjugate anti-symmetric part $x_o(n)$ as discussed in Chapter 2. Show that
$$
\mathcal{F}\left[x_e(n)\right]=X_R\left(e^{j \omega}\right) \quad \text { and } \quad \mathcal{F}\left[x_o(n)\right]=j X_I\left(e^{j \omega}\right)
$$
where $X_R\left(e^{j \omega}\right)$ and $X_R\left(e^{j \omega}\right)$ are the real and imaginary parts of the DTFT $X\left(e^{j \omega}\right)$ respectively. Verify this property on
$$
x(n)=2(0.9)^{-n}[\cos (0.1 \pi n)+j \sin (0.9 \pi n)][u(n)-u(n-10)]
$$
using the MATLAB functions developed in Chapter 2.
Check back soon!
A complex-valued DTFT $X\left(e^{j \omega}\right)$ can also be decomposed into its conjugate symmetric part $X_c\left(e^{j \omega}\right)$ and conjugate anti-symmetric part $X_o\left(e^{j \omega}\right)$, i.e.,
$$
X\left(e^{j \omega}\right)=X_c\left(e^{j \omega}\right)+X_o\left(e^{j \omega}\right)
$$
where
$$
X_c\left(e^{j \omega}\right)=\frac{1}{2}\left[X\left(e^{j \omega}\right)+X^*\left(e^{-j \omega}\right)\right] \quad \text { and } \quad X_0\left(e^{j \omega}\right)=\frac{1}{2}\left[X\left(e^{j \omega}\right)-X^*\left(e^{-j \omega}\right)\right]
$$
Show that
$$
\mathcal{F}^{-1}\left[X_c\left(e^{j \omega}\right)\right]=x_R(n) \quad \text { and } \quad \mathcal{F}^{-1}\left[X_0\left(e^{j \omega}\right)\right]=j x_I(n)
$$
where $x_R(n)$ and $x_I(n)$ are the real and imaginary parts of $x(n)$. Verify this property on
$$
x(n)=e^{j 0.1 \pi n}[u(n)-u(n-20)]
$$
using the MATLAB functions developed in Chapter 2.
Check back soon!
Using the frequency-shifting property of the DTFT, show that the real part of $X\left(e^{j \omega}\right)$ of a sinusoidal pulse
$$
x(n)=\left(\cos \omega_o n\right) \mathcal{R}_M(n)
$$
where $\mathcal{R}_M(n)$ is the rectangular pulse given in Problem P3.4 is given by
$$
\begin{aligned}
X_{\mathrm{R}}\left(e^{j \omega}\right)= & \frac{1}{2} \cos \left\{\frac{\left(\omega-\omega_0\right)(M-1)}{2}\right\} \frac{\sin \left\{\left(\omega-\omega_0\right) M / 2\right\}}{\sin \left\{\left(\omega-\omega_0\right) / 2\right\}} \\
& +\frac{1}{2} \cos \left\{\frac{\left(\omega+\omega_0\right)(M-1)}{2}\right\} \frac{\sin \left\{\left[\omega-\left(2 \pi-\omega_0\right)\right] M / 2\right\}}{\sin \left\{\left[\omega-\left(2 \pi-\omega_0\right)\right] / 2\right\}}
\end{aligned}
$$
Compute and plot $X_{\mathrm{R}}\left(e^{j \omega}\right)$ for $\omega_0=\pi / 2$ and $M=5,15,25,100$. Use the plotting interval $[-\pi, \pi]$. Comment on your results.
Check back soon!
Let $x(n)=\mathcal{T}_{10}(n)$ be a triangular pulse given in Problem P3.4. Using properties of the DTFT, determine and plot the DTFT of the following sequences.
1. $x(n)=\mathcal{T}_{10}(-n)$
2. $x(n)=\mathcal{T}_{10}(n)-\mathcal{T}_{10}(n-10)$
3. $x(n)=\mathcal{T}_{10}(n) * \mathcal{T}_{10}(-n)$
4. $x(n)=\mathcal{T}_{10}(n) e^{j \pi n}$
5. $x(n)=\cos (0.1 \pi n) \mathcal{T}_{10}(n)$
Check back soon!
For each of the linear, shift-invariant systems described by the impulse response, determine the frequency response function $H\left(e^{j \omega}\right)$. Plot the magnitude response $\left|H\left(e^{j \omega}\right)\right|$ and the phase response $\angle H\left(e^{j \omega}\right)$ over the interval $[-\pi, \pi]$.
1. $h(n)=(0.9)^{|n|}$
2. $h(n)=\operatorname{sinc}(0.2 n)[u(n+20)-u(n-20)]$, where sinc $0=1$.
3. $h(n)=\operatorname{sinc}(0.2 n)[u(n)-u(n-40)]$
4. $h(n)=\left[(0.5)^n+(0.4)^n\right] u(n)$
5. $h(n)=(0.5)^{|n|} \cos (0.1 \pi n)$
Check back soon!
Let $x(n)=A \cos \left(\omega_0 n+\theta_0\right)$ be an input sequence to an LTI system described by the impulse response $h(n)$. Show that the output sequence $y(n)$ is given by
$$
y(n)=A\left|H\left(e^{j \omega_0}\right)\right| \cos \left[\omega_0 n+\theta_0+\angle H\left(e^{j \omega_0}\right)\right]
$$
Check back soon!
Let $x(n)=3 \cos \left(0.5 \pi n+60^{\circ}\right)+2 \sin (0.3 \pi n)$ be the input to each of the systems described in Problem P3.11. In each case, determine the output sequence $y(n)$.
Check back soon!
An ideal lowpass filter is described in the frequency domain by
$$
H_d\left(e^{j \omega}\right)=\left\{\begin{array}{cc}
1 \cdot e^{-j \alpha \omega}, & |\omega| \leq \omega_c \\
0, & \omega_c<|\omega| \leq \pi
\end{array}\right.
$$
where $\omega_c$ is called the cutoff frequency and $\alpha$ is called the phase delay.
1. Determine the ideal impulse response $h_d(n)$ using the IDTFT relation (3.2).
2. Determine and plot the truncated impulse response
$$
h(n)=\left\{\begin{array}{cc}
h_d(n), & 0 \leq n \leq N-1 \\
0, & \text { otherwise }
\end{array}\right.
$$
for $N=41, \alpha=20$, and $\omega_c=0.5 \pi$.
3. Determine and plot the frequency response function $H\left(e^{j \omega}\right)$, and compare it with the ideal lowpass filter response $H_d\left(e^{j \omega}\right)$. Comment on your observations.
Check back soon!
An ideal highpass filter is described in the frequency-domain by
$$
H_d\left(e^{j \omega}\right)=\left\{\begin{array}{cc}
1 \cdot e^{-j \alpha \omega}, & \omega_c<|\omega| \leq \pi \\
0, & |\omega| \leq \omega_c
\end{array}\right.
$$
where $\omega_c$ is called the cutoff frequency and $\alpha$ is called the phase delay.
1. Determine the ideal impulse response $h_d(n)$ using the IDTFT relation (3.2).
2. Determine and plot the truncated impulse response
$$
h(n)=\left\{\begin{array}{cc}
h_d(n), & 0 \leq n \leq N-1 \\
0, & \text { otherwise }
\end{array}\right.
$$
for $N=31, \alpha=15$, and $\omega_c=0.5 \pi$.
3. Determine and plot the frequency response function $H\left(e^{j \omega}\right)$, and compare it with the ideal highpass filter response $H_d\left(e^{j \omega}\right)$. Comment on your observations
Check back soon!
For a linear, shift-invariant system described by the difference equation
$$
y(n)=\sum_{m=0}^M b_m x(n-m)-\sum_{\ell=1}^N a_{\ell} y(n-\ell)
$$
the frequency-response function is given by
$$
H\left(e^{j \omega}\right)=\frac{\sum_{m=0}^M b_m e^{-j \omega m}}{1+\sum_{\ell=1}^N a_{\ell} e^{-j \omega \ell}}
$$
Write a MATLAB function freqresp to implement this relation. The format of this function should be
function [H] = freqresp(b,a,w)
% Frequency response function from difference equation
% [H] = freqresp(b,a,w)
%H= frequency response array evaluated at w frequencies
%b= numerator coefficient array
%a= denominator coefficient array (a(1)=1)
%w= frequency location array
Check back soon!
Determine $H\left(e^{j \omega}\right)$, and plot its magnitude and phase for each of the following systems:
1. $y(n)=\frac{1}{5} \sum_{m=0}^4 x(n-m)$
2. $y(n)=x(n)-x(n-2)+0.95 y(n-1)-0.9025 y(n-2)$
3. $y(n)=x(n)-x(n-1)+x(n-2)+0.95 y(n-1)-0.9025 y(n-2)$
4. $y(n)=x(n)-1.7678 x(n-1)+1.5625 x(n-2)+1.1314 y(n-1)-0.64 y(n-2)$
5. $y(n)=x(n)-\sum_{\ell=1}^5(0.5)^{\ell} y(n-\ell)$
Check back soon!
A linear, shift-invariant system is described by the difference equation
$$
y(n)=\sum_{m=0}^3 x(n-2 m)-\sum_{\ell=1}^3(0.81)^{\ell} y(n-2 \ell)
$$
Determine the steady-state response of the system to the following inputs:
1. $x(n)=5+10(-1)^n$
2. $x(n)=1+\cos (0.5 \pi n+\pi / 2)$
3. $x(n)=2 \sin (\pi n / 4)+3 \cos (3 \pi n / 4)$
4. $x(n)=\sum_{k=0}^5(k+1) \cos (\pi k n / 4)$
5. $x(n)=\cos (\pi n)$
In each case, generate $x(n), 0 \leq n \leq 200$, and process it through the filter function to obtain $y(n)$. Compare your $y(n)$ with the steady-state responses in each case.
Check back soon!
An analog signal $x_a(t)=\sin (1000 \pi t)$ is sampled using the following sampling intervals. In each case, plot the spectrum of the resulting discrete-time signal.
1. $T_s=0.1 \mathrm{~ms}$
2. $T_s=1 \mathrm{~ms}$
3. $T_s=0.01 \mathrm{sec}$
Check back soon!
We implement the following analog filter using a discrete filter.
$$
x_a(t) \longrightarrow \mathrm{A} / \mathrm{D} \xrightarrow{x(n)} h(n) \xrightarrow{y(n)} \mathrm{D} / \mathrm{A} \rightarrow y_a(t)
$$
The sampling rate in the $\mathrm{A} / \mathrm{D}$ and $\mathrm{D} / \mathrm{A}$ is $8000 \mathrm{sam} / \mathrm{sec}$, and the impulse response is $h(n)=(-0.9)^n u(n)$.
1. What is the digital frequency in $x(n)$ if $x_a(t)=10 \cos (10,000 \pi t)$ ?
2. Determine the steady-state output $y_a(t)$ if $x_a(t)=10 \cos (10,000 \pi t)$.
3. Determine the steady-state output $y_a(t)$ if $x_a(t)=5 \sin (8,000 \pi t)$.
4. Find two other analog signals $x_a(t)$, with different analog frequencies, that will give the same steady-state output $y_a(t)$ when $x_a(t)=10 \cos (10,000 \pi t)$ is applied.
5. To prevent aliasing, a prefilter would be required to process $x_\alpha(t)$ before it passes to the $\mathrm{A} / \mathrm{D}$ converter. What type of filter should be used, and what should be the largest cutoff frequency that would work for the given configuration?
Check back soon!
Consider an analog signal $x_a(t)=\cos (20 \pi t), 0 \leq t \leq 1$. It is sampled at $T_s=0.01,0.05$, and 0.1 sec intervals to obtain $x(n)$.
1. For each $T_s$ plot $x(n)$.
2. Reconstruct the analog signal $y_a(t)$ from the samples $x(n)$ using the sinc interpolation (use $\Delta t=0.001$ ) and determine the frequency in $y_a(t)$ from your plot. (Ignore the end effects.)
3. Reconstruct the analog signal $y_a(t)$ from the samples $x(n)$ using the cubic spline interpolation, and determine the frequency in $y_a(t)$ from your plot. (Again, ignore the end effects.)
4. Comment on your results.
Check back soon!
Consider the analog signal $x_a(t)=\cos (20 \pi t+\theta), 0 \leq t \leq 1$. It is sampled at $T_s=0.05$ sec intervals to obtain $x(n)$. Let $\theta=0, \pi / 6, \pi / 4, \pi / 3, \pi / 2$. For each of these $\theta$ values, perform the following.
1. Plot $x_a(t)$ and superimpose $x(n)$ on it using the plot $(\mathrm{n}, \mathrm{x}$, 'o') function.
2. Reconstruct the analog signal $y_a(t)$ from the samples $x(n)$ using the sinc interpolation (Use $\Delta t=0.001$ ) and superimpose $x(n)$ on it.
3. Reconstruct the analog signal $y_a(t)$ from the samples $x(n)$ using the cubic spline interpolation and superimpose $x(n)$ on it.
4. You should observe that the resultant reconstruction in each case has the correct frequency but a different amplitude. Explain this observation. Comment on the role of phase of $x_a(t)$ on the sampling and reconstruction of signals.
Check back soon!