Guest User

Untitled

a guest
Jan 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. N = 64;
  2. n = 0:N-1;
  3. phi1 = 2*(rand-0.5)*pi;
  4. omega1 = pi/6;
  5. phi2 = 2*(rand-0.5)*pi;
  6. omega2 = 5*pi/6;
  7. w = randn(1,N); % noise
  8. x = 2*exp(1i*(n*omega1+phi1))+4*sin(n*omega2+phi2);
  9. h = rectwin(N).';
  10. x = x.*h;
  11. X = abs(fft(x));
  12.  
  13. f = f = Fs/Nsamples*(0:Nsamples/2-1); % Prepare freq data for plot
Add Comment
Please, Sign In to add comment