0% found this document useful (0 votes)
14 views2 pages

Impulse Response and MATLAB Solution

The document presents the solution to a system described by a difference equation, deriving the unit impulse response h(n) as h(n) = 1 for n = 0 and h(n) = (½)ⁿ⁻¹ for n ≥ 1. It also includes MATLAB code to compute the output of the system for a given input, showing the resulting values of y(n). The output values demonstrate the system's response over ten time steps.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Impulse Response and MATLAB Solution

The document presents the solution to a system described by a difference equation, deriving the unit impulse response h(n) as h(n) = 1 for n = 0 and h(n) = (½)ⁿ⁻¹ for n ≥ 1. It also includes MATLAB code to compute the output of the system for a given input, showing the resulting values of y(n). The output values demonstrate the system's response over ten time steps.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Problem 4 Solution

(1) Unit Impulse Response h(n)

The system is described by:

y(n) - ½ y(n-1) = x(n) + ½ x(n-1)

Solving recursively with x(n) = δ(n) and initial rest conditions:

n = 0: y(0) - ½ y(-1) = δ(0) + ½ δ(-1)


y(0) = 1 ⇒ h(0) = 1

n = 1: y(1) - ½ y(0) = δ(1) + ½ δ(0)


y(1) - ½ = ½ ⇒ h(1) = 1

n ≥ 2: y(n) - ½ y(n-1) = 0
y(n) = ½ y(n-1) ⇒ h(n) = (½)ⁿ⁻¹

Final Impulse Response:

h(n) = 1 for n = 0
h(n) = (½)ⁿ⁻¹ for n ≥ 1

---

(2) MATLAB Solution

MATLAB Code:

```
b = [1, 0.5];
a = [1, -0.5];
x = [1, zeros(1, 9)];
zi = filtic(b, a, 0, 0);
y = filter(b, a, x, zi);
disp('y(n) ='); disp(y);
```

Output:

```
y(n) =
1.0000
1.0000
0.5000
0.2500
0.1250
0.0625
0.0313
0.0156
0.0078
0.0039
```

You might also like