stiansjogren icon

sos

stiansjogren | PRO | 05/20/16 02:38:59 PM UTC | 0 ⭐ | 622 👁️ | Never ⏰ | []
text |

500 B

|

None

|

0 👍

/

0 👎

function h = sumofsinusoids(Ts,P, w_max,m)
     psy_p = zeros(1,P);
    phi_p = zeros(1,P);
     for j =1:20
        psy_p(j)  = randnum();
        phi_p(j)  = randnum();
    end
     h  = zeros(1,m);
    for i = 1:m
        su = 0;
        for p= 0:P-1
            beta_p = power(sqrt(P),-1);
            nu_max  = w_max*Ts;
            nu_p    = nu_max * cos(psy_p(p+1));
            su = su + beta_p * exp(1i*2*pi*(phi_p(p+1) + i*nu_p));
        end
        h(i) = su;
    end
end

Comments