Skip to content
Discussion options

You must be logged in to vote

Yes, the second recurrence is the correct one.

Starting from

U(z)   31.5 z - 28.5
---- = -------------
E(z)       z - 1

divide both numerator and denominator by z. This does not change the transfer function; it only rewrites it using the unit-delay operator:

U(z)   31.5 - 28.5 z^-1
---- = -----------------
E(z)       1 - z^-1

Cross-multiplying gives

U(z)(1 - z^-1) = E(z)(31.5 - 28.5 z^-1)

and therefore

u[n] - u[n-1] = 31.5 e[n] - 28.5 e[n-1]

so the implementation is

u[n] = u[n-1] + 31.5 e[n] - 28.5 e[n-1]

The first recurrence in the question is not equivalent: it swaps the current and previous error coefficients and changes their signs.

A minimal floating-point update would look like:

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by oneEclipseUser1
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants