1
$\begingroup$

Imagine a black box which accepts a digital input signal which is a pure sine wave and outputs the area between this input signal and some constant data set over a sample window.

diagram

Given the input and output signals, is it possible to determine the sample data set?

Edit: Here is how the box calculates area between two data points...

    private double areaBetween(double a, double b)
    {
        if (Math.Sign(a) == Math.Sign(b))
        {
            if (Math.Abs(a) > Math.Abs(b))
                return a - b;
            else
                return b - a;
        }
        else
        {
            return a + b;
        }
    }
$\endgroup$
3
  • $\begingroup$ It appears you are outputting the signed area. In the figure, it looks like the areas above and below the green curve are equal and the output is zero. Is that correct? Also, am I given the length of the sample window? $\endgroup$ Mar 7, 2013 at 21:32
  • $\begingroup$ If it is possible to determine without knowing the window length, this would be preferable. $\endgroup$ Mar 7, 2013 at 21:38
  • $\begingroup$ Area which lies above the x-axis is considered positive, and negative if it lies below. $\endgroup$ Mar 8, 2013 at 1:33

1 Answer 1

3
$\begingroup$

Since integrals are additive, your output is really just the integral of the green input signal over the sample window, minus the integral of the blue sample signal over the same sample window.

The blue integral is constant, and is the only way the sample signal influences your output. So all you can learn about the blue signal from observing the black-box relation between the green and red signals is what the average value of the blue signal is -- that is, in this case, $0$.

(On the other hand, this is also all you need to reconstruct the behavior of the black box for a different input signal, if that is what you're ultimately interested in).

$\endgroup$
7
  • $\begingroup$ Well done. I was trying to make this into Fourier analysis but was just seeing we need the output to be the product of the two curves for that. $\endgroup$ Mar 7, 2013 at 21:47
  • $\begingroup$ The integral of both the green and blue signal is zero over the window at any given time (in the case of the diagram), however the output is not 0, it is a sawtooth wave. Don't the intersections between the two functions complicate your explanation? $\endgroup$ Mar 7, 2013 at 21:57
  • $\begingroup$ @MadisonBrown: Your example output doesn't look very sawtoothy. But neither does it look like what you ought to be getting as far as I understand your description -- so I may be misunderstanding something. Is it perhaps a result of integrating over only some of the sample window at the beginning, rather than extending the green signal with zeroes to the left of its starting point? $\endgroup$ Mar 7, 2013 at 22:02
  • $\begingroup$ i45.tinypic.com/2lxxms4.png here is a screenshot of the application i created to test this. The input signal is a sinewive. the sample function is a square wave. the window is 16 samples long. the output is seen in the blue window. $\endgroup$ Mar 7, 2013 at 22:08
  • $\begingroup$ My understanding is that the area between two curves is equal to the difference between their integrals only if the two curves do not intersect over the range you are calculating. Is this wrong? $\endgroup$ Mar 7, 2013 at 22:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .