# How to construct an unknown signal from sparse periodic samples?

I have an unknown black-box that is generating a deterministic continuous periodic signal and the period is variable between 1 to 30 seconds.

1. When the black box is turned on, the period is fixed, but unknown.
2. Sampling rate and signal period are not synched, and it is highly unlikely to be integer coefficient of one another.

All that is available to me is sparse (contains missed) samples with period of 100 ms to 10 ms. (The parameter of source is fixed every time, for example I should construct a 3s signal from periodic 10ms samples). There is no limit on the duration of sample gathering but samples may be missed. Signal is smooth and does not change fast and slowest sampling rate satisfies nyquist rate.

Is there a method to construct a single period of signal and enhance its resolution as time goes by?

• Your sampling rates are quite high. Nyquist is happy, and the only problem is missed samples. If samples go missing randomly and with low probability, a sinc-interpolator might still work. – Atul Ingle Dec 24 '12 at 17:28
• so each time you turn on the black box, the period is fixed somewhere between 1 and 30 but you don't know what it is? Or the period can slowly vary over time within that range? – endolith Dec 24 '12 at 18:28
• The Nyquist criterion may not be satisfied. It is possible to construct a continuous signal exactly periodic every 10 seconds using only spectrum above 100 Hz. Is the sparse sampling highly random in time/interval, or is it synchronized to any sort of periodic clock? – hotpaw2 Dec 25 '12 at 1:22
• @hotpaw2 is quite correct. Do you know anything about the bandwidth of the signal being produced by the black box? – Dave Tweed Dec 26 '12 at 1:33

Nonuniform Sampling

Assuming you know what the actual sampling rate is, and exactly which samples are missed, it is possible to reconstruct the signal over a time interval T as long as the bandwidth W of the signal still satisfies the Nyquist criterion: W < N/T/2, where N is the number of samples you do have.

Visualize it this way: A signal of bandwidth W over a time interval T can be decomposed into a linear combination of N sinc functions (sinc is shorthand for sin x/x), where N = 2×W×T. The sinc functions are equally spaced over the interval in question and their widths are all the same. At the instant where each sinc pulse reaches its peak, all of the other sinc functions have a value of zero. If you sample the signal at the instants corresponding to the peaks of the sinc functions (tA0, tA1 and tA2), each sample directly yields the amplitude of the corresponding sinc pulse (A0, A1 and A2). The original signal can be reconstructed by creating new sinc pulses of the correct amplitudes and overlaying them, usually by using a digital or analog filter with the correct brick-wall frequency response. The reconstructed signal will be described by the equation:

Signal(t) = A0 sinc (t – tA0) + A1 sinc (t – tA1) + A2 sinc (t – tA2)

If you take N samples of the signal at other instants, each sample will be a linear combination of all of the sinc functions. Each sinc pulse will contribute an amount to the sample based on the time interval between the sample and the center of the sinc pulse. It is still possible to calculate the amplitudes of the sinc pulses, but now it is necessary to solve a solve a system of linear equations in order to do so. If you have samples B1, B2 and B3 taken at times tB1, tB2 and tB3 as shown above, you can write the following equations:

B1 = A0 sinc (tB1 – tA0) + A1 sinc (tB1 – tA1) + A2 sinc (tB1 – tA2)

B2 = A0 sinc (tB2 – tA0) + A1 sinc (tB2 – tA1) + A2 sinc (tB2 – tA2)

B3 = A0 sinc (tB3 – tA0) + A1 sinc (tB3 – tA1) + A2 sinc (tB3 – tA2)

Given that you know B1, B2 and B3, and all of the time values, it's a straightforward matter to solve this system for A0, A1 and A2. Once you have these coefficients, you can plug them into the reconstruction equation given previously to reconstruct the original signal.

Note that in the above explanation, I have implicitly assumed that the uniform sampling interval (tA1 – tA0) equals π, in order to simplify the diagrams and equations. The same argument holds for other sampling intervals (and bandwidths) as well.

Averaging Multiple Periods

Using multiple periods of the signal to improve the reconstruction requires that you can precisely correlate those periods in the time tomain. Once you have done the reconstruction described above, it should be possible to precisely locate features such as peaks and zero-crossings, even if these features fall between samples. Use this information to time-align multiple periods so that they can be averaged together to reduce errors such as noise, quantization error or timing jitter.

Imagine that you have many periods of the waveform plotted on a long strip chart. Now cut the strip chart into pieces and shuffle them. The task is to reconstruct one period of the waveform from the pieces. That can be attempted by finding the two pieces with maximum overlap, combining them into one, deleting the original two pieces, and repeating. The algorithm terminates when only one piece remains.

Not sure this is the same problem, but thought it might stimulate some ideas.