Effacer les filtres
Effacer les filtres

The conditional statements of 2-PAM,8PAM and 16PAM

2 vues (au cours des 30 derniers jours)
yang-En Hsiao
yang-En Hsiao le 22 Avr 2019
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

Réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by