function out=qpskgenerate(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);
n1=0:nd*m-1;
w=cos(2*pi*fc*n1*Ts)+i*sin(2*pi*fc*n1*Ts);
qpskout=ich1+i*qch1;
qpskout1=w.*qpskout;
%qpskout0=real(w.*qpskout);
%f1=(fs/(length(n1))).*n1;
%figure(1);
%plot(n,abs(fft(qpsk)));
qpskout2=awgn(qpskout1,SNR);
out=qpskout2;
%figure(2);
%plot(real(qpskout),imag(qpskout),'*'); 
%axis([-4,4,-4,4]); 


