www.pudn.com > 8PSK.rar > xinshexian.m, change:2009-05-08,size:766b


clear; 
Fd=1;                                              %消息序列的采样速率 
Fs=4*Fd;                                         %已调信号的采样速率 
M=8; 
for  SNR_db=0:10:20 
Eb_N0=10^(SNR_db/10); 
sgma=sqrt(1/(8*Eb_N0));           %nc、ns的均方差 
x=randint(10,1,M);                      %产生随机消息序列 
y=dmodce(x,Fd,Fs, 'psk',M);            %PSK调制 
ynoise=y+sqrt(Fs/Fd)*sgma*(randn(length(y),1)+j*randn(length(y),1));      % 加噪 
figure(SNR_db+1); 
axis([-1.2 1.2 -1.2 1.2]); 
hold on; 
for i=0:M-1 
   plot(cos(2*pi*i/M),sin(2*pi*i/M),  '.','MarkerSize' ,20); 
end 
plot(ynoise, '+');                                                  %画出星座图 
hold  off;                                                              %画出受到噪声干扰的信号向量; 
end;