Thoralf Schulze wrote:
Hi everyone,
So, at the end of this lengthy post:
- is there a possibility to amend Thomas' smoothing
abstraction with a "set x"-message that would cause it to start interpolating from the x-value ? How demanding (in terms of cpu cycles) would that abstraction then be?
i don't think that you can use soemthing like "set <f>" with dsp-filters.
- if not: is there an easy-to-implement algorithm that
does non-linear smoothing of yet-unknown parameters and detects parameter jumps? My math is a bit rusty, and googling only yielded stuff regarding the interpolation of _known_ values.
now that'll be cool: doing interpolation between (however yet) unknown values. i guess this would solve many many problems.
a simple non-linear (IIR) low-pass filter is x[n]=a*x[n-1]+(1-a)*y[n] (with 0<=a<=1)
however, this filter still only works for known values to filter.
apart from that, your problem is basically about unwrapping your incoming values [0..360] to something covering all values; if you have a series that goes 0..89..188..267..356..85 you want it to become 0..89..188..267..356..445
attached is a file that unwraps degree-values. it depends on zexy's [wrap] (because this was faster to do), but you can replace wrap with something build with [%]. the basic idea is to wrap the difference between to consecutive values and sum it up again.
mfg.a.sdr IOhannes
#N canvas 408 256 699 358 10; #N canvas 0 0 450 300 unwrap 0; #X obj 139 128 f; #X obj 139 199 wrap -180 180; #X obj 139 243 t f f; #X obj 139 151 t f f; #X obj 139 175 -; #X obj 139 220 +; #X obj 139 104 inlet; #X obj 139 268 outlet; #X connect 0 0 3 0; #X connect 1 0 5 0; #X connect 2 0 7 0; #X connect 2 1 5 1; #X connect 3 0 4 1; #X connect 3 1 4 0; #X connect 4 0 1 0; #X connect 5 0 2 0; #X connect 6 0 0 0; #X restore 117 137 pd unwrap; #X floatatom 117 66 5 0 0 0 - - -; #X floatatom 117 117 5 0 0 0 - - -; #X floatatom 117 161 5 0 0 0 - - -; #X text 180 91 to get jumps; #X text 191 138 this is using zexy's [wrap] , but you can do it with core pd objects too.; #X obj 117 90 wrap 360; #X connect 0 0 3 0; #X connect 1 0 6 0; #X connect 2 0 0 0; #X connect 6 0 2 0;