[Kst] extragear/graphics/kst/plugins/discretizing_filters
Nicolas Brisset
nicolas.brisset at eurocopter.com
Tue Dec 13 12:59:15 CET 2005
SVN commit 488146 by brisset:
Fix remaining bug. Now, it works... If only we could have custom widgets in the plugin interface, this would allow for more convenient filter characteristics input than transfer functions :-)
M +4 -6 filter.h
--- trunk/extragear/graphics/kst/plugins/discretizing_filters/filter.h #488145:488146
@@ -84,15 +84,13 @@
//------------------------------------------------------------------------------
template<class S> void filter<S>::NextTimeStep()
{
- // intermediate output (with new input, but just before clock)
- S iOut = (x[n-1] + *in * Nz[n])/ Dz[n];
+ // Compute output
+ out = (x[n-1] + *in * Nz[n])/ Dz[n];
// update state vector x[0] .. x[n-1] (goes from output to input)
for (int i=n-1; i>0; i--) {
- x[i] = x[i-1] + Nz[i]*(*in) - Dz[i]*iOut;
+ x[i] = x[i-1] + Nz[i]*(*in) - Dz[i]*out;
}
- x[0] = Nz[0]*(*in) - Dz[0]*iOut;
- // output
- out = (x[n-1] + Nz[n]*(*in)) / Dz[n];
+ x[0] = Nz[0]*(*in) - Dz[0]*out;
}
//------------------------------------------------------------------------------
template<class S> filter<S>::~filter()
More information about the Kst
mailing list