 clear
 clc
 x=randi([0,3],1,1024);
 yqpsk=pskmod(x,4,pi/4);
 zqpsk6=awgn(yqpsk,6,'measured');
 Nvar6=sum((abs(zqpsk6(1,:))-1).^2)/length(x)
 zqpsk9=awgn(yqpsk,9,'measured');
 Nvar9=sum((abs(zqpsk9(1,:))-1).^2)/length(x)
 zqpsk12=awgn(yqpsk,12,'measured');
 Nvar12=sum((abs(zqpsk12(1,:))-1).^2)/length(x)
 
 

 scatterplot(zqpsk6,[],[],'b.');
 title('SNR=6dB')
 
 figure(1);
 scatterplot(zqpsk12,[],[],'b.');
 title('SNR=12dB')
 