The conditional statements of 2-PAM,8PAM and 16PAM
4 views (last 30 days)
Show older comments
I take this: https://www.mathworks.com/matlabcentral/fileexchange/19587-symbol-error-rate-in-4-pam-modulation as a reference to write the code of 2-PAM,8PAM and 16PAM,but i am not sure why do we need to use the -2/sqrt(5) to be a boundary to decide which is -3 or 3 or -1 or 1 instead of using -1/sqrt(5) or -3/sqrt(5)
ipHat(find(r< -2/sqrt(5))) = -3;
ipHat(find(r>= 2/sqrt(5))) = 3;
ipHat(find(r>=-2/sqrt(5) & r<0)) = -1;
ipHat(find(r>=0 & r<2/sqrt(5))) = 1;
So,i want to ask someone to tell is my conditional statements of 2-PAM,8PAM and 16PAM right or wrong.
2PAM:
receiver_constellation( find(receiver< 0/sqrt(1) ) )= -1;
receiver_constellation( find(receiver>= 0/sqrt(1)) ) = 1;
8PAM:
receiver = real(complx_receiver); % taking only the real part
receiver_constellation(find(receiver< -6/sqrt(21))) = -7;
receiver_constellation(find(receiver>= -6/sqrt(21) & receiver<-4/sqrt(21))) = -5;
receiver_constellation(find(receiver>= -4/sqrt(21) & receiver<-2/sqrt(21))) = -3;
receiver_constellation(find(receiver>= -2/sqrt(21) & receiver<0)) = -1;
receiver_constellation(find(receiver>= 0 & receiver<2/sqrt(21))) = 1;
receiver_constellation(find(receiver>= 2/sqrt(21) & receiver<4/sqrt(21))) = 3;
receiver_constellation(find(receiver>= 4/sqrt(21) & receiver<6/sqrt(21))) = 5;
receiver_constellation(find(receiver>= 6/sqrt(21))) = 7;
16PAM:
receiver = real(complx_receiver); % taking only the real part
receiver_constellation (find(receiver< -14/sqrt(10.5000))) = -15;
receiver_constellation( find(receiver>= -14/sqrt(10.5000) & receiver<-12/sqrt(10.5000)) ) = -13;
receiver_constellation(find(receiver>= -12/sqrt(10.5000) & receiver<-10/sqrt(10.5000))) = -11;
receiver_constellation(find(receiver>= -10/sqrt(10.5000) & receiver<-8/sqrt(10.5000))) = -9;
receiver_constellation(find(receiver>= -8/sqrt(10.5000) & receiver<-6/sqrt(10.5000))) = -7;
receiver_constellation(find(receiver>= -6/sqrt(10.5000) & receiver<-4/sqrt(10.5000))) = -5;
receiver_constellation(find(receiver>= -4/sqrt(10.5000) & receiver<-2/sqrt(10.5000))) = -3;
receiver_constellation(find(receiver>= -2/sqrt(10.5000) & receiver<0)) = -1;
receiver_constellation(find(receiver>= 0 & receiver< 2/sqrt(10.5000))) = 1;
receiver_constellation(find(receiver>= 2/sqrt(f10.5000) & receiver<4/sqrt(10.5000))) = 3;
receiver_constellation(find(receiver>= 4/sqrt(10.5000) & receiver<6/sqrt(10.5000))) = 5;
receiver_constellation(find(receiver>= 6/sqrt(10.5000) & receiver<8/sqrt(10.5000))) = 7;
receiver_constellation(find(receiver>= 8/sqrt(10.5000) & receiver<10/sqrt(10.5000))) = 9;
receiver_constellation(find(receiver>= 10/sqrt(10.5000) & receiver<12/sqrt(10.5000))) = 11;
receiver_constellation(find(receiver>= 12/sqrt(10.5000) & receiver<14/sqrt(10.5000))) = 13;
receiver_constellation(find(receiver>= 14/sqrt(10.5000))) = 15;
Hoping someone can tell me,thanks a lot
0 Comments
Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!