Want more features on Pastebin? Sign Up, it's FREE!
Guest

FSK Constellations

By: a guest on Dec 15th, 2012  |  syntax: MatLab  |  size: 0.70 KB  |  views: 95  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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');
clone this paste RAW Paste Data