Generates an OFDM preamble. function [ d_preamble ] = OFDM_GeneratePreamble(d_TR, Para, preamble_type) The function works for SISO and some MIMO systems. Input arguments: d_TR: vector [Para.nSubcarriers, 1] of pilot symbols. Para: structure containing the modulation parameters. preamble_type: optional, type of preamble, 'synchro' (only for Para.N_T == 1) or 'channel_estimation' (by default). Outputs arguments: d_preamble: preamble symbols. Size: matrix [Para.nSubcarriers, Para.PreambleLength] if Para.N_T == 1 and multidimensional array [Para.N_T, Para.nSubcarriers, Para.PreambleLength] otherwise
0001 function [ d_preamble ] = OFDM_GeneratePreamble(d_TR, Para, preamble_type) 0002 % Generates an OFDM preamble. 0003 % 0004 % function [ d_preamble ] = OFDM_GeneratePreamble(d_TR, Para, 0005 % preamble_type) 0006 % 0007 % The function works for SISO and some MIMO systems. 0008 % 0009 % Input arguments: 0010 % 0011 % d_TR: vector [Para.nSubcarriers, 1] of pilot symbols. 0012 % 0013 % Para: structure containing the modulation parameters. 0014 % 0015 % preamble_type: optional, type of preamble, 'synchro' (only for Para.N_T 0016 % == 1) or 'channel_estimation' (by default). 0017 % 0018 % Outputs arguments: 0019 % 0020 % d_preamble: preamble symbols. Size: matrix [Para.nSubcarriers, 0021 % Para.PreambleLength] if Para.N_T == 1 and multidimensional array 0022 % [Para.N_T, Para.nSubcarriers, Para.PreambleLength] otherwise 0023 % 0024 0025 0026 % This file is part of WaveComBox: www.wavecombox.com and is distributed under the terms of the MIT license. See accompanying LICENSE file. 0027 % Original author: François Rottenberg, May 3, 2018. 0028 % Contributors: 0029 % Change log: 0030 0031 d_preamble=zeros(Para.N_T,Para.nSubcarriers,Para.PreambleLength); 0032 F_pilot=1/sqrt(Para.N_T)*exp(-1j*2*pi/Para.N_T*(0:Para.N_T-1)'*(0:Para.N_T-1) ); 0033 0034 if exist('preamble_type','var')==0 0035 preamble_type='channel_estimation'; 0036 end 0037 0038 switch preamble_type 0039 case 'synchro' 0040 if Para.N_T>1 0041 error('Preamble type "synchro" not yet implemented for N_T>1') 0042 end 0043 for m=Para.PreamblePilotSubcarriers 0044 d_preamble(:,m,1)=d_TR(m); 0045 d_preamble(:,m,2)=d_TR(m); 0046 end 0047 case 'channel_estimation' 0048 for m=Para.PreamblePilotSubcarriers 0049 d_preamble(:,m,1:Para.N_T)=d_TR(m)*F_pilot; 0050 end 0051 otherwise 0052 error('Preamble type not defined') 0053 end 0054 0055 0056 if Para.N_T==1 0057 d_preamble=squeeze(d_preamble).'; 0058 if length(d_preamble(:,1))~=Para.nSubcarriers 0059 d_preamble=d_preamble.'; 0060 end 0061 end 0062 0063 end 0064