Advertisement
stiansjogren

sos

May 20th, 2016
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function h = sumofsinusoids(Ts,P, w_max,m)
  2.  
  3. psy_p = zeros(1,P);
  4. phi_p = zeros(1,P);
  5.  
  6. for j =1:20
  7. psy_p(j) = randnum();
  8. phi_p(j) = randnum();
  9. end
  10.  
  11. h = zeros(1,m);
  12. for i = 1:m
  13. su = 0;
  14. for p= 0:P-1
  15. beta_p = power(sqrt(P),-1);
  16. nu_max = w_max*Ts;
  17. nu_p = nu_max * cos(psy_p(p+1));
  18. su = su + beta_p * exp(1i*2*pi*(phi_p(p+1) + i*nu_p));
  19. end
  20. h(i) = su;
  21. end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement