Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. % Define parameters
  2. Fs = 10; % Sampling Frequency
  3. Ts = 1/Fs; % Sampling Period
  4. N = 32; % Total Number of Samples
  5. n = 0:N-1; % Samples
  6. t = Ts*(n); % Sampled times
  7.  
  8. y = cos(2*pi*t); % Discrete signal
  9. % Plot the signal and its discrete counter-part
  10. figure
  11. stem(t,y,'filled')
  12. hold on;
  13. % The 'continuous signal' (interpolated and highly sampled signal)
  14. plot(linspace(min(t),max(t),length(0:.01:max(t))),cos(2*pi*(0:.01:max(t))))
  15. title(['Sampled Signal with Fs = ',num2str(Fs)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement