• 大小: 34KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: Matlab
  • 标签: 调制解调  

资源简介

这个源程序代码包提供了通信系统中BPSK,QPSK,OQPSK,MSK,MSK2,GMSK,QAM,QAM16等调制解调方式 用matlab的实现,以及它们在AWGN和Rayleigh信道下的通信系统实现及误码率性能

资源截图

代码片段和文件信息

% Program 3-1
% bpsk.m
%
% Simulation program to realize BPSK transmission system
%
% Programmed by H.Harada and T.Yamamura
%

%******************** Preparation part **********************

sr=256000.0; % Symbol rate
ml=1;        % Number of modulation levels
br=sr.*ml;   % Bit rate (=symbol rate in this case)
nd = 1000;   % Number of symbols that simulates in each loop
ebn0=3;      % Eb/N0
IPOINT=8;    % Number of oversamples

%******************* Filter initialization ********************

irfn=21;     % Number of filter taps          
alfs=0.5;    % Rolloff factor
[xh] = hrollfcoef(irfnIPOINTsralfs1);   %Transmitter filter coefficients  
[xh2] = hrollfcoef(irfnIPOINTsralfs0);  %Receiver filter coefficients


%******************** START CALCULATION *********************
nloop=100;  % Number of simulation loops

noe = 0;    % Number of error data
nod = 0;    % Number of transmitted data

for iii=1:nloop
    
%******************** Data generation ********************************  

data=rand(1nd)>0.5;  % rand: built in function

%******************** BPSK Modulation ***********************  

    data1=data.*2-1;
[data2] = oversamp( data1 nd  IPOINT) ;
data3 = conv(data2xh);  % conv: built in function

%****************** Attenuation Calculation *****************

    spow=sum(data3.*data3)/nd;
attn=0.5*spow*sr/br*10.^(-ebn0/10);
attn=sqrt(attn);
   
%********************** Fading channel **********************

  % Generated data are fed into a fading simulator
  % In the case of BPSK only Ich data are fed into fading counter
  % [ifadeqfade]=sefade(data3zeros(1length(data3))itaudlvlth1n0itnd1now1length(data3)tstpfdflat);
  
  % Updata fading counter
  %itnd1 = itnd1+ itnd0;

%************ Add White Gaussian Noise (AWGN) ***************

    inoise=randn(1length(data3)).*attn;  % randn: built in function
data4=data3+inoise;
data5=conv(data4xh2);  % conv: built in function

sampl=irfn*IPOINT+1;
data6 = data5(sampl:8:8*nd+sampl-1);
    
%******************** BPSK Demodulation *********************

    demodata=data6 > 0;

%******************** Bit Error Rate (BER) ******************

    noe2=sum(abs(data-demodata));  % sum: built in function
nod2=length(data);  % length: built in function
noe=noe+noe2;
nod=nod+nod2;

fprintf(‘%d\t%e\n‘iiinoe2/nod2);
end % for iii=1:nloop    

%********************** Output result ***************************

ber = noe/nod;
fprintf(‘%d\t%d\t%d\t%e\n‘ebn0noenodnoe/nod);
fid = fopen(‘BERbpsk.dat‘‘a‘);
fprintf(fid‘%d\t%e\t%f\t%f\t\n‘ebn0noe/nodnoenod);
fclose(fid);

%******************** end of file ***************************
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2753  2001-11-30 06:35  复件 Chapter3\bpsk.m

     文件       4484  2001-11-30 06:30  复件 Chapter3\bpsk_fading.m

     文件        658  2001-11-26 18:37  复件 Chapter3\comb.m

     文件        562  2001-11-30 07:56  复件 Chapter3\compconv.m

     文件        684  2001-11-30 07:56  复件 Chapter3\compoversamp.m

     文件        743  2001-11-30 07:55  复件 Chapter3\delay.m

     文件       2167  2001-11-27 21:49  复件 Chapter3\fade.m

     文件       1052  2001-11-30 07:55  复件 Chapter3\gaussf.m

     文件       3387  2001-11-30 07:42  复件 Chapter3\gmsk.m

     文件       5109  2001-11-30 07:42  复件 Chapter3\gmsk_fading.m

     文件       1652  2001-11-27 01:37  复件 Chapter3\hrollfcoef.m

     文件       2933  2001-11-30 06:31  复件 Chapter3\msk.m

     文件       2967  2001-11-30 06:31  复件 Chapter3\msk2.m

     文件       4691  2001-11-30 06:31  复件 Chapter3\msk2_fading.m

     文件       4657  2001-11-30 06:31  复件 Chapter3\msk_fading.m

     文件       3182  2001-11-30 06:31  复件 Chapter3\oqpsk.m

     文件       4790  2001-11-30 07:09  复件 Chapter3\oqpsk_fading.m

     文件        497  2001-11-27 09:39  复件 Chapter3\oversamp.m

     文件        507  2001-11-30 07:54  复件 Chapter3\oversamp2.m

     文件       2780  2001-11-30 06:42  复件 Chapter3\qam16.m

     文件       4592  2001-11-30 06:44  复件 Chapter3\qam16_fading.m

     文件       1729  2001-11-30 07:54  复件 Chapter3\qamdemod.m

     文件       1156  2001-11-30 07:53  复件 Chapter3\qammod.m

     文件       3055  2001-11-30 06:30  复件 Chapter3\qpsk.m

     文件        723  2001-11-27 02:04  复件 Chapter3\qpskdemod.m

     文件        914  2001-11-27 02:03  复件 Chapter3\qpskmod.m

     文件       4684  2001-11-30 06:31  复件 Chapter3\qpsk_fading.m

     文件      28564  2001-11-30 16:57  复件 Chapter3\README-Chap3.txt

     文件       1742  2001-11-27 21:49  复件 Chapter3\sefade.m

     文件      28358  2007-08-19 09:35  复件 Chapter3\README.txt

............此处省略5个文件信息

评论

共有 条评论