<< Chapter < Page | Chapter >> Page > |
The samples form a sequence of numbers that represent an underlying continuousvalued function at the time instants . The sampling interval is presumed to have been chosen so that the sampling rate where is the highest frequency present in . The Nyquist sampling theorem presented in "Sampling and Aliasing" states that the values of can be recovered exactly at any time . The formula (which is justified subsequently) for recovering from the samples is
where (defined in [link] ) is zero everywhere except at the sampling instants . Substituting [link] into shows that this integral is identical to the sum
In principle, if the sum is taken over all time, the value of is exact. As a practical matter, the sum must be taken over a suitable (finite) time window.
To see why interpolation works, note that the formula [link] is a convolution (in time) of the signal and the sinc function. Since convolution in time is the same as multiplicationin frequency by [link] , the transform of is equal to the product of and the transform of the sinc.By [link] , the transform of the sinc function in time is a rect function in frequency.This rect function is a lowpass filter, since it passes all frequencies below and removes all frequencies above. Since the process of sampling acontinuous time signal generates replicas of the spectrum at integer multiples of by [link] , the lowpass filter removes all but one of these replicas.In effect, the sampled data is passed through an analog lowpass filter to create a continuous-time function, and the value ofthis function at time is the required interpolated value. When , then , and for all with . When is between sampling instants, the sinc is nonzero at all , and [link] combines them to recover .
To see how
[link] works, the following code generates
a sine wave
w
of frequency 20 Hz with a sampling rate of 100 Hz.
This is a modestly sampled sine wave, having only five samples perperiod, and its graph is jumpy and discontinuous. Because the
sampling rate is greater than the Nyquist rate, it is possible inprinciple to recover the underlying smooth sine wave from which
the samples are drawn. Running
sininterp.m
shows that it is
also possible in practice. The plot in
[link] shows the original wave (which appears choppy because it is
sampled only five times per period), and the reconstructedor smoothed waveform (which looks just like a sine wave).
The variable
intfac
specifies how
many extra interpolated points are calculated, and need not be an integer. Largernumbers result in smoother curves but also require more computation.
f=20; Ts=1/100; time=20; % freq, sampling interval, and time
t=Ts:Ts:time; % time vectorw=sin(2*pi*f*t); % w(t) = a sine wave of f Hertz
over=100; % # of data points to use in smoothingintfac=10; % how many interpolated points
tnow=10.0/Ts:1/intfac:10.5/Ts; % smooth/interpolate from 10 to 10.5 secwsmooth=zeros(size(tnow)); % save smoothed data here
for i=1:length(tnow) wsmooth(i)=interpsinc(w,tnow(i),over);
end % and loop for next point
sininterp.m
demonstrate
interpolation/reconstruction using sin wave
(download file)
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?