📄 fake_estimate_channel.m
字号:
%% % TC% FS_CONT% L% preamble_code% CODE_ID% compound_channel%function [channel_mask] = ... fake_estimate_channel(TC,FS_CONT,samples,... L,preamble_code,CODE_ID,... compound_channel,... T_INT,N_INT,... s2,B)G_EST = 8;stop_samples = G_EST*L*length(preamble_code)*TC*FS_CONT;tx_bit = [];ths = [];scrambling = [];symbol_start = [];DATA_LENGTH = 0;RSCODE = 0;PACKET_LENGTH = 0;BURST_LENGTH = 0;SYMBOL_LENGTH = 0;ch_len = length(compound_channel);chip_span = 0.5;%fprintf('Create a fake preamble\n');preamble_uoi = create_packet(1,stop_samples,... compound_channel,... ch_len,chip_span,... tx_bit,ths,scrambling,symbol_start,... CODE_ID,L,TC,FS_CONT,... DATA_LENGTH,RSCODE,PACKET_LENGTH,... BURST_LENGTH,SYMBOL_LENGTH,... samples,0);% Add some noisepreamble_uoi = preamble_uoi + ... get_noise(length(preamble_uoi),s2,samples.chip,TC,FS_CONT,B);% Energy receiver[preamble_down,samples_per_tint] = ... ed_receiver(preamble_uoi,T_INT,FS_CONT,N_INT,0);% Compute the threshold for the channel maskfprintf('Compute the threshold for the channel mask\n');THLD_PROBA = 0.9999; %threshold for correlation peaksnon_zero_code_symbols = sum(abs(preamble_code));%fprintf('Noise floor = %.2f\n',s2*(T_INT*2*B)*N_INT*G_EST* ...% non_zero_code_symbols);%fprintf('Stuff = %.2f\n',s2*(T_INT*2*B)*N_INT);est_thld = s2*chi2inv(THLD_PROBA, ... (T_INT*2*B)*N_INT*G_EST*non_zero_code_symbols);%est_thld = 0;%fprintf('Threshold = %.2f\n',est_thld);% Estimate the channelfine_sync_index = 1;blocks_per_code_symbol = 16;[channel_mask est_sig_energy] = ... channel_est(preamble_down, fine_sync_index, G_EST, ... preamble_code, blocks_per_code_symbol,est_thld,0);fprintf('Channel mask = [');fprintf('%d ',channel_mask);fprintf(']\n');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -