Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. %% Lab5 p 1
  2.  
  3. sigBeat = makeBeatStruct(10, 1300, 13, 0, 0, 0, 5);
  4.  
  5.  
  6. %subplot(2,1, 1);
  7. plot(sigBeat.times, sigBeat.values);
  8. %subplot(2,1,2);
  9. %plotspec( xx, 8000, 1024 ), colorbar, grid on; %-- with negative frequencies
  10.  
  11.  
  12.  
  13. function sigBeat = makeBeatStruct( B, fc, fdelta, phase1, phase2, startTime, endTime )
  14. %
  15. %--- Create a structure that has all the parameters defining a beat signal as used
  16. % in Equations (3) and (4)
  17. tt = startTime: 1/8000 : endTime;
  18. sigBeat.times = tt;
  19. sigBeat.values = B*cos(2*pi*fdelta.*tt + phase1).*cos(2*pi*fc.*tt + phase2);
  20.  
  21.  
  22. sigBeat.f1 = fdelta+fc;
  23. sigBeat.f2 = fdelta-fc;
  24. sigBeat.X1 = (B/2)*(phase1+phase2);
  25. sigBeat.X2 = (B/2)*(phase1-phase2);
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement