I have a sinusoidal signal x(t) sampled with period 1/fs. The result is the discrete signal x[n], where x[n]=x(t)|t=nT. Then I perform an upsampling of factor, let's say, 8 to increase the sampling frequency by a factor of 8. Here's the code in matlab syntax:
f=10e6; % signal's frequency fs=1e9; % sampling frequency t=0:1/fs:20/f1-1/fs; % time vector x=sin(2*pi*f*t); % sinusoidal signal % upsampling by a factor of 8 x1=upsample(x,8); % filtering filt=[1,2,1,2,1,2,1,2,1]/2; %triangular impulse response foh=conv(x1,filt,'same'); %scale time axis nt=0:1/(8*fs):20/f-1/(8*fs); % scaled time vector %plot reconstructed signal plot(nt,foh)
Now after running the above code I get the following plot as the output of the reconstructed signal, which doesn't appear to be a sinusoidal anymore,
This more looks like a predictive first-order hold than a basic one. There seems to be something wrong with my filtering scheme but don't know how to fix that to get a basic FOH response.