text: # Transfer function of LTI causal system
  
  I have $$y(n)-3y(n-1)+2y(n-2)=4x(n)-2x(n-1)$$ that is the equation for a causal, discrete time LTI system. Using the Laplace Transform I rewrote it as: $$Y(s)-3e^{-s}Y(s)+2e^{-2s}Y(s)=4X(s)-2e^{-s}X(s)$$ And then I tried calculating $$H(s)=\frac{Y(s)}{X(s)}=\frac{4-2e^{-s}}{1-3e^{-s}+2e^{-2s}}$$ But the correct response for the transfer function is $$H(z)=\frac{4z(z-1/2)}{z^2-3z+2}$$ so I think I'm missing something here.
  
  Then I have another problem, given what was calculated before, what should be the initial conditions so that the system's response to the unit step function are $$y(0)=1$$ and $$y(1)=3$$. The answer is $$y(-1)=1$$ and $$y(-2)=3$$ and I have no idea how I'm even supposed to calculate that, I'm assuming it has something to do with the Unilateral LaPlace Transform, but I'm very new to this and I don't even know how to start.
  
  • You're dealing with a discrete-time system here, so you have to use the Z-transform instead of the Laplace transform. A delay by one sample corresponds to multiplication with $z^{-1}$. But you should really read up a bit on the Z-transform, and then come back with questions if you have any. Commented Jan 17, 2023 at 12:42
  • Good practice is to use square brackets for discrete signals, $x[n], n \in \mathbb{Z}$ and round brackets for time continuous signals $x(t), t \in \mathbb{R}$ Commented Jan 17, 2023 at 13:21
  • Try letting $z = e^s$; see if things start looking sensible. Commented Jan 17, 2023 at 20:13
  
  Almost there.
  
  ##### Transfer function
  
  Let's do it in the $$\mathcal{Z}$$-domain: $$H(z) = \frac{4-2z^{-1}}{1-3z^{-1}+2z^{-2}}$$ Now multiply denominator and numerator by $$z^2$$ and you get the transfer function you're looking for.
  
  ##### Initial Conditions
  
  Recall the unit step function: $$u[n] = \begin{cases} 0, &n < 0\\ 1, &n \geq 0 \end{cases}$$ Let's use your difference equation (notice, as per @Hilmar's comment, I'm using square brackets to indicate a discrete signal): $$y[n]-3y[n-1]+2y[n-2]=4x[n]-2x[n-1]$$
  
  1. Using $$x[n] = u[n]$$ defined above, let's compute the difference equation for $$n=0$$ and substitute to satisfy $$y[0] = 1$$. You should get: \begin{align}y[0] - 3y[-1] + 2y[-2] &= 4x[0] - 2x[-1]\\ -3 &=3y[-1] -2y[-2] \tag{1}\end{align}
  
  2. Compute for $$n=1$$ and substitute to satisfy $$y[1] = 3$$ (you'll also substitute $$y[0] = 1$$). You arrive at (I'll let you do this one): \begin{align}y[1] - 3y[0] + 2y[-1] &= 4x[1] - 2x[0]\\ 1 &= y[-1] \tag{2}\end{align}
  
  3. Finally, substitute (2) into (1) and solve for $$y[-2]$$
explanation: The document contains a detailed discussion of a discrete-time LTI system, including the derivation of its transfer function and the determination of initial conditions for a specific response. The text includes a question about the correct form of the transfer function and another question about the initial conditions required to achieve a specific response to a unit step function. The document also includes comments and a detailed solution to the initial conditions problem.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Transfer function of LTI causal system
  
  I have $$y(n)-3y(n-1)+2y(n-2)=4x(n)-2x(n-1)$$ that is the equation for a causal, discrete time LTI system. Using the Laplace Transform I rewrote it as: $$Y(s)-3e^{-s}Y(s)+2e^{-2s}Y(s)=4X(s)-2e^{-s}X(s)$$ And then I tried calculating $$H(s)=\frac{Y(s)}{X(s)}=\frac{4-2e^{-s}}{1-3e^{-s}+2e^{-2s}}$$ But the correct response for the transfer function is $$H(z)=\frac{4z(z-1/2)}{z^2-3z+2}$$ so I think I'm missing something here.
  
  Then I have another problem, given what was calculated before, what should be the initial conditions so that the system's response to the unit step function are $$y(0)=1$$ and $$y(1)=3$$. The answer is $$y(-1)=1$$ and $$y(-2)=3$$ and I have no idea how I'm even supposed to calculate that, I'm assuming it has something to do with the Unilateral LaPlace Transform, but I'm very new to this and I don't even know how to start.
  
  • You're dealing with a discrete-time system here, so you have to use the Z-transform instead of the Laplace transform. A delay by one sample corresponds to multiplication with $z^{-1}$. But you should really read up a bit on the Z-transform, and then come back with questions if you have any. Commented Jan 17, 2023 at 12:42
  • Good practice is to use square brackets for discrete signals, $x[n], n \in \mathbb{Z}$ and round brackets for time continuous signals $x(t), t \in \mathbb{R}$ Commented Jan 17, 2023 at 13:21
  • Try letting $z = e^s$; see if things start looking sensible. Commented Jan 17, 2023 at 20:13
  
  Almost there.
  
  ##### Transfer function
  
  Let's do it in the $$\mathcal{Z}$$-domain: $$H(z) = \frac{4-2z^{-1}}{1-3z^{-1}+2z^{-2}}$$ Now multiply denominator and numerator by $$z^2$$ and you get the transfer function you're looking for.
  
  ##### Initial Conditions
  
  Recall the unit step function: $$u[n] = \begin{cases} 0, &n < 0\\ 1, &n \geq 0 \end{cases}$$ Let's use your difference equation (notice, as per @Hilmar's comment, I'm using square brackets to indicate a discrete signal): $$y[n]-3y[n-1]+2y[n-2]=4x[n]-2x[n-1]$$
  
  1. Using $$x[n] = u[n]$$ defined above, let's compute the difference equation for $$n=0$$ and substitute to satisfy $$y[0] = 1$$. You should get: \begin{align}y[0] - 3y[-1] + 2y[-2] &= 4x[0] - 2x[-1]\\ -3 &=3y[-1] -2y[-2] \tag{1}\end{align}
  
  2. Compute for $$n=1$$ and substitute to satisfy $$y[1] = 3$$ (you'll also substitute $$y[0] = 1$$). You arrive at (I'll let you do this one): \begin{align}y[1] - 3y[0] + 2y[-1] &= 4x[1] - 2x[0]\\ 1 &= y[-1] \tag{2}\end{align}
  
  3. Finally, substitute (2) into (1) and solve for $$y[-2]$$
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document contains a detailed discussion of a discrete-time LTI system, including the derivation of its transfer function and the determination of initial conditions for a specific response. The text includes a question about the correct form of the transfer function and another question about the initial conditions required to achieve a specific response to a unit step function. The document also includes comments and a detailed solution to the initial conditions problem.
  
  Label: multiple-question-and-answer