clear all
fs = 2e+6;       						% sampling rate (samples/second) 
sr = 1e+5;  						% symbol rate (symbols/second) 
fc=2e+5;                                %ÔØ²¨ÆµÂÊ
Ts = 1/fs; 								% sampling period 
Td = 1/sr;						% symbol period 
m = fs/sr;				% samples per symbol 
nd=1000;                        % number of data
loop=10;
count1=0;
count2=0;
count3=0;
SNRMIN=-20;
SNRMAX=5;
s=SNRMIN:1:SNRMAX;
 jj=0;
 for SNR=s
    count1=0;
    for ii=1:loop
       qpskout=qpskgenerate(nd,fs,sr,fc,SNR);
     if iden2(qpskout)==1
         count1=count1+1;
     end
    end
    jj=jj+1;
    idrate1(jj)=count1/loop;
end
jj=0;
for SNR=s
   count2=0;
   for ii=1:loop
      oqpskout=oqpskgenerate(nd,fs,sr,fc,SNR);
    if iden2(oqpskout)==2
        count2=count2+1;
    end
   end
   jj=jj+1;
   idrate2(jj)=count2/loop;
end
jj=0;
for SNR=s
   count3=0;
   for ii=1:loop
      uqpskout=uqpskgenerate(nd,fs,sr,fc,SNR);
    if iden2(uqpskout)==3
        count3=count3+1;
    end
   end
   jj=jj+1;
   idrate3(jj)=count3/loop;
end
idrate1
idrate2
idrate3
%subplot(3,1,1)
%plot(s,idrate1)
%subplot(3,1,2)
%plot(s,idrate2)
%subplot(3,1,3)
%plot(s,idrate3)