资源简介
完整的GSM系统仿真matlab代码仿真,对于搭建通信链路是很好的学习资料
代码片段和文件信息
function [] = GSM_main
% GSM_EDGE_main:
% This is the main function of simulating the GSM from transmiting to
% the receiver considering a data block is unit.
%
% SYNTAX: GSM_main
%
%
% It function using some former funtions or modified funtion
%from GSMsin and others.
%
% AUTHOR: wuguangfu
% 20071222
%
% define the main variables.
global Lh;
global Lburst;
global OSR;
global Tb;
global BT;
Lh = 2; %234
OSR = 4; %481624
Lburst = 148; %Assume the burst is normal burst.
%LburstEX = OSR*(Lburst + Lh);%length of burst extend.
NumberOfBlocks = 2500-1;
% define the main constants.
Tb = 3.692e-6;
BT = 0.3; % normalized bandwidth.
% Define the training sequenceusing TSC(i:)and i = 12...8 .
train_seq;
TRAINING = TSC(2:);% Select the TSC from one of the eight TSC.
%define the variables used in the radio channel.
SNR = 20; %5:18
foffset = 0; %-5000~5000Hz
MI = 0; %-1~1
PI = 0; %0~20 degree
multi_type = 2; %01234567
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
tx_enc1 = zeros(1456);% initate the tx_enc1 for the input of GSM_TRANSMIT(456).
hard_error1 = zeros(115);
tic
for SNR = 5:5
%GSM receiver.
rx_data_matrix1 = zeros(4114);%114=length(4:60)+length(89:145);
rx_data_matrix1_soft1 = zeros(4114);
rx_data_matrix2 = zeros(4114);
rx_data_matrix2_sof = zeros(4114);
channel_model(multi_type);
for stepN = 1 : NumberOfBlocks + 1
%The data block needed to be transmitted.When stepN=NumberOfBlocks+1tx_block is redundant bits.
tx_block = randint(1260);
[tx_enc1tx_bursttx_data_matrixIQ] = GSM_transmit(tx_enc1tx_blockTRAININGstepNNumberOfBlocks);
% We run the channel simulation.
r = I + j*Q;
% [r sigma] = channel_simulator(IQSNRfoffsetMIPI);
%Blind modulation detection.
[ rx_data_matrix2 rx_data_matrix2_soft hard_error] = receiver(tx_burstr TRAINING);
hard_error1(length(5:SNR)) = hard_error1(length(5:SNR)) + hard_error;%calculate the burst error.
if stepN == 1
%Prepare for the deinterleaver.
tx_block1 = tx_block; %Let the tx_block1 is the received transmitted block in fact.
rx_data_matrix1 = rx_data_matrix2;
rx_data_matrix1_soft = rx_data_matrix2_soft;
else
%deal with the hard information deinterleave.
rx_enc = deinterleave( [ rx_data_matrix1 ; rx_data_matrix2 ] );
rx_block = channel_dec(rx_enc);% Do channel decoding hard!
%B_ERRS_I(area_NUM) = B_ERRS_I(area_NUM) + sum(xor(rx_block(1:182)tx_block1(1:182)));
%B_ERRS_II(area_NUM) = B_ERRS_II(area_NUM) + sum(xor(rx_block(183:260)tx_block1(183:260)));
%B_ERRS_block(area_NUM) = B_ERRS_block(area_NUM) + sum(xor(rx_blocktx_block1));
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 441 2002-08-01 21:00 GSM_NEW\channel\add_foffset.m
文件 2189 2007-12-19 17:26 GSM_NEW\channel\channel_model.m
文件 1861 2007-12-24 11:58 GSM_NEW\channel\channel_simulator.asv
文件 1863 2007-12-24 11:58 GSM_NEW\channel\channel_simulator.m
文件 635 2007-07-11 10:30 GSM_NEW\channel\lognormal_init_med.m
文件 1405 2007-07-11 10:34 GSM_NEW\channel\rayleigh_fading.m
文件 850 2007-07-11 10:34 GSM_NEW\channel\rayleigh_init_med.m
文件 1772 2007-12-19 17:29 GSM_NEW\channel\wireless_li
文件 3780 2007-12-24 11:58 GSM_NEW\GSM_main.asv
文件 3779 2007-12-24 14:39 GSM_NEW\GSM_main.m
文件 8802 2007-05-17 11:29 GSM_NEW\receiver\channel_dec.m
文件 1033 2007-09-26 16:55 GSM_NEW\receiver\channel_dec_soft.m
文件 17069 1997-11-20 19:12 GSM_NEW\receiver\deinterleave.m
文件 2206 1997-09-22 19:39 GSM_NEW\receiver\make_increment.m
文件 1768 2007-12-24 15:23 GSM_NEW\receiver\receiver.m
文件 4644 2007-12-24 10:28 GSM_NEW\receiver\syn_mafi.asv
文件 4619 2007-12-24 10:29 GSM_NEW\receiver\syn_mafi.m
文件 5241 2007-12-24 11:41 GSM_NEW\receiver\syn_mafi_select.m
文件 5662 2007-12-24 15:41 GSM_NEW\receiver\syn_mafi_select1.m
文件 6534 2007-12-21 15:52 GSM_NEW\receiver\viterbi_detector.m
文件 4665 2007-12-24 10:43 GSM_NEW\syn_mafi_select.asv
文件 5706 2007-12-24 15:40 GSM_NEW\syn_mafi_select1.asv
文件 2835 2007-09-11 17:40 GSM_NEW\transmit\channel_enc.m
文件 2939 2007-12-21 14:50 GSM_NEW\transmit\gsm_mod.m
文件 2275 2007-12-21 16:18 GSM_NEW\transmit\GSM_transmit.m
文件 17434 2007-09-24 15:08 GSM_NEW\transmit\interleave.m
文件 1933 2007-12-21 14:47 GSM_NEW\transmit\ph_g.m
文件 525 2007-09-28 15:24 GSM_NEW\transmit\train_seq.m
目录 0 2009-03-30 11:35 GSM_NEW\channel
目录 0 2009-03-30 11:35 GSM_NEW\receiver
............此处省略5个文件信息
- 上一篇:4-20mA转0-3.3V
- 下一篇:基于矩阵编码的遗传算法与TSP求解.rar
评论
共有 条评论