is this matlab code of 8psk ??

l=100000; %L length of si the input one dimension array
nni=randn(1,l);%generate L by L array of random scalare
si=randsrc(1,l,[+1,-1;.5,.5]);%generate 1 by L array of -1&+1
snr=[0:15];
for i=1:16
errorcounter=0;
stdn=sqrt(10^(-snr(i)/10))
ni=nni*stdn;% ni is 1 by L dimension
for m=1:l
ri(m)=ni(m)+si(m);
if ri(m)>0
sdi(m)=1;
elseif ri(m)<=0
sdi(m)=-1;
end
if sdi(m)~=si(m)
errorcounter=errorcounter+1;
end
end
ber(i)=errorcounter/l
end
semilogy(snr,ber,'r','LineWidth',2)
xlabel('snr db');ylabel('ber');grid;

댓글 수: 5

mary
mary 2013년 3월 2일
can anyone help??
Image Analyst
Image Analyst 2013년 3월 2일
What is 8psk?
mary
mary 2013년 3월 2일
8 phase shift key modulation
Rick Rosson
Rick Rosson 2013년 3월 2일
  1. Please use proper indentation in your code.
  2. Please do not use lower-case l as a variable. It looks almost the same as the numeral 1 and is very confusing. Use upper-case L instead.
  3. Please add comments explaining what each variable represents.
Thanks.
mary
mary 2013년 3월 2일
okay thanks for the notes

댓글을 달려면 로그인하십시오.

 채택된 답변

Rick Rosson
Rick Rosson 2013년 3월 2일
편집: Rick Rosson 2013년 3월 2일

0 개 추천

No. As far as I can tell, this code is BPSK, not 8PSK. Also, there are several mistakes in the code.

댓글 수: 4

mary
mary 2013년 3월 2일
thank you .. well can you plz give me an 8psk code .. i cant find one >> does the 8psk code also have inphase and quadrature symbols .. as far as i know it uses two qpsk is that right??
Walter Roberson
Walter Roberson 2013년 3월 2일
I get the impression that you are supposed to write the 8psk code, not copy it from someone else.
mary
mary 2013년 3월 2일
i just wanna understand how 8psk works .. an explination not matlab code .. but the code helps me to understand faster thats why i asked for a code ..
Walter Roberson
Walter Roberson 2013년 3월 2일
File Exchange.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

태그

질문:

2013년 2월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by