Function File: [y, h] = fracshift (x, d)
Function File: y = fracshift (x, d, h)

Shift the series x by a (possibly fractional) number of samples d. The interpolator h is either specified or either designed with a Kaiser-windowed sinecard.

See also: circshift.

Demonstration 1

The following code

 N = 1024;
 t = linspace (0, 1, N).';
 x = exp(-t.^2/2/0.25^2).*sin(2*pi*10*t);

 dt = 0.25;
 d  = dt / (t(2) - t(1));
 y = fracshift(x, d);

 plot(t,y,'r-;shifted;', t, x, 'k-;original;')
 axis tight
 xlabel ('time')
 ylabel ('signal')

Produces the following figure

Figure 1

Package: signal