Page 1 of 1

Control smoothing LPF

Posted: Sat Mar 29, 2014 7:20 am
by Digital Larry
I am pretty sure that from a point of theoretical DSP purity, low pass filters built using the "RDFX" instruction would generally be of the form:

Code: Select all

RDFX 33,factor
WRAX 33,(1 - factor)
However, in most supplied Spin examples, since factor is much smaller than 1 for many cases, (1 - factor) is simply replaced by 1.0. I'm sure the response is not very far off. But why not make it correct?

Posted: Sat Mar 29, 2014 10:45 am
by frank
Because where you have the (1-factor) is not actually part of the filter, it is to write the result to a register and keep the result in the acc.

Edit: To expand on this, RDFX is basically executing:
Y(n) = (X(n) - (Y(n-1))*C + Y(n-1)
which has no DC gain because if X(n) is a constant then Y(n) -> X(n)

Posted: Sat Mar 29, 2014 12:16 pm
by Digital Larry
Ah-ha! I think I get it. I'll have to let it ferment for awhile 8^).

Thanks!