Shop OBEX P1 Docs P2 Docs Learn Events
Goertzel in sinc2 Mode — Parallax Forums

Goertzel in sinc2 Mode

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.

Comments

  • evanhevanh Posts: 15,192
    Resetting won't help because sinc2 gets its performance from a two stage accumulation. It needs that second cycle. Your only option to retain that improved signal is let it double cycle before taking a sample.
  • evanhevanh Posts: 15,192
    edited 2020-05-11 04:52
    Well, that said, the other option is use two sinc2 filters in parallel so that they aren't being switched between two inputs.
    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.

  • evanhevanh Posts: 15,192
    Oh, just started reading about that streamer mode. Looks fancier than I expected, the sincX filtering is done in the streamer. Which means my second post certainly doesn't apply since smartpins are not involved. Looks like my first post holds true.
  • More questions,
    The 2nd stage accus has 32 Bit, how many bits has the 1st stage accus?
    And how to clear the 1st stage accus?
  • evanhevanh Posts: 15,192
    Both are same size. This is something we actually tried during development. It results in a signal degradation if any truncating is done. Each bit of truncation in stage-1 accumulator adds a coarseness, like quantisation.

    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.

Sign In or Register to comment.