Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. f=10e6; % signal's frequency
  2. fs=1e9; % sampling frequency
  3. t=0:1/fs:20/f1-1/fs; % time vector
  4. x=sin(2*pi*f*t); % sinusoidal signal
  5.  
  6. % upsampling by a factor of 8
  7. x1=upsample(x,8);
  8. % filtering
  9. filt=[1,2,1,2,1,2,1,2,1]/2; %triangular impulse response
  10. foh=conv(x1,filt,'same');
  11.  
  12. %scale time axis
  13. nt=0:1/(8*fs):20/f-1/(8*fs); % scaled time vector
  14.  
  15. %plot reconstructed signal
  16. plot(nt,foh)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement