Problems with Matlab Projects? You may face many Problems, but do not worry we are ready to solve your Problems. All you need to do is just leave your Comments. We will assure you that you will find a solution to your project along with future tips. On Request we will Mail you Matlab Codes for Registered Members of this site only, at free service...Follow Me.

MATLAB difference equation

Summary: How to write a simple looping difference equation in MATLAB.




Difference equations are usually expressed in software with for loops. A MATLAB program that would compute the first 1000 values of the output has the form
for n=1:1000
y(n) = sum(a.*y(n-1:-1:n-p)) + sum(b.*x(n:-1:n-q));
end
An important detail emerges when we consider making this program work; in fact, as written it has (at least) two bugs. What input and output values enter into the computation of y(1) ? We need values for y(0),y(1), , values we have not yet computed. To compute them, we would need more previous values of the output, which we have not yet computed. To compute these values, we would need even earlier values, ad infinitum. The way out of this predicament is to specify the system's initial conditions: we must provide the p output values that occurred before the input started. These values can be arbitrary, but the choice does impact how the system responds to a given input. One choice gives rise to a linear system: Make the initial conditions zero. The reason lies in the definition of a linear system: The only way that the output to a sum of signals can be the sum of the individual outputs occurs when the initial conditions in each case are zero.

EXERCISE 1

The initial condition issue resolves making sense of the difference equation for inputs that start at some index. However, the program will not work because of a programming, not conceptual, error. What is it? How can it be "fixed?"

0 comments:

Post a Comment

Recent Comments

Popular Matlab Topics

Share your knowledge - help others

Crazy over Matlab Projects ? - Join Now - Follow Me

Sites U Missed to Visit ?

Related Posts Plugin for WordPress, Blogger...

Latest Articles

Special Search For Matlab Projects

MATLAB PROJECTS

counter

Bharadwaj. Powered by Blogger.