function out=oqpskgenerate(nd,fs,sr,fc,SNR)       
data1=rand(1,nd*2)>0.5;
m = fs/sr;
Ts = 1/fs;
[ich,qch]=symgenerator(data1,nd);
ich1=sample(ich,m);
qch1=sample(qch,m);
ich2=ich1(m/2+1:nd*m);
qch2=qch1(1:nd*m-m/2);
n2=0:length(ich2)-1;
w=cos(2*pi*fc*n2*Ts)+i*sin(2*pi*fc*n2*Ts);
oqpskout=ich2+i*qch2;
oqpskout1=(w.*oqpskout);
%oqpskout0=real(w.*oqpskout);
%f2=(fs/(length(n2))).*n2;
%figure(1);
%plot(n,abs(fft(oqpsk)));
oqpskout2=awgn(oqpskout1,SNR);
out=oqpskout2;
%figure(2);
%plot(real(oqpskout),imag(oqpskout),'*'); 
%axis([-4,4,-4,4]); 