Shop OBEX P1 Docs P2 Docs Learn Events
Phase Detection with Modulated Return Signals? — Parallax Forums

Phase Detection with Modulated Return Signals?

N8RDFN8RDF Posts: 4
edited 2015-06-28 07:59 in Propeller 1
I have (2) applications which require generating an audio frequency reference signal (<=500hz, one is digital, the other sinusoidal), then measuring the phase shift on the returned signal after external processing (both return sinusiodal). I have successfully used Beau Schwabe's PhaseDetector object with an unmodulated reference. However, in actual use, the returning signals will include the processed reference mixed with voice, music or "weak RF" audio noise. Equivalent hardware-based solutions often include active op-amp and switched capacitor filters. Is there an easier way with the Propeller? I'm not familiar enough with filter theory to apply some of the software filters described in the forums (or to know if they're even appropriate). Any assistance would appreciated.

Comments

  • Mark_TMark_T Posts: 1,981
    edited 2015-06-26 14:38
    Phase linear (FIR) low/bandpass digital filter?
  • N8RDFN8RDF Posts: 4
    edited 2015-06-27 10:01
    Can you elaborate? As I said, I'm not familiar with filter theory. Thanks.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-06-27 15:14
    Use a quadrature detector, i.e. two mixers whose 500 Hz local oscillators are 90 degrees out of phase. The "I" mixer's LO should be in phase with the reference signal. The "Q" mixer's LO would then lag that by 90 degrees. In the Prop, the counters can be used as mixers when set to logic mode (either XOR or equality). The phase shift can be computed from the outputs of the two mixers (read from the counters' PHSx registers) as
    atan2(phsQ - dt/2, phsI - dt/2), where

    dt is the sampling interval in system clocks.

    For more details about quadrature mixers, see this thread:

    -Phil
  • N8RDFN8RDF Posts: 4
    edited 2015-06-28 07:59
    Thanks Phil, I'll give it a try.
    -Gary
Sign In or Register to comment.