\documentstyle[11pt]{article}
% frob with the margins
\addtolength{\topmargin}{-1in}
\addtolength{\footskip}{-1in}
\addtolength{\textheight}{2in}
\addtolength{\oddsidemargin}{-.5in}
\addtolength{\evensidemargin}{-.5in}
\addtolength{\textwidth}{1in}
% no page numbers
\pagestyle{empty}
% title command
\newcommand{\mytitle}[2]{\begin{center} {\Large 6.003 Problem Set #1 --
Juliet Bourne -- #2 -- TA R. Kim} \\ \rule{6in}{.5mm} \end{center}}
% problem command
\newcommand{\prob}[1]{\vspace{.15in}{\noindent\large\bf Problem #1} \par
\vspace{-.1in} \noindent\rule{2in}{.1mm}}
% equations commands
\newcommand{\beq}{\vspace*{-.3in}\begin{eqnarray*}}
\newcommand{\eeq}{\end{eqnarray*}}
% newpage setup command IDEALLY PROBLEM SET NUM SHOULD BE A GLOBAL 
% AND THE PAGE NUMBER SHOULD BE GOTTEN FROM A COUNTER
\newcommand{\mynewpage}[2]{\newpage\noindent
\begin{center}
{\large 6.003 Problem Set #1 -- Juliet Bourne -- Page #2}
\rule{6in}{.5mm}
\end{center}}
% see-page-foo command
\newcommand{\seepage}{\noindent See page \rule{.2in}{.1mm} for the
computer output.}
% subproblem command
\newcommand{\subprob}[1]{\vspace{.15in} \noindent{\large\bf #1.}}

\begin{document}

\mytitle{4}{3/23/90}

\prob{8.1(c) (CSAS)}

\beq
x[n] & = & 0.5^n \cos \left( \frac{n\pi}{3} \right) \\
a = 0.5 & , & \hspace{.1in} \Theta = \frac{\pi}{3} \\
\tilde{X}(z) & = & \frac{1 - a\cos\Theta (z^{-1})}{1 - 2a\cos(z^{-1})
+ a^2z^{-2}} \\
\mbox{} & = & \frac{1 - 0.5(0.5)(z^{-1})}{1 - 2(0.5)(0.5)z^{-1} +
0.25z^{-2}} \\
\mbox{} & = & \frac{1 - 0.25z^{-1}}{1 - 0.5z^{-1} + 0.25z^{-2}} \\
\tilde{X}(z) & = & \frac{4 - z^{-1}}{4 - 2z^{-1} + z^{-2}}
\eeq

\prob{8.2(f) (CSAS)}

\beq
x[n] & = & 1 , \hspace{.15in} n \leq 2 \\
\mbox{} & = & 0.5^{n - 2} , \hspace{.15in} n > 2 
\eeq

\vspace{1in}

\beq
\tilde{X}(z) & = & \sum_{n = 0}^{2} (1)z^{-n} + \sum_{n - 2 = 0}^{\infty}
(0.5z^{-1})^{n - 2} \\
\mbox{} & = & \frac{1}{1 - z^{-1}} + \frac{1}{1 - 0.5z^{-1}} \\
\mbox{} & = & \frac{1 - 0.5z^{-1} + 1 - z^{-1}}{1 - 0.5z^{-1} - z^{-1}
+ 0.5z^{-2}} \\
\mbox{} & = & \frac{2 - 1.5z^{-1}}{1 - 1.5z^{-1} + 0.5z^{-2}} \cdot
\frac{z^2}{z^2} \\
\tilde{X}(z) & = & \frac{2z^2 - 1.5z}{z^2 - 1.5z + 0.5}
\eeq
\noindent (I know this isn't right, but I can't find my error.)

\mynewpage{4}{2}

\prob{6.1 (PE)}

\vspace{.1in}\noindent
The system that produces the desired output would be defined as:

\begin{verbatim}
(define (simple-sys input-stream)
  (add-streams input-stream
               (delay-stream (scale-stream -0.5 
                                           (simple-sys input-stream)))))
\end{verbatim}

\seepage

\prob{6A}

\vspace{.1in}\noindent
8.1(c)
\beq
\tilde{H}(z) = \tilde{X}(z) = \frac{4 - z^{-1}}{4 - 2z^{-1} + z^{-2}}
\eeq

\noindent This corresponds to a DT-system defined as:

\begin{verbatim}
(define sys-1c (dt-system '((4 -1) (4 -2 1))))
\end{verbatim}

\noindent The first few values of $x[n] = 0.5^n \cos (n\pi/3)$
are 1, 0.25, -0.125, 0.0625... 

\vspace{.1in}\noindent
8.2(f)
\beq
\tilde{H}(z) = \tilde{X}(z) = \frac{2 + z^{-1} + z^{-2}}{2 - z^{-1}}
\eeq

\noindent This corresponds to a DT-system defined as:

\begin{verbatim}
(define sys-2f (dt-system '((2 1 1) (2 -1))))
\end{verbatim}

\noindent The first few values of $x[n]$ are 1, 1, 1, 0.5, 0.25...

\vspace{.1in}
\seepage

\prob{6.3 (PE)}

\subprob{a}

\beq
y[n] + 0.8y[n - 1] - 0.2y[n - 2] & = & 3x[n] - 3x[n - 1] \\
\tilde{Y}(z) + 0.8z^{-1}\tilde{Y}(z) - 0.2z^{-2}\tilde{Y}(z) & = &
3\tilde{X}(z) - 3z^{-1}\tilde{X}(z) \\
5\tilde{Y}(z) + 4z^{-1}\tilde{Y}(z) - z^{-2}\tilde{Y}(z) & = &
15\tilde{X}(z) - 15z^{-1}\tilde{X}(z) \\
(5 + 4z^{-1} - z^{-2})\tilde{Y}(z) & = & (15 -15z^{-1})\tilde{X}(z) \\
\tilde{H}(z) = \frac{\tilde{Y}(z)}{\tilde{X}(z)} & = & \frac{15 -
15z^{-1}}{5 + 4z^{-1} - z^{-1}} 
\eeq

\mynewpage{4}{3}

\subprob{b}

\beq
x[n] = u[n] \Rightarrow \tilde{X}(z) & = & \frac{1}{1 - z^{-1}} \\
\tilde{Y}(z) & = & \tilde{H}(z)\tilde{X}(z) \\
\mbox{} & = & \frac{15(1 - z^{-1})}{5 + 4z^{-1} - z^{-2}} \cdot
\frac{1}{1 - z^{-1}} \\
\mbox{} & = & \frac{15}{(5 - z^{-1})(1 + z^{-1})} \\
\mbox{} & = & \frac{A}{5 - z^{-1}} + \frac{B}{1 + z^{-1}} \\
A(1 + z^{-1}) + B(5 - z^{-1}) & = & 15 \\
z^{-1} = -1 \Rightarrow 6B & = & 15 \rightarrow B = 1.5 \\
z^{-1} = 5 \Rightarrow 6A & = & 15 \rightarrow A = 1.5 \\
\tilde{Y}(z) & = & 1.5 \left( \frac{1}{5 - z^{-1}} \right) +
1.5 \left( \frac{1}{1 + z^{-1}} \right) \\
\mbox{} & = & 1.5 \left( \frac{0.2}{1 - 0.2z^{-1}} \right) + 1.5
\left( \frac{1}{1 + z^{-1}} \right) \\ 
\mbox{} & = & 0.3 \left( \frac{1}{1 - 0.2z^{-1}} \right) + 1.5
\left( \frac{1}{1 - (-1)z^{-1}} \right) \\
y[n] & = & 0.3 (0.2)^n + 1.5(-1)^n   
\eeq

\subprob{c} The system would be defined as:

\begin{verbatim}
(define system-63 (dt-system '((15 -15) (5 4 -1))))
\end{verbatim}

\noindent The output of this system would be obtained by:

\begin{verbatim}
(print-stream (system-63 (step-stream 1)))
\end{verbatim}

\seepage

\subprob{d} Using the canonical form shown in PE Figure 6.3.

\mynewpage{4}{4}

\subprob{e}

\beq
\tilde{H}(z) & = & \frac{15 - 15z^{-1}}{5 + 4z^{-1} - z^{-2}} \\
\mbox{} & = & \frac{A}{5 - z^{-1}} + \frac{B}{1 + z^{-1}} \\
A(1 + z^{-1}) + B(5 - z^{-1}) & = & 15 - 15z^{-1} \\
z^{-1} = -1 \Rightarrow 6B & = & 15 + 15 \rightarrow B = 5 \\
z^{-1} = 5 \Rightarrow 6A & = & 15 - 75 \rightarrow A = -10 \\
\tilde{H}(z) & = & \frac{-10}{5 - z^{-1}} + \frac{5}{1 + z^{-1}}
\eeq

\vspace{2in}
\subprob{f} The subsystems would be defined as:

\begin{verbatim}
(define subsys-1 (dt-system '((-10) (5 -1))))

(define subsys-2 (dt-system '((5) (1 1))))
\end{verbatim}

\noindent The result of connecting this two systems in parallel and
giving them both a unit step input would be shown by:

\begin{verbatim}
(print-stream (add-streams (subsys-1 (step-stream 1))
                           (subsys-2 (step-stream 1))))
\end{verbatim}

\seepage

\subprob{g}

\beq
\tilde{H}(z) & = & \left( \frac{K}{1 - \beta{}z^{-1}} \right) \left(
\frac{1 - \alpha{}z^{-1}}{1 - \gamma{}z^{-1}} \right) \\
\mbox{} & = & 0.2 \left( \frac{15 - 15z^{-1}}{1 + 0.8z^{-1} - 0.2z^{-2}}
\right) \\ 
\mbox{} & = & \frac{3 - 3z^{-1}}{1 + 0.8z^{-1} - 0.2z^{-2}} \\
K(1 - \alpha{}z^{-1}) & = & 3(1 - z^{-1}) \Rightarrow K = 3, \alpha
= 1 \\
1 - (\beta + \gamma)z^{-1} + \beta{}\gamma{}z^{-2} & = & 1 + 0.8z^{-1}
- 0.2z^{-2} \\
-\beta - \gamma = 0.8 , \hspace{.1in}\beta{}\gamma = -0.2 &
\Rightarrow & \beta = -1, \gamma = 0.2 \\
\tilde{H}(z) & = & \left( \frac{3}{1 + z^{-1}} \right) \left( \frac{1
- z^{-1}}{1 - 0.2z^{-1}} \right)
\eeq

\mynewpage{4}{5}

\subprob{h} The cascaded system would be defined as:

\begin{verbatim}
(define (cascade-sys input)
   ((dt-system '((1 -1) (1 -0.2))) ((dt-system '((75) (1 1))) input)))
\end{verbatim}

\noindent The output of this system in response to a unit step stream
would be obtained by:

\begin{verbatim}
(print-stream (cascade-sys (step-stream 1)))
\end{verbatim}

\seepage

\prob{6.4 (PE)}

\subprob{a}

\beq
y[n] & = & a \sin (2\pi F_o n\Delta) \\
\tilde{Y}(z) & = & \frac{az^{-1}\sin (2\pi F_o\Delta)}{1 -
2az^{-1}\cos (2\pi F_0\Delta) + a^2z^{-2}} \\
x[n] & = & a \delta [n] \\
\tilde{X}(z) & = & a \\
\tilde{H}(z) & = & \frac{\tilde{Y}(z)}{\tilde{X}(z)} \\
\tilde{H}(z) & = & \frac{z^{-1}\sin (2\pi F_o\Delta)}{1 - 2az^{-1}\cos
(2\pi F_o\Delta) + a^2z^{-2}}
\eeq

\subprob{b}

\vspace{2in}

\beq
\lambda_1 & = & \frac{\lambda_1}{z} + \tilde{X}(z) + X_o\lambda_2 \\
\lambda_2 & = & \frac{\tilde{Y}(z)}{z} \\
\tilde{Y}(z) & = & \lambda_2 + X_o\lambda_1 \\
\mbox{} & = & \frac{\tilde{Y}(z)}{z} + X_o\lambda_1
\eeq

\mynewpage{4}{6}

\beq
\left( 1 - \frac{1}{z} \right) \tilde{Y}(z) & = & X_o\lambda_1 \\
\lambda_1 & = & \frac{\left( 1 - \frac{1}{z} \right)
\tilde{Y}(z)}{X_o} \\
\frac{\left( 1 - \frac{1}{z} \right) \tilde{Y}(z)}{X_o} & = &
\frac{\left( 1 - \frac{1}{z} \right) \tilde{Y}(z)}{zX_o} +
\tilde{X}(z) + X_o \left( \frac{\tilde{Y}(z)}{z} \right) \\
(1 - z^{-1})\tilde{Y}(z) & = & \frac{1 - z^{-1}}{z} \tilde{Y}(z) +
X_o\tilde{X}(z) + \frac{X_o^2}{z} \tilde{Y}(z) \\
\left( 1 - z^{-1} - z^{-1} + z^{-2} - X_o^2z^{-1} \right) \tilde{Y}(z)
& = & X_o \tilde{X}(z) \\
\frac{\tilde{Y}(z)}{\tilde{X}(z)} & = & \frac{X_o}{1 - (2 +
X_o^2)z^{-1} + z^{-2}} \\
X_o & = & 2 \sin (\pi F_o/F_s) \\
F_s = 1/\Delta \Rightarrow X_o & = & 2 \sin (\pi F_o \Delta) \\
X_o^2 & = & 4 \sin^2 (\pi F_o \Delta) \\
(2 + X_o^2) & = & (2 + 4 \sin^2 (\pi F_o \Delta)) \\
\mbox{} & = & 2 \cos (2\pi F_o \Delta) \\
\tilde{H}(z) & = & \frac{2 \sin (\pi F_o \Delta)}{1 - 2\cos (2\pi F_o
\Delta)z^{-1} + z^{-2}}
\eeq

\noindent The shift of $z^{-1}$ is conspicuously missing from the
numerator of the system function. Also, the argument to the sin in the
numerator is $\pi F_o \Delta$ instead of $2\pi F_o \Delta$. This will
not affect the output, except for a scale factor, since both $\sin
(\pi F_o \Delta)$ and $\sin (2\pi F_o \Delta)$ are constants. The
absence of the $z^{-1}$, however, will affect the output: the output
wil be not be delayed as it should be. Therefore, the output should be
put through a delay (multiplied by $z^{-1}$). The revised diagram
would therefore look like:

\mynewpage{4}{7}

\prob{6.5 (PE)}

\subprob{a}

\beq
H(s) & = & \frac{1}{s + \alpha} \\
x(t) = u(t) \Rightarrow X(s) & = & \frac{1}{s} \\
Y(s) & = & H(s)X(s) \\
\mbox{} & = & \frac{1}{s + \alpha} \cdot \frac{1}{s} \\
\mbox{} & = & \frac{A}{s + \alpha} + \frac{B}{s} \\
As + B(s + \alpha) & = & 1 \\
s = -\alpha \Rightarrow -\alpha A & = & 1 \rightarrow B =
\frac{-1}{\alpha} \\
s = 0 \Rightarrow B\alpha & = & 1 \rightarrow \frac{1}{\alpha} \\
Y(s) & = & \frac{-1/\alpha}{s + \alpha} + \frac{1/\alpha}{s} \\
y(t) & = & \frac{-1}{\alpha} e^{-\alpha T} + \frac{1}{\alpha} u(t) \\
y[n] & = & \frac{-1}{\alpha}(e^{-\alpha T})^n + \frac{1}{\alpha}u[n] \\
\tilde{Y}(z) & = & \frac{1}{\alpha} \left( \frac{1}{1 - (e^{-\alpha
T})z^{-1}} \right) - \frac{1}{\alpha} \left( \frac{1}{1 - z^{-1}}
\right) \\
\mbox{} & = & \frac{1}{\alpha} \left( \frac{1 - z^{-1} - 1 +
(e^{-\alpha T})z^{-1}}{(1 - z^{-1})(1 - (e^{-\alpha T})z^{-1})} \right) \\
x[n] & = & u[n] \\
\tilde{X}(z) & = & \frac{1}{1 - z^{-1}} \\
\tilde{H}(z) & = & \frac{\tilde{Y}(z)}{\tilde{X}(z)} \\
\mbox{} & = & \frac{1}{\alpha} \left( \frac{(e^{-\alpha T} -
1)z^{-1}}{(1 - z^{1})(1 - (e^{-\alpha T})z^{-1})} \cdot \frac{1 -
z^{-1}}{1} \right) \\
\tilde{H}(z) & = & \frac{1}{\alpha} \left( \frac{(e^{-\alpha T} -
1)z^{-1}}{1 - (e^{-\alpha T})z^{-1}} \right) 
\eeq

\noindent The zero of $\tilde{H}(z)$ is at 0. Its pole is at
$e^{\alpha T}$. The zero of $H(s)$ is at infinity, and the pole is at
$-\alpha$.

\subprob{b} The system $\tilde{H}(z)$, with $\alpha T$ being an
argument, would be defined as: 
 
\begin{verbatim}
(define (step-inv-sys alpha-T alpha)
  (dt-system (list (list 0 (- (exp 2.71828 (- alpha-T))))
                   (list alpha (* alpha (- (exp 2.71828 (- alpha-T))))))))
\end{verbatim}

\mynewpage{4}{8}

\noindent With $\alpha T$ = 0.2, the step-response of $H(s)$ at times $nT$:

\beq
y(t) & = & e^{-\alpha T n} \\
n = 0 \rightarrow y(t) & = & 1 \\
n = 1 \rightarrow y(t) & = & 0.82 \\
n = 2 \rightarrow y(t) & = & 0.67 \\
n = 3 \rightarrow y(t) & = & 0.55 \\
n = 4 \rightarrow y(t) & = & 0.45 \\
n = 5 \rightarrow y(t) & = & 0.37 
\eeq

\vspace{.15in}
\seepage

\subprob{c}

\beq
x[n] & = & \beta^n u[n] \\
\tilde{X}(z) & = & \frac{1}{1 - \beta z^{-1}} \\
\tilde{Y}(z) & = & \frac{1}{\alpha} \left( \frac{(e^{-\alpha T} -
1)z^{-1}}{(1 - z^{1})(1 - (e^{-\alpha T})z^{-1})} \right) \\
\tilde{H}(z) & = & \frac{(1 - \beta z^{-1})(e^{-\alpha T} -
1)z^{-1}}{\alpha - \alpha(e^{-\alpha T})z^{-1}} 
\eeq

\begin{verbatim}
(define (new-system alpha-T alpha beta)
  (dt-system (list (list 0 (- (exp 2.71828 (- alpha-T)) 1) 
                         (* beta (- (exp 2.71828 (- alpha-T)) 1)))
                   (list alpha (* alpha (- (exp 2.71828 (- alpha-T))))))))
\end{verbatim}

\seepage

\end{document}


