(1) follows from the DTFT of $u[n]$ (2) follows from $e^{j\omega(M-1)/2}\tilde{\delta}(\omega)=e^{-j\omega(M+1)/2}\tilde{\delta}(\omega)=\tilde{\delta}(\omega).$
Finally, using the convolution theorem, we can write
For each of the input-output relationships listed below, determine if the corresponding transformation is linear, time-invariant, BIBO stable and causal. For LTI transformations, characterize the corresponding systems by their impulse response.
|x[n]| \leq M\Rightarrow |\mathcal{H}_1\{\mathbf x\}[n] | \leq M.
\]
\item$\mathcal{H}_1$ is not causal since producing the output for negative values of the index requires knowledge of the values of the input in the future.
\item$\mathcal{H}_1$ is not LTI and therefore it cannot be characterized by an impulse response.
\end{itemize}
\item
\begin{itemize}
\item $\mathcal{H}_2$ is linear:
\[
\mathcal{H}_2\{a \mathbf{x}_1 + b\mathbf{x}_2\}[n] = e^{-j\omega n}(a x_1[n] + b x_2[n])= a \mathcal{H}_2\{\mathbf{x}_1\}[n] + b\mathcal{H}_2\{\mathbf{x}_2\}[n].
\]
\item$\mathcal{H}$ is NOT time invariant (except in the trivial case $\omega=0$): set $d[n] = x[n-N]$; then
Let $X(e^{j\omega})$ be the DTFT of the sequence $\mathbf{x}$ and let $H(e^{j\omega})$ be the frequency response of the filter. Since both impulse response and signal are real, their DTFT are Hermitian-symmetric, i.e., $X(e^{j\omega}) = X^*(e^{-j\omega})$.
By the time reversal property of the DTFT, the DTFT of $x[-n]$ is $X(e^{-j\omega})$ which, because of the Hermitian symmetry, is also equal to $X^*(e^{j\omega})$. With this, we can write the following list of time-frequency correspondences
Therefore the chain of operators implements an LTI system with zero phase delay and magnitude response equal to the squared magnitude response of the original filter.
Sketch the pole-zero plot of the transfer function and specify its region of convergence. Is the system stable?
\end{exercise}
}\fi
\ifanswers{%
\begin{solution}{}
To investigate the stability of the system, let's compute the overall transfer function and eliminate possible common factors; factorization in first-order terms yields
We can see that the zeros of this system are in $z_{01}=1.5$ and $z_{02}=-1.5$ and the poles in $z_{p1}=0.5$ and $z_{p2}=-1.5$. From a theoretical point of view the zero in $z_{01}=-1.5$ cancels out the pole in $z_{p2}=-1.5$ and we obtain the following ROC, extending outwards from $z=0.5$ and including the unit circle, so that the system is stable:
\begin{center}
\begin{dspPZPlot}[roc=0.5]{2.5}
\dspPZ[label=none]{0.5,0}
\dspPZ[label=none,type=zero]{1.5,0}
\end{dspPZPlot}
\end{center}
In other words, the second subsystem in the cascade has stabilized the overall processing function by canceling the zero in the first subsystem.
Note however that, in practice, the stabilization of a system with this technique is a risky enterprise since the exact cancellation of the pole outside the unit circle will be extremely sensitive to numerical precision issues. If the coefficients of the filter (or the internal accumulators) are subject to truncation or rounding, the implicit position of the zero may drift ever so slightly from the implicit position of the pole and the system will no longer be stable.
Consider a causal discrete system represented by the following
difference equation
\[
y[n]-3.25y[n-1]+0.75y[n-2]=x[n-1]+3x[n-2].
\]
\begin{enumerate}
\item Compute the transfer function and check the stability of this system.
\item If the input signal is $x[n]=\delta[n]-3\delta[n-1]$, compute the $z$-transform of the output signal and discuss the stability result you found before.
\item Consider now the input signal $x[n]=\delta[n]-0.25\delta[n-1]$; assume the filter is implemented in fixed-precision arithmetic and that the the processing unit can only handle numbers in the range [-1024, 1024]. Starting processing for $n=0$, how many samples can we process before we hit overflow or underflow?
\end{enumerate}
\end{exercise}
}\fi
\ifanswers{%
\begin{solution}{}
\begin{enumerate}
\item By taking the $z$-transform of the CCDE we have
The ROC for $Y(z)$ is $|z| > 0.25$, which includes the unit circle. This implies that $y[n]$ has a well-defined DTFT and therefore is finite-energy. What's happening is that the input signal has a spectral null exactly at the location of the pole of the system. Since in this case no energy ``excites'' the system pole, the output is a stable singal.
\item Suppose that the above expression corresponds to the impulse response of an LTI system. What can you say about the causality of such a system? About its stability?
\item Let $\alpha=0.8$, what is the spectral behavior of the corresponding filter? What if $\alpha=-0.8$?
\end{enumerate}
\end{exercise}
}\fi
\ifanswers{%
\begin{solution}{}
\begin{enumerate}
\item Let $X(z)=\Sigma_n x[n]z^{-n}$. We have that
\item The system is causal since the ROC corresponds to the outside of a circle of radius $\alpha$ (or equivalently since the impulse response is zero when $n<0$). The system is stable when the unit circle lies inside the ROC, i.e.\ when $|\alpha|\leq1$.
\item When $\alpha=0.8$, the angular frequency of the pole is $\omega=0$. Thus the filter is lowpass. When $\alpha=-0.8$, $\omega=\pi$ and the filter is highpass.
Consider two two-sided sequences $h[n]$ and $g[n]$ and consider a third sequence $x[n]$ which is built by interleaving the values of $h[n]$ and $g[n]$:
\item The ROC is determined by the poles of the transform. Since the sequence is two sided, the ROC is a ring bounded by two poles $z_L$ and $z_R$ such that $|z_L| < |z_R|$ and no other pole has magnitude between $|z_L|$ and $|z_R|$. Consider $H(z)$; if $z_0$ is a pole of $H(z)$, $H(z^2)$ will have two poles at $\pm z_0^{1/2}$; however, the square root preserves the monotonicity of the magnitude and therefore no new poles will appear between the circles $|z| = \sqrt{|z_L|}$ and $|z| = \sqrt{|z_R|}$. Therefore the ROC for $H(z^2)$ is the ring $\sqrt{|z_L|} < |z| < \sqrt{|z_R|}$. The ROC of the sum $H(z^2) + z^{-1}G(z^2)$ is the intersection of the ROCs, and so
\begin{exercise}{Transfer function, poles, and zeros}
The figures below show the zeros and poles of three different filters with the unit circle for reference. Each zero is represented with a 'o' and each pole with a 'x' on the plot. Multiple zeros and poles are indicated by the multiplicity number shown to the upper right of the zero or pole.Sketch the magnitude of each frequency response and determine the type of filter.
\begin{tabular}{ccc}
% [b, a] = butter(3, .1)
\begin{dspPZPlot}[]{1.5}
\dspPZ[label=none]{0.8238, 0.2318}
\dspPZ[label=none]{0.8238, -0.2318}
\dspPZ[label=none]{0.7265, 0}
\dspPZ[label=3,type=zero]{-1,0}
\end{dspPZPlot}
&
\begin{dspPZPlot}[]{1.5}
% butter(3, .8, 'high')
\dspPZ[label=none]{-0.6253, 0.3934}
\dspPZ[label=none]{-0.6253, -0.3934}
\dspPZ[label=none]{-0.5095, 0}
\dspPZ[label=3,type=zero]{1,0}
\end{dspPZPlot}
&
\begin{dspPZPlot}[]{1.5}
% [b, a] = butter(3, [.1 .8], 'stop')
\dspPZ[label=none]{0.8238, 0.2318}
\dspPZ[label=none]{0.8238, -0.2318}
\dspPZ[label=none]{0.7265, 0}
\dspPZ[label=none]{-0.6253, 0.3934}
\dspPZ[label=none]{-0.6253, -0.3934}
\dspPZ[label=none]{-0.5095, 0}
\dspPZ[label=3,type=zero]{0.3446, 0.9388}
\dspPZ[label=3,type=zero]{0.3446, -0.9388}
\end{dspPZPlot}
\\
(a) & (b) & (c)
\end{tabular}
\end{exercise}
}\fi
\ifanswers{%
\begin{solution}{}
To obtain the frequency response of a filter, we analyze the $z$-transform on the unit circle, that is, in $z=e^{j\omega}$. the following figures shows the exact magnitude of each frequency response.
Consider the signal $x[n] = \sin(\omega_0 n) + s[n]$ where $\omega_0 = 2\pi/50$ and $s[n]$ is a zero-mean, Gaussian white noise sequence with power spectral density $P_s(e^{j\omega}) = \sigma^2 = 10^{-2}$. A realization of the signal is plotted in the following figure:
The signal is filtered with a stable, real-valued, causal LTI system whose frequency response satisfies $|H(e^{j\omega})| \le 1$ for all frequencies. For each of the following plots, explain if the signal in the plot could be the result of filtering $x[n]$ with $H(e^{j\omega})$; explain your answers in detail.
The filter will act on the deterministic sinusoidal component and on the noise component independently; therefore the output can be written as
\begin{align*}
y[n] &= h[n] \ast (\sin(\omega_0 n) + s[n]) \\
&= A\sin(\omega_c + \theta) + h[n]\ast s[n] \\
&= A\sin(\omega_c + \theta) + v[n]
\end{align*}
where $A = |H(e^{j\omega_c})|$ and $\theta = \angle H(e^{j\omega_c})$.
\begin{enumerate}
\item NO: the frequency of the sinusoidal component in the output is clearly different than the frequency of the input; since a filter cannot change the frequency of a sinusoidal input this signal cannot be a valid output
\item NO: the amplitude of the sinusoidal component has increased, but this cannot happen since by design $|H(e^{j\omega})| \le 1$ for all $\omega$
\item NO: the variance of the noise seems to have increased in the output. However the variance of the output noise is