Advertisement
Guest User

FSK Constellations

a guest
Dec 15th, 2012
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.70 KB | None | 0 0
  1. % Plot a theoretical binary FSK constellation
  2. t = linspace(0,2*pi,100);
  3.  
  4. % change these f's to look at orthoganality
  5. f1 = 100;
  6. f2 = 200;
  7. basis = [cos(2*pi*t*f1); cos(2*pi*t*f2)] ;
  8.  
  9. symbols = basis;
  10.  
  11. constellation = zeros(1,2);
  12. constellation(1) = sum(symbols(1,:).*basis(1,:));
  13. constellation(1) = constellation(1) + j*sum(symbols(1,:).*basis(2,:));
  14. constellation(2) = sum(symbols(2,:).*basis(1,:));
  15. constellation(2) = constellation(2) + j*sum(symbols(2,:).*basis(2,:));
  16.  
  17. vector_angles = angle(constellation)*180/(pi)
  18. fprintf('The first symbol has vector angle %2.1f\n',vector_angles(1));
  19. fprintf('The second symbol has vector angle %2.1f\n',vector_angles(2));
  20.  
  21. figure();
  22. plot(constellation, 'o');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement