
% Demo of continuous-time interpolation
% Last revised 9/26/00 - rms

% TRY TO ADD RECONSTRUCTION WITH SOME OTHER SAMPLE RESPONSE (EXPONENTIAL?)

close all
load mtlb;
hold off
m = mtlb;
fs = 7000;	% sampling freq for the Matlab utterance
x = (mtlb(3050:3070));
n = 0:20;
subplot(2,1,1),stem(n,x)
hold on
pause
axis([0 20 -1 2])


% Interpolate with exact sinc function
t=-20:.1:20;
csinc = sinc(t);
y = zeros(21,401);
t0 = 0:.1:20;

for center = 0:20

% Updating upper panel
y(center+1,:) = x(1+center)*sinc(t-center);
subplot(2,1,1),plot(t,x(1+center)*sinc(t-center),'k')
axis([0 20 -1 2])
hold on

% Updating lower panel
subplot(2,1,2), stem(n,x)
axis([0 20 -1 2])
hold on

temp = y(1:center+1,:);
temp = sum(temp,1);

subplot(2,1,2),plot(t0,temp(201:401),'r')
hold off

pause

end

% IN THE FUTURE, REPEAT, BUT WITH AN INEXACT SINC FUNCTION!!!
