Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement