⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 channel_est.m

📁 一个UWB仿真程序包
💻 M
字号:
%%%function [channel_mask est_sig_energy] = channel_est(rx_down, fine_sync_index, G, ...    pre_code, blocks_per_code_symbol,thld,PLOT_DEBUG)code_len = length(pre_code);%repeat code G timescode = repmat(pre_code,1,G)';%create a matrix of the stuff to accumulate so that we can write the whole%thing as a matrix productif(length(rx_down)<fine_sync_index-1+ ...        G*blocks_per_code_symbol*code_len) %we are too late -> sync failed    channel_mask = [];    est_sig_energy = 0;else    ch_mat = reshape(rx_down(fine_sync_index:fine_sync_index-1+ ...        G*blocks_per_code_symbol*code_len), ...        blocks_per_code_symbol,G*code_len);    %accumulate    channel_mask = ch_mat * code;    channel_mask_temp = channel_mask;    %apply thld    channel_mask(channel_mask < thld) = 0;    channel_mask(channel_mask >= thld) = 1;    %calculate mean energy    est_sig_energy = (channel_mask_temp' * channel_mask)./G;%    if(PLOT_DEBUG)%        figure%        plot(channel_mask_temp)%        hold on%        plot(max(channel_mask_temp)*channel_mask,'r')%        plot(thld*ones(1,length(channel_mask)),'m')%    endendreturn;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -