Advertisement
stiansjogren

sos

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