%% Interpolate Signal
% Create a sinusoidal signal sampled at 1 kHz. Interpolate it by a factor of four.

t = 0:1/1e3:1;
x = sin(2*pi*30*t) + sin(2*pi*60*t);
y = interp(x,4);

%
% Plot the original and interpolated signals.

subplot(2,1,1)
stem(0:30,x(1:31),'filled','MarkerSize',3)
grid on
xlabel('Sample Number')
ylabel('Original')

subplot(2,1,2)
stem(0:120,y(1:121),'filled','MarkerSize',3)
grid on
xlabel('Sample Number')
ylabel('Interpolated')

% Copyright 2015 The MathWorks, Inc.