Goertzel in sinc2 Mode
wummi
Posts: 32
in Propeller 2
Hi,
how to reset the 1st stage Accus SIN_MUL and COS_MUL in sinc2 Mode between to cycle.
I want to multiplex between 2 Input Pins between 2 cycles.
Example:
repeat
Generate 50 sin cycles on pin 0 and Goertzel accumulation on pin 1
Generate 50 sin cycles on pin 2 and Goertzel accumulation on pin 3
In sinc1 Mode this worked perfectly.
I think in sinc2 Mode i must clear the 1st stage Accus when i change the input pin.
how to reset the 1st stage Accus SIN_MUL and COS_MUL in sinc2 Mode between to cycle.
I want to multiplex between 2 Input Pins between 2 cycles.
Example:
repeat
Generate 50 sin cycles on pin 0 and Goertzel accumulation on pin 1
Generate 50 sin cycles on pin 2 and Goertzel accumulation on pin 3
In sinc1 Mode this worked perfectly.
I think in sinc2 Mode i must clear the 1st stage Accus when i change the input pin.
Comments
I haven't looked into what the streamers are doing there, but I'm pretty certain they rely on smartpins for the sinc2 filter function so all you need to do is switch the streamer between two sets of smartpins that are both running non-stop in sinc2 mode.
The 2nd stage accus has 32 Bit, how many bits has the 1st stage accus?
And how to clear the 1st stage accus?
Maybe changing modes could reset both stages together, dunno. It won't help anyway. You have no choice but to wait for two sample periods before accepting validity of data. And that's assuming you're switching input pin on the sample edge. If the switching is not sync'd up to that then best to give it a third sample period.