📄 ed_sim.m
字号:
%refer to corresponding wrapper for paramters...thanks.function ed_sim(TC,BURST_LENGTH,SYMBOL_LENGTH,DATA_LENGTH,RSCODE,PACKET_LENGTH,FS_CONT,L,CODE_ID,CH_MODEL,... CH_ATT_THLD_DB,SNR_DB,RX_BW,T_INT,N_INT,G,THLD_PROBA,N,G_CHEST,... RUN,SIMS_PER_RUN,PLOT_FLAG,CLUSTER,OUT_FILE)if(CLUSTER) %add path to copied toolboxes, so that we do not get trouble with the %licence mananger addpath ../../../toolbox_optim; addpath ../../../toolbox_shared; addpath ../../../toolbox_signal; addpath ../../../toolbox_comm; addpath ../../../toolbox_stats;end%add paths to includeaddpath ./rng;addpath ./util;addpath ./signal;addpath ./receiver;addpath ./preamble_signal;addpath ./data_signal;addpath ./reed_solomon;addpath ../src/channel;addpath ../src/scrambling_timehopping;%for sim_run = 7for sim_run = 0:SIMS_PER_RUN-1 %max 0 up to 99!!! sim_run RNG_SEED = 100*RUN+sim_run; %set the random number generator to another state each time rand('state',RNG_SEED); %same for same run randn('state',RNG_SEED); %same for same run %group all the parameters corresponding to the channel channel_p = group_channel_params(RNG_SEED,CH_MODEL,CH_ATT_THLD_DB,0.5,1e-9); noise_var = 1 / 10^(SNR_DB/10) / 2; %execute script for preamble (acquisition) part [sfd_ok, sync_ok, delta_samples, channel_mask, compound_channel, ... rx_pre_overlap, max_delta_samples] = acq_sim(... TC,FS_CONT,L,CODE_ID,channel_p,noise_var,... RX_BW,T_INT,N_INT,G,THLD_PROBA,N,G_CHEST,PLOT_FLAG); %now call the script for the data part delta_s = delta_samples * N_INT * T_INT; %positive: too late, negative: too early (sec) max_delta_s = max_delta_samples * N_INT * T_INT %max (abs) value of delta returned (sec) %sfd_ok -> use this to determine whether sync was ok %rx_pre_overlap -> last max_delta_s seconds of preamble, is @ FS_CONT if (sfd_ok) [num_err,ber_sim] = ... condor_data_sim_154a(FS_CONT,... DATA_LENGTH,RSCODE,PACKET_LENGTH, ... TC,BURST_LENGTH,SYMBOL_LENGTH, ... compound_channel, channel_mask', ... SNR_DB,noise_var,RX_BW, ... T_INT,N_INT, ... delta_s, ... rx_pre_overlap); else num_err = -1; ber_sim = -1; end %write stats to output file if(sim_run == 0) fid = fopen( OUT_FILE, 'w' ); else fid = fopen( OUT_FILE, 'a' ); end fprintf(fid,'%i %i %i %i %.9f\n',delta_samples,sync_ok,sfd_ok,num_err,ber_sim); fclose(fid);end %sim_run%quit the matlab sessionif(CLUSTER) clear all; %quit;endreturn;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -