📄 ofdm_rx_mimo_init.m
字号:
%Make sure the Tx init has already been loaded
ofdm_tx_mimo_init;
Symbol_Timing_Offset = 8; %15 = no offset
PktDet_Delay = 26 + Symbol_Timing_Offset*2^7;
pktByteNums = byteIndex_dynModulationStart + byteIndex_numPayloadBytes(1)*2^16 + byteIndex_numPayloadBytes(2)*2^24;
rx_SISO_Mode = tx_SISO_Mode;
%Load the packet timing control file
ofdm_rx_init_packetTimingControl;
%Packet detection threshold
pkt_crossCorr_thresh = 0.7;
pkt_energy_thresh = 0;
%Initialization values for the long correlator
% The correlator only stores the signs of the values in a long trainin symbol
% This code and the correlator block were designed by Dr. Chris Dick
%Shift the correlation pattern by 16 to allow the calculation
% to finish in time to decide the beginning of the payload
%L = [longSymbol_time(50:64) longSymbol_time(1:49)];
L = [longSymbol_time];
ccr = -1*sign(real(fliplr(L)));
ccr = [ccr 0];
ii = find(ccr==0);
ccr(ii)=1;
cci = 1*sign(fliplr(imag(L)));
cci = [cci 0];
ii=find(cci==0);
cci(ii)=1;
ii = find(ccr==-1);
hr = zeros(1,length(ccr));
hr(ii) = 1;
ii = find(cci==-1);
hi = zeros(1,length(cci));
hi(ii) = 1;
long_cor_acc_n_bits = 4;
Tr1 = 1/4;
%Demodulator input precision
symbol_unmap_bp= 15;
symbol_unmap_nb= 16;
%Popluate the RxControlBits register
% Each bit has a different function
%0x1: 1: Reset BER
%0x2: 2: Require long correlation for pkt detection
%0x4: 4: Enable dynamic packet lengths
%0x8: 8: Enable dynamic modulation schemes
%0x10: 16: Enable SISO mode
%0x20: 32: Require 2 long correlations for pkt detection
%0x40: 64: Require short correlation or ext pkt detection
%0x80: 128: External pkt detection
%0x100: 256: Internal Pkt Detection
%0x200: 512: bypass CFO correction
%0x400: 1024: Use LTS for CFO
%0x800: 2048: Use STS for CFO
%0x1000:4096: Use LongCorr for CFO reset
%0x2000:8192: Use real arctan for pilot phase calc
%0x4000:16384: Bypass division during EQ
%0x8000:32786: Use training symbols for CFO
rx_controlBits = 1 * 2 ... %Long correlation
+ 1 * 4 ... %Dyn pkt lengths
+ 1 * 8 * dynamicModulationEn ...
+ 1 * 16 * rx_SISO_Mode ...
+ 1 * 32 ... %2 long correlations
+ 1 * 64 ... %short correlation
+ 0 * 128 ... %ext pkt det
+ 1 * 256 ... %int pkt det
+ 0 * 512 ... %bypass CFO
+ 0 * 1024 ... %LTS for CFO
+ 0 * 2048 ... %STS for CFO
+ 1 * 4096 ... %Long correlation for CFO
+ 1 * 8192 ... %Real arctan for CFO
+ 0 * 16384 ... %Bypass EQ division
+ 0 * 32768; %Use training for CFO
%rx_controlBits = 1 * 2 + 0 * 4 + 1 * 8 * dynamicModulationEn + 1 * 16 * rx_SISO_Mode + (1 * 32) + 1 * 64 + 0 * 128 + 1 * 256 + 0 * 512 + 0 * 1024 + 0 * 2048 + 1 * 4096 + 1 * 8192 + 0 * 16384 + 1 * 32786;
%Most-equalization scaling
%This value is used to scale the equalizer's output before demodulation
%This is used to correct for any fixed gain/attenuation the full system has
% The value shouldn't be channel or modulation dependent
rxScaling = 1;%0.775;
% This scaling value resides in a UFix_32_0 register
% The value is split into two 16 bit values, then
% each is re-interpreted as a UFix_16_11
rx_postEq_scaling = round(rxScaling*2^11) * (1 + 2^16);
%mod((rxScaling*2^11),2^16) + (2^16 * mod((rxScaling*2^11),2^16));
Rx_PhaseNoiseTrack_Kalpha = 0.5;
Rx_PhaseNoiseTrack_Kbeta = 0.5;
Rx_PhaseNoiseTrack_Kgamma = 0.5;
Rx_PhaseNoiseTrack_K = 0.6094;%hex2dec('2700000')/2^26;
freqOffset_track_filtCoef_p = hex2dec('d0000')/2^32;
freqOffset_track_filtCoef_i = hex2dec('2500')/2^32;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -