DSP Project of Chapter 2-Including Example
DSP Project of Chapter 2-Including Example
Please upload your program and the results to the ftp site within two weeks after the
date of project assignment. The ftp site can be found at the course website.
Example
Answer:
This is actually quite simple, because the differential equation contains the body of the
The parts in bold are actually the recursive calls! What you need to do is to build a function
function y = func(x, n)
if (n < 0)
return 0
else if (n == 0)
return x(0)
else
end
Note that it's pseudo-code, so you still have to check the edge cases and deal with the
Using filters
The response of a digital filter is actually the y[n] that you're looking for. As you probably know
from lesson, the coefficients of that filter would be the coefficients specified in the differential
equation. MATLAB has a built-in function filter that emulates just that, so if you write:
y = filter(B, A, x);
You'd get an output vector which holds all the values of y[n].