Advertisement
makispaiktis

Course 2 - AWGN Channel

Aug 23rd, 2023
817
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.61 KB | None | 0 0
  1. clear all
  2. close all
  3. clc
  4.  
  5. % 1. Simulation parameters
  6. numBits = 20000
  7. modOrder = 16  
  8. srcBits = randi([0, 1], numBits, 1);
  9.  
  10. % 2. QAM Modulation ---> 5 symbols with 4 bits and unit average power (for SNR)
  11. modOut = qammod(srcBits, modOrder, "InputType", "bit", "UnitAveragePower", true);
  12.  
  13. % 3. AWGN Channel (20 dB for an ideal channel)
  14. SNR = 15;   % dB
  15. chanOut = awgn(modOut,SNR);
  16.  
  17. % 4. Scatter plot to see the 5000 received symbols
  18. scatterplot(chanOut)
  19.  
  20. % 5. QAM Demodulation ---> 20000 bits
  21. demodOut = qamdemod(chanOut,modOrder,"OutputType","bit","UnitAveragePower",true);
  22. check = isequal(srcBits,demodOut)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement