1

I have an electronics project where I sample two sine waves. I would like to know what the amplitude (peak) and difference in phase is. Actually I just need to know the average product of the two waves.

A caveat I have is that the two sine waves have been rectified. (negatives cut off) Here is what I expect the samples to look like:

Samples of two rectified sine waves out of phase

I don't have much experience with signal processing. Can you recommend any reading or topics to research?

  • Is the frequency known before you take your measurement or can that vary too? I'm assuming both sine waves are the same frequency as each other but is this frequency fixed or not? – Warren Hill Dec 13 '13 at 09:17
  • yep, should be the same, fixed frequency – Matthew Sainsbury Dec 13 '13 at 09:20
  • however, the amplitude and phase may change over time – Matthew Sainsbury Dec 13 '13 at 09:38
  • Correlate the two signals and find the location of the maximum to get the lag. A simple way to find the amplitude is to upsample and then just take the max value. There are more nuanced ways of course; google will yield many options. If you just want the average product, then simply multiply the two signals and take the average. – AnonSubmitter85 Dec 16 '13 at 08:31
  • https://en.wikipedia.org/wiki/Aliasing – cactus314 Dec 14 '15 at 01:29

2 Answers2

2

You could try to use a Least Squares Estimator (ls-estimator). It can fit a curve with unknown amplitude an phase to a signal. A least squares estimator always consists of an observation matrix. In this you can "design" your "cuttet sine wave" like this (if one period of your sine wave consists of 8 samples an your signal only contains one period):

x1 = [0 0.707 1 0.707 0 0 0 0]^T

To estimate the phase (and the true amplitude) you must fit a cosine wave, too:

x2 = [0 0 0 0 0 0.707 1 0.707]^T

So you observation matrix (to estimate amplitude and phase of one sinewave with know frequency) is:

X = [x1, x2]

The formular of the least square estimator is:

b = (X^T * X)^(-1) * X^Ty

with b containing the amplitdue of the sine and the cosine wave. BTW ls-esitmator is quite powerfull an can be applied to many problems. It's worth to learn. Good look.

This paper paper shows the main ideas within the first two pages:

0

You don't even know the frequency, because of aliasing.

Here a sine wave gets undersampled two different ways.

The red curve could be made a perfect fit with Fast Fourier Transform.

enter image description here


I was worried I couldn't reproduce the sine wave with the long stretch of zeros, but discrete Fourier transform to the rescue!

enter image description here

cactus314
  • 24,438