lte-sidelink is an open software library developed in MATLAB by Feron Technologies P.C., that implements the most important functionalities of the 3GPP LTE sidelink interface.

Introduction

Sidelink is a new LTE feature introduced in 3GPP Release 12 aiming at enabling device-to-device (D2D) communications within legacy cellular-based LTE radio access networks. Sidelink has been enriched in Releases 13 and 14 with various features. D2D is applicable to public safety and commercial communication use-cases, and recently (Rel.14) to vehicle-to-vehicle (V2V) scenarios. In legacy uplink/downlink, two UEs communicate through the Uu interface and data are always traversing the LTE eNB. Differently, sidelink enables the direct communication between proximal UEs using the newly defined PC5 interface, and data does not need to traverse the eNB. Services provided in this way are often called “Proximity Services” (or ProSe) and the UEs suppporting this feature “ProSe”-enabled UEs.

The library provides an (almost) complete implementation of the sidelink physical signals, physical channels and transport layer functionalities described in the 3GPP standard. In addition it provides the neccessary receiver processing functionalities for generating and/or recovering a real sidelink signal which is either simulated/emulated or sent over the air and captured from an SDR board. The code is highly-modular and documented in order to be easily understood and further extended.

The library has many usages. Typical use-case examples are the following:

The following 3GPP standard documents have been used and referenced through the code:

Further details for the 3GPP D2D/V2V standardization and implementation could be found in:

Features

Supported Features

Repository Structure

Dependencies/Notes

The example provides a high-level walkthrough for setting up, configuring, and running a complete transceiver simulation scenario for the sidelink broadcast channel. The example includes (refer to file sidelink_broadcast_tester.m):

The sidelink broadcast subframe carries two kinds of “information”:

:exclamation: According to the standard the broadcast channel transmission may be triggered by any of the two core D2D operation modes, i.e. discovery and communication, and assists such transmissions. Therefore we could not transmit a broadcast subframe without sending a discovery/communication subframe as well. For flexibility purposes, in our implementation we define a “standalone” broadcast transmission as well.

CONFIGURATION

A set of parameters shown in the following Table determine the exact scenario configuration. For each parameter, a default setting is also defined.

Parameter Description Acceptable Settings Default Configuration
cp_Len_r12 Cyclic Prefix Length 'Normal', 'Extended' 'Normal'
NSLRB Number of Sidelink RBs 6,15,25,50,75,100 25
NSLID Sidelink Physical Layer Synchronization ID 0 - 335 0
slMode Sidelink Transmission Mode (D2D, V2V) 1,2,3,4 1
syncOffsetIndicator Sync Subframe Offset Indicator (w.r.t. subframe #0) 0 - 39 0
syncPeriod Sync Subframe Period (in # subframes) 1 - 40 40
decodingType Symbol Decoding Type 'Soft','Hard' 'Soft'
chanEstMethod Channel Estimation Method 'LS','mmse-direct' 'LS'
timeVarFactor Estimated Channel Doppler Frequency 0 or a value >0 (Hz) 0
numTotSubframes Number of Generated Sidelink Subframes 0 - 10240 10240

More on the parameters:

The top 5 parameters are common for both transmitting and receiving ProSe-enabled UEs.

The next 3 parameters have to do with the tuning of the in-house receiver processing functionalities, namely channel estimation and signal recovery:

The last parameter, numTotSubframes, determines the number of generated sidelink subframes. Up to 10240 subframes could be generated, corresponding to a full operation cycle.

An example configuration using the default settings is the following:

cp_Len_r12          = 'Normal';    
NSLRB               = 25;
NSLID               = 0;
slMode              = 1;
syncPeriod          = 40;
decodingType        = 'Soft';
chanEstMethod       = 'LS';
timeVarFactor       = 0;  
numTotSubframes     = 10240;

The sidelink broadcast waveform is generated using the high-level function broadcast_tx. The output of the function contains the time-domain samples for a duration given by the numTotSubframes parameter, starting at subframe #0. Assuming a 5 MHz bandwidth mode (NSLRB=25), the output of the function is a complex vector with length 7680*numTotSubframes, where 7680 is the number of time-domain samples per subframe for the given bandwidth. The function should be used as follows:

tx_output = broadcast_tx(struct('NSLRB',NSLRB,'NSLID',NSLID,'cp_Len_r12',cp_Len_r12, 'slMode',slMode), ...
    struct('syncOffsetIndicator',syncOffsetIndicator,'syncPeriod',syncPeriod), ...
    numTotSubframes);

The first structure includes the broadcast-specific parameters, the second structure the synchronization-specific parameters, and the last scalar parameter the number of subframes to generate (up to 10240). The provided structures fields are optional. For any missing field its default value is used. To apply the default broadcast/sync configuration call broadcast_txusing empty structures:

tx_output = broadcast_tx(struct(), struct(), numTotSubframes);

:bell: Beware that for storing the waveform for a full time cycle (10240 subframes) you will need a complex vector containing 78,643,200 elements, which requires approximately 1.25 GB of memory.

Apply Test Channel

This is an optional module. The objective is to model a simple channel considering three kinds of impairments (noise, time offset, frequency offset) and apply it to the generated sidelink waveform. The channel impairments are generated as follows:

The application of the impairments to the ideal waveform is done as follows (NFFT is the FFT length, depending on the bandwidth mode. For the 5 MHz mode, NFFT=512):

rx_input = tx_output + sqrt((1/2)*10^(-SNR_target_dB/10))*complex(randn(length(tx_output),1), randn(length(tx_output),1));
rx_input = [zeros(toff,1); rx_input]; 
rx_input = rx_input(:).*exp(2i*pi*(0:length(rx_input(:))-1).'*foff/NFFT);

The last part of the example corresponds to the recovery of MIB-SL messages given an input waveform and a known sidelink configuration. The input waveform could be one of the following :

The MIB-SL messages recovery operations are appled by calling the high-level function broadcast_rx() as follows:

broadcast_rx(struct('NSLRB',NSLRB,'NSLID',NSLID,'cp_Len_r12',cp_Len_r12, 'slMode',slMode), ...
     struct('syncOffsetIndicator',syncOffsetIndicator,'syncPeriod',syncPeriod),...
     struct('decodingType',decodingType, 'chanEstMethod',chanEstMethod, 'timeVarFactor',timeVarFactor),...
     rx_input);

In addition to the sidelink broadcast and synchronization structures, a receiver processing configuration structure is also defined. The last argument corresponds to a complex vector containing the input waveform time-domain samples. Again, for the default configuration you may simply call the recovery function as follows:

broadcast_rx(struct(), struct(), struct(), rx_input);

A short introduction to D2D Discovery

The sidelink discovery mode is used for sending (in a broadcast way) short messages to neighbor UEs. Protocol processing is extremely light; in essence each message corresponds to a single PHY transport block, containing no higher-ligher additional overhead. How to fill the transport block is left open, and depends on the underlying D2D application. To support timing reference recovery at the monitoring D2D UEs, the announcing D2D UE(s) trigger the transmission of broadcast/synchronization subframes as described in the previous example. The sidelink discovery transmission/reception procedure involves two key functionalities:

Next, we provide a high-level walkthrough for setting up, configuring, and running a complete transceiver simulation scenario for the sidelink discovery mode (refer to file sidelink_discovery_tester.m):

Configuration

The available parameters may be organized in three groups:

Running the example

An example Type-1 configuration is shown below. Notice that in addition to the aforementioned parameters we have included: i) a parameter determing which resources the receiving UE will monitor for identifying potential discovery announcements (n_PSDCHs_monitored), ii) a set of three parameters (decodingType, chanEstMethod, timeVarFactor), used for tuning channel estimation and channel decoding operations at the receiver side.

cp_Len_r12              = 'Normal';
NSLRB                   = 25;
NSLID                   = 301;
slMode                  = 1;
syncOffsetIndicator     = 0;
syncPeriod              = 40;
discPeriod_r12          = 32;
offsetIndicator_r12     = 0;
subframeBitmap_r12      = repmat([0;1;1;1;0],8,1);
numRepetition_r12       = 5;
prb_Start_r12           = 2;
prb_End_r12             = 22;
prb_Num_r12             = 5;
numRetx_r12             = 2;
networkControlledSyncTx = 1;
syncTxPeriodic          = 1;
discType                = 'Type1';
n_PSDCHs                = [0; 6];
n_PSDCHs_monitored      = n_PSDCHs;
decodingType            = 'Soft';
chanEstMethod           = 'LS';
timeVarFactor           = 0;

As in the broadcast example, transmission/reception operations are captured in corresponding function blocks, discovery_tx() and discovery_rx(), respectively.

By default,discovery_tx() creates a standard-compliant discovery waveform for a period determined by the discPeriod_r12 parameter. The waveform (stored in the tx_output variable) contains not only the discovery signal samples but also the triggered broadcast/synchronization signal samples for the specific period. An example call of the discovery tx waveform generation function block is as follows:

slBaseConfig = struct('NSLRB',NSLRB,'NSLID',NSLID,'cp_Len_r12',cp_Len_r12, 'slMode',slMode);
slSyncConfig = struct('syncOffsetIndicator', syncOffsetIndicator,'syncPeriod',syncPeriod);
slDiscConfig = struct('offsetIndicator_r12', offsetIndicator_r12, 'discPeriod_r12',discPeriod_r12, 'subframeBitmap_r12', subframeBitmap_r12, 'numRepetition_r12', numRepetition_r12, ...
    'prb_Start_r12',prb_Start_r12, 'prb_End_r12', prb_End_r12, 'prb_Num_r12', prb_Num_r12, 'numRetx_r12', numRetx_r12, ...
    'networkControlledSyncTx',networkControlledSyncTx, 'syncTxPeriodic',syncTxPeriodic, 'discType', discType);
slUEconfig = struct('n_PSDCHs',n_PSDCHs); 
tx_output = discovery_tx( slBaseConfig, slSyncConfig, slDiscConfig, slUEconfig );

The generated time-domain waveform for a period of 50 subframes is illustrated in the following figure. The subframe locations of the discovery message transmissions (and potentially re-transmissions) depend on the selected nPSDCH configuration. In addition, the triggered broadcast/sync subframes repeated every 40 subframes are also shown.

The frequency-domain resource allocation for the discovery message configured with nPSDCH = 0 is also shown below. Three transmissions for the particular message have been configured (since numRetx_r12=2).

Next, the tx waveform passes through a typical channel, and the resulted waveform (stored in the rx_input variable) is fed to the discovery monitoring/receiving function block. This is called as follows:

discovery_rx(slBaseConfig, slSyncConfig, slDiscConfig,  ...
    struct('n_PSDCHs',n_PSDCHs_monitored), ...
    struct('decodingType',decodingType, 'chanEstMethod',chanEstMethod, 'timeVarFactor',timeVarFactor),...
    rx_input );

Notice that in addition to sidelink basic configuration (slBaseConfig and slSyncConfig) and discovery resources pool configuration (slDiscConfig), we provide as input the discovery messages monitoring search space and the channel estimation/decoding parameters. The discovery monitoring function returns the recovered (if any) discovery messages. For the specific configuration example the following output is printed at the end of the execution (intermeddiate log/debug messages print-out is also supported):

Recovered Discovery Messages
	[At Subframe     1: Found nPSDCH =   0]
	[At Subframe     2: Found nPSDCH =   0]
	[At Subframe     3: Found nPSDCH =   0]
	[At Subframe    31: Found nPSDCH =   6]
	[At Subframe    32: Found nPSDCH =   6]
	[At Subframe    33: Found nPSDCH =   6]

It is clear that both discovery messages contained in the tx waveform have been recovered successfully at the receiver side.

A short introduction to the D2D Communication mode

The sidelink communication mode is used for typical data applications such as VoIP and on-demand video-streaming. Compared to the the discovery mode, the data-rate and reliability requirements are more demanding. Thus, a more complex protocol has been drafted. In particular:

Configuration

The configuration structure is similar to that of the discovery mode. The basic sidelink operation parameters, i.e. bandwidth mode (NSLRB), sidelink PCI (NSLID) and cyclic prefix length (cp_len_r12), determine the L1 subframe numerology as in the broadcast and discovery examples. The sidelink communication mode (slMode) determines if the resources used by each UE are centrally scheduled by the LTE eNB (mode-1) or selected autonomously (mode-2). Currently only mode-1 is fully supported. The sidelink communication mode triggers a “single-shot” or periodic tranmission of synchronization/broadcast subframes. These subframes are used at the receivered for obtaining side system information as well as time-synchronization.

Sidelink communication specific resource allocation is determined by a list of parameters which is very similar to the one used for configuring the sidelink discovery mode. Notice that these parameters mainly correspond to SL-CommResource Pool IEs defined in the 3GPP standard. In summary:

User-specific resource allocation and transmission configurarion is determined using a set of parameters which are either communicated to the transmitting D2D UE using L3 signaling (RRC/SIB) or L1 signaling (DCI-5) or decided autonomously by the UE. In particular:

Running the example

An example “mode-1” configuration is shown below. Notice that in addition to the aforementioned parameters we have included: i) a parameter called n_PSCCHs_monitored, determing which resources the receiving UE will monitor for identifying potential SCI Format 0 messages, ii) a set of three parameters, i.e. decodingType, chanEstMethod, and timeVarFactor`, used for tuning channel estimation and channel decoding operations at the receiver side, similarly to the the discovery/broadcast subframe decoding procedures.

NSLRB                   = 25;
NSLID                   = 301;
slMode                  = 1;
cp_Len_r12              = 'Normal';
syncOffsetIndicator     = 0;
syncPeriod              = 40;
scPeriod_r12            = 160;
offsetIndicator_r12     = 40;
subframeBitmap_r12      = repmat([0;1;1;0],10,1);
prb_Start_r12           = 2;
prb_End_r12             = 22;
prb_Num_r12             = 10;
networkControlledSyncTx = 1;
syncTxPeriodic          = 1;
mcs_r12                 = [9; 10];
nPSCCH                  = [0; 30];
HoppingFlag             = [0; 0];
RBstart                 = [2; 13];
Lcrbs                   = [10; 10];
ITRP                    = [0; 1];
nSAID                   = [101; 102];
n_PSDCHs_monitored      = [0:1:30];
decodingType            = 'Soft';
chanEstMethod           = 'LS';
timeVarFactor           = 0;

In the given example we have configured two “virtual” transmitting D2D-UEs (the i-th UE configuration corresponds to the i-th element of the respective parameters subset {mcs_r12, nPSCCH, HoppingFlag, RBstart, Lcrbs, ITRP, nSAID}. The receiving D2D-UE is able to monitor both transmissions as indicated by the search space it looks at (n_PSDCHs_monitored).

Sidelink configuration, mode-specific and user-specific resource allocation, as well as L1 processing are captured in high-level function blocks communication_tx() and communication_rx respectively. These are used as follows:

At the transmitter side:

slBaseConfig = struct('NSLRB',NSLRB,'NSLID',NSLID,'cp_Len_r12',cp_Len_r12, 'slMode',slMode);
slSyncConfig = struct('syncOffsetIndicator', syncOffsetIndicator,'syncPeriod',syncPeriod);
slCommConfig = struct('scPeriod_r12',scPeriod_r12,'offsetIndicator_r12',offsetIndicator_r12, 'subframeBitmap_r12',subframeBitmap_r12,...
    'prb_Start_r12',prb_Start_r12, 'prb_End_r12', prb_End_r12, 'prb_Num_r12', prb_Num_r12,...
    'networkControlledSyncTx',networkControlledSyncTx, 'syncTxPeriodic',syncTxPeriodic );
slUEconfig   = struct('nPSCCH', nPSCCH, 'HoppingFlag', HoppingFlag, 'ITRP', ITRP, 'RBstart', RBstart, 'Lcrbs', Lcrbs, 'mcs_r12', mcs_r12, 'nSAID',nSAID);
tx_output = communication_tx( slBaseConfig, slSyncConfig, slCommConfig, slUEconfig);

At the receiver side (rx_input is the received waveform):

communication_rx(slBaseConfig, slSyncConfig, slCommConfig,  ...
    struct('nPSCCH', n_PSDCHs_monitored ), ...
    struct('decodingType',decodingType, 'chanEstMethod',chanEstMethod, 'timeVarFactor',timeVarFactor),...
    rx_input );

During the execution of the simulation scenario various information messages are printed in the console output. These allow us to monitor every step of the tx/rx sidelink communication process, including resource pool configuration, generation of tx signals, and recovery of control and signaling information at the rx side. An example output dump is shown below:

=======================================================
PSCCH and PSSCH COMMUNICATION RESOURCES POOL FORMATION 
=======================================================
Communication Period starts @ subframe #40 and ends at subframe #199
PSCCH Subframe pool (total 20 subframes)
( PSCCH Subframes : 41 42 45 46 49 50 53 54 57 58 61 62 65 66 69 70 73 74 77 78 )
PSSCH Subframe pool (total 60 subframes)
( PSSCH Subframes : 81 82 85 86 89 90 93 94 97 98 101 102 105 106 109 110 113 114 117 118 121 122 125 126 129 130 133 134 137 138 141 142 145 146 149 150 153 154 157 158 161 162 165 166 169 170 173 174 177 178 181 182 185 186 189 190 193 194 197 198 )
PSCCH/PSSCH PRB pools : Bottom prb range = 2:11, Top prb range = 13:22 (total = 20 PRBs)
=======================================================
UE-specific Control Channel (PSCCH) Resource Allocation 
=======================================================
PSCCH Resource Allocation for UE with nPSCCH = 0 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 41
	RESOURCE #2 : PRB 13, SUBFRAME 42
PSCCH Resource Allocation for UE with nPSCCH = 30 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 61
	RESOURCE #2 : PRB 14, SUBFRAME 65
=====================================================
UE-specific Data Channel (PSSCH) Resource Allocation 
=====================================================
PSSCH SUBFRAME Allocation for UE (with I_trp = 0): Total 4 subframes, First 81, Last: 129
( PSSCH Subframes : 81 97 113 129 )
PSSCH SUBFRAME Allocation for UE (with I_trp = 1): Total 4 subframes, First 82, Last: 130
( PSSCH Subframes : 82 98 114 130 )
[UE 0] PSSCH Transport Block Size = 1544 bits (Mod Order : 2).
	PSSCH Bit Capacity = 11520 bits  (Symbol Capacity = 5760 samples).
[UE 30] PSSCH Transport Block Size = 1736 bits (Mod Order : 2).
	PSSCH Bit Capacity = 11520 bits  (Symbol Capacity = 5760 samples).
=======================================================
Reference Subframes 
=======================================================
( SLSS Subframes : 40 80 120 160 )


In REFERENCE subframe  40

Loading Subframe 41/PRB 2 with PSCCH for user 0
SCI-0 (41 bits) message 7180480065 (hex format) generated

Loading Subframe 42/PRB 13 with PSCCH for user 0
SCI-0 (41 bits) message 7180480065 (hex format) generated

Loading Subframe 61/PRB 3 with PSCCH for user 30
SCI-0 (41 bits) message 7701500065 (hex format) generated

Loading Subframe 65/PRB 14 with PSCCH for user 30
SCI-0 (41 bits) message 7701500065 (hex format) generated
In REFERENCE subframe  80

Loading Subframe 81 with PSSCH for user 0

Loading Subframe 82 with PSSCH for user 30

Loading Subframe 97 with PSSCH for user 0

Loading Subframe 98 with PSSCH for user 30

Loading Subframe 113 with PSSCH for user 0

Loading Subframe 114 with PSSCH for user 30
In REFERENCE subframe 120

Loading Subframe 129 with PSSCH for user 0

Loading Subframe 130 with PSSCH for user 30
In REFERENCE subframe 160
Tx Waveform Created...
Tx Waveform Passed from Channel...


Rx Waveform Processing Starting...
=======================================================
PSCCH and PSSCH COMMUNICATION RESOURCES POOL FORMATION 
=======================================================
Communication Period starts @ subframe #40 and ends at subframe #199
PSCCH Subframe pool (total 20 subframes)
( PSCCH Subframes : 41 42 45 46 49 50 53 54 57 58 61 62 65 66 69 70 73 74 77 78 )
PSSCH Subframe pool (total 60 subframes)
( PSSCH Subframes : 81 82 85 86 89 90 93 94 97 98 101 102 105 106 109 110 113 114 117 118 121 122 125 126 129 130 133 134 137 138 141 142 145 146 149 150 153 154 157 158 161 162 165 166 169 170 173 174 177 178 181 182 185 186 189 190 193 194 197 198 )
PSCCH/PSSCH PRB pools : Bottom prb range = 2:11, Top prb range = 13:22 (total = 20 PRBs)
=======================================================
UE-specific Control Channel (PSCCH) Resource Allocation 
=======================================================
PSCCH Resource Allocation for UE with nPSCCH = 0 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 41
	RESOURCE #2 : PRB 13, SUBFRAME 42
PSCCH Resource Allocation for UE with nPSCCH = 1 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 42
	RESOURCE #2 : PRB 13, SUBFRAME 45
PSCCH Resource Allocation for UE with nPSCCH = 2 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 45
	RESOURCE #2 : PRB 13, SUBFRAME 46
PSCCH Resource Allocation for UE with nPSCCH = 3 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 46
	RESOURCE #2 : PRB 13, SUBFRAME 49
PSCCH Resource Allocation for UE with nPSCCH = 4 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 49
	RESOURCE #2 : PRB 13, SUBFRAME 50
PSCCH Resource Allocation for UE with nPSCCH = 5 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 50
	RESOURCE #2 : PRB 13, SUBFRAME 53
PSCCH Resource Allocation for UE with nPSCCH = 6 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 53
	RESOURCE #2 : PRB 13, SUBFRAME 54
PSCCH Resource Allocation for UE with nPSCCH = 7 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 54
	RESOURCE #2 : PRB 13, SUBFRAME 57
PSCCH Resource Allocation for UE with nPSCCH = 8 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 57
	RESOURCE #2 : PRB 13, SUBFRAME 58
PSCCH Resource Allocation for UE with nPSCCH = 9 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 58
	RESOURCE #2 : PRB 13, SUBFRAME 61
PSCCH Resource Allocation for UE with nPSCCH = 10 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 61
	RESOURCE #2 : PRB 13, SUBFRAME 62
PSCCH Resource Allocation for UE with nPSCCH = 11 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 62
	RESOURCE #2 : PRB 13, SUBFRAME 65
PSCCH Resource Allocation for UE with nPSCCH = 12 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 65
	RESOURCE #2 : PRB 13, SUBFRAME 66
PSCCH Resource Allocation for UE with nPSCCH = 13 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 66
	RESOURCE #2 : PRB 13, SUBFRAME 69
PSCCH Resource Allocation for UE with nPSCCH = 14 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 69
	RESOURCE #2 : PRB 13, SUBFRAME 70
PSCCH Resource Allocation for UE with nPSCCH = 15 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 70
	RESOURCE #2 : PRB 13, SUBFRAME 73
PSCCH Resource Allocation for UE with nPSCCH = 16 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 73
	RESOURCE #2 : PRB 13, SUBFRAME 74
PSCCH Resource Allocation for UE with nPSCCH = 17 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 74
	RESOURCE #2 : PRB 13, SUBFRAME 77
PSCCH Resource Allocation for UE with nPSCCH = 18 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 77
	RESOURCE #2 : PRB 13, SUBFRAME 78
PSCCH Resource Allocation for UE with nPSCCH = 19 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 78
	RESOURCE #2 : PRB 13, SUBFRAME 41
PSCCH Resource Allocation for UE with nPSCCH = 20 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 41
	RESOURCE #2 : PRB 14, SUBFRAME 45
PSCCH Resource Allocation for UE with nPSCCH = 21 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 42
	RESOURCE #2 : PRB 14, SUBFRAME 46
PSCCH Resource Allocation for UE with nPSCCH = 22 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 45
	RESOURCE #2 : PRB 14, SUBFRAME 49
PSCCH Resource Allocation for UE with nPSCCH = 23 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 46
	RESOURCE #2 : PRB 14, SUBFRAME 50
PSCCH Resource Allocation for UE with nPSCCH = 24 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 49
	RESOURCE #2 : PRB 14, SUBFRAME 53
PSCCH Resource Allocation for UE with nPSCCH = 25 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 50
	RESOURCE #2 : PRB 14, SUBFRAME 54
PSCCH Resource Allocation for UE with nPSCCH = 26 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 53
	RESOURCE #2 : PRB 14, SUBFRAME 57
PSCCH Resource Allocation for UE with nPSCCH = 27 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 54
	RESOURCE #2 : PRB 14, SUBFRAME 58
PSCCH Resource Allocation for UE with nPSCCH = 28 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 57
	RESOURCE #2 : PRB 14, SUBFRAME 61
PSCCH Resource Allocation for UE with nPSCCH = 29 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 58
	RESOURCE #2 : PRB 14, SUBFRAME 62
PSCCH Resource Allocation for UE with nPSCCH = 30 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 61
	RESOURCE #2 : PRB 14, SUBFRAME 65

 -- Searching for SCI0 messages in the whole input waveform --

Searching for SCI0 message for nPSCCH = 0
******* FOUND a SCI-0 message *******
Information Recovery from SCI-0 message 7180480065 (hex format)
	Frequency hopping flag           :  0
	Resource Allocation Bitmap (INT) :  227
	Time Resource Pattern            :  0
	Modulation and Coding            :  9
	Timing Advance (not implemented) : --
	Group Destinatiod ID (nSAID)     :  101
	(RA Bitmap --> Assigned PSSCH PRBs : 2 3 4 5 6 7 8 9 10 11 )

Searching for SCI0 message for nPSCCH = 1
Nothing found

Searching for SCI0 message for nPSCCH = 2
Nothing found

Searching for SCI0 message for nPSCCH = 3
Nothing found

Searching for SCI0 message for nPSCCH = 4
Nothing found

Searching for SCI0 message for nPSCCH = 5
Nothing found

Searching for SCI0 message for nPSCCH = 6
Nothing found

Searching for SCI0 message for nPSCCH = 7
Nothing found

Searching for SCI0 message for nPSCCH = 8
Nothing found

Searching for SCI0 message for nPSCCH = 9
Nothing found

Searching for SCI0 message for nPSCCH = 10
Nothing found

Searching for SCI0 message for nPSCCH = 11
Nothing found

Searching for SCI0 message for nPSCCH = 12
Nothing found

Searching for SCI0 message for nPSCCH = 13
Nothing found

Searching for SCI0 message for nPSCCH = 14
Nothing found

Searching for SCI0 message for nPSCCH = 15
Nothing found

Searching for SCI0 message for nPSCCH = 16
Nothing found

Searching for SCI0 message for nPSCCH = 17
Nothing found

Searching for SCI0 message for nPSCCH = 18
Nothing found

Searching for SCI0 message for nPSCCH = 19
Nothing found
#### 
Searching for SCI0 message for nPSCCH = 20
Nothing found

Searching for SCI0 message for nPSCCH = 21
Nothing found

Searching for SCI0 message for nPSCCH = 22
Nothing found

Searching for SCI0 message for nPSCCH = 23
Nothing found

Searching for SCI0 message for nPSCCH = 24
Nothing found

Searching for SCI0 message for nPSCCH = 25
Nothing found

Searching for SCI0 message for nPSCCH = 26
Nothing found

Searching for SCI0 message for nPSCCH = 27
Nothing found

Searching for SCI0 message for nPSCCH = 28
Nothing found

Searching for SCI0 message for nPSCCH = 29
Nothing found

Searching for SCI0 message for nPSCCH = 30
******* FOUND a SCI-0 message *******
Information Recovery from SCI-0 message 7701500065 (hex format)
	Frequency hopping flag           :  0
	Resource Allocation Bitmap (INT) :  238
	Time Resource Pattern            :  1
	Modulation and Coding            :  10
	Timing Advance (not implemented) : --
	Group Destinatiod ID (nSAID)     :  101
	(RA Bitmap --> Assigned PSSCH PRBs : 13 14 15 16 17 18 19 20 21 22 )


Updated Resource Allocation Information based on recovered SCI0 messages
=======================================================
UE-specific Control Channel (PSCCH) Resource Allocation 
=======================================================
PSCCH Resource Allocation for UE with nPSCCH = 0 (max: 199):
	RESOURCE #1 : PRB  2, SUBFRAME 41
	RESOURCE #2 : PRB 13, SUBFRAME 42
PSCCH Resource Allocation for UE with nPSCCH = 30 (max: 199):
	RESOURCE #1 : PRB  3, SUBFRAME 61
	RESOURCE #2 : PRB 14, SUBFRAME 65
=====================================================
UE-specific Data Channel (PSSCH) Resource Allocation 
=====================================================
PSSCH SUBFRAME Allocation for UE (with I_trp = 0): Total 4 subframes, First 81, Last: 129
( PSSCH Subframes : 81 97 113 129 )
PSSCH SUBFRAME Allocation for UE (with I_trp = 1): Total 4 subframes, First 82, Last: 130
( PSSCH Subframes : 82 98 114 130 )
[UE 0] PSSCH Transport Block Size = 1544 bits (Mod Order : 2).
	PSSCH Bit Capacity = 11520 bits  (Symbol Capacity = 5760 samples).
[UE 30] PSSCH Transport Block Size = 1736 bits (Mod Order : 2).
	PSSCH Bit Capacity = 11520 bits  (Symbol Capacity = 5760 samples).
=======================================================
Reference Subframes 
=======================================================
( SLSS Subframes : 40 80 120 160 )

 -- Recovering data from the input waveform based on recovered SCI0s --
2 Data transport blocks will be recovered based on information provided by detected SCI-0 messages

Detecting data transport block 1/2 (for UE = 0)
CRC detection ok

Detecting data transport block 2/2 (for UE = 30)
CRC detection ok

The use of the sidelink interface for vehicle-to-vehicle (V2V) or vehicle-to-infrastructure communications has been introduced in the 3GPP standard in Rel.14. Sidelink V2X is heavily based on the Rel.12/13 sidelink communication mode. Two new sidelink communication modes are introduced in the respective 3GPP TSs/TRs, i.e. mode-3 and mode-4 (in addition to existing mode-1 and mode-2) to distinguish V2X from “Standard” D2D. The following new features and “tweaks” have been applied for coping with the peculiar features of the vehicle communications use cases, namely higher channel variability, lower required latency, and increased devices density:

Configuration

The configuration of the V2X communication setup is very similar to that of standard D2D communication. Two V2X sidelink modes are defined, mode-3 which specifies a “fully-controlled” (by the LTE eNB) resources allocation approach and mode-4 which corresponds to an autonomous approach. Currently only mode-3 is fully supported by the library.

With respect to the communication-specific configuration, the following parameters are used. Notice that these correspond to IEs from the newly defined (in Rel.14) SL-V2XCommResourcePool L3 structure:

UE-specific configuration (in scheduled mode) is communicated to the transmitting V2X UE using L1 DL signaling, and in particular the DCI Format 5A structure, as well as L3 signalling, i.e. RRC and SIB messages. The following parameters are introduced:

An example configuration is provided below:

NSLRB                           = 25;
NSLID                           = 301;
slMode                          = 3;
cp_Len_r12                      = 'Normal';
syncOffsetIndicator             = 0;
syncPeriod                      = 20; 
v2xSLSSconfigured               = true;
sl_OffsetIndicator_r14          = 40; 
sl_Subframe_r14                 = repmat([0;1;1;0],5,1); 
sizeSubchannel_r14              = 4;
numSubchannel_r14               = 3; 
startRB_Subchannel_r14          = 2; 
adjacencyPSCCH_PSSCH_r14        = true;
startRB_PSCCH_Pool_r14          = 14; 
networkControlledSyncTx         = 1;
syncTxPeriodic                  = 1;          
mcs_r14                         = [3; 4];
m_subchannel                    = [0; 0];
nsubCHstart                     = [1; 1];                           
LsubCH                          = [2; 1];
SFgap                           = [1; 0];
decodingType                    = 'Soft';
chanEstMethod                   = 'LS';
timeVarFactor                   = 0;

Running the example

V2X-compliant tx waveform is generated in the following way:

slBaseConfig = struct('NSLRB',NSLRB,'NSLID',NSLID,'cp_Len_r12',cp_Len_r12, 'slMode',slMode);
slSyncConfig = struct('syncOffsetIndicator', syncOffsetIndicator,'syncPeriod',syncPeriod);
slV2XCommConfig = struct('v2xSLSSconfigured',v2xSLSSconfigured,'sl_OffsetIndicator_r14',sl_OffsetIndicator_r14,'sl_Subframe_r14',sl_Subframe_r14,....
    'sizeSubchannel_r14',sizeSubchannel_r14,'numSubchannel_r14',numSubchannel_r14, 'startRB_Subchannel_r14',startRB_Subchannel_r14,...
    'adjacencyPSCCH_PSSCH_r14',adjacencyPSCCH_PSSCH_r14,'startRB_PSCCH_Pool_r14',startRB_PSCCH_Pool_r14);
slV2XUEconfig = struct('mcs_r14',mcs_r14, 'm_subchannel', m_subchannel, 'nsubCHstart', nsubCHstart, 'LsubCH', LsubCH, 'SFgap', SFgap);

tx_output = communication_tx( slBaseConfig, slSyncConfig, slV2XCommConfig, slV2XUEconfig );

AWGN channel may be induced in the following way:

SNR_target_dB = 30; % set SNR
noise = sqrt((1/2)*10^(-SNR_target_dB/10))*complex(randn(length(tx_output),1), randn(length(tx_output),1)); % generate noise
rx_input = tx_output + noise; % induce it to the waveform

Finally, the recovery/decoding operations for the processed waveform are called using the following snippet:

communication_rx(slBaseConfig, slSyncConfig, slV2XCommConfig,  ...
    struct(), ...
    struct('decodingType',decodingType, 'chanEstMethod',chanEstMethod, 'timeVarFactor',timeVarFactor),...
    rx_input );

The decoder initially searches (blindly) for SCI Format 1 messages, and if it detects one recovers the information contained in it and decodes accordingly the corresponding PSSCH. An example run for two “virtual” V2X UE transmissions is provided below:

===========================================================
PSCCH and PSSCH V2X COMMUNICATION RESOURCES POOL FORMATION 
===========================================================
V2X Communication Period starts @ subframe #40 and ends at subframe #239
( SLSS Subframes : 0 20 40 60 80 100 120 140 160 180 200 220 )
V2X PSxCH Subframe pool (total 100 subframes)
( V2X PSxCH Subframes : 41 42 45 46 49 50 53 54 57 58 61 62 65 66 69 70 73 74 77 78 81 82 85 86 89 90 93 94 97 98 101 102 105 106 109 110 113 114 117 118 121 122 125 126 129 130 133 134 137 138 141 142 145 146 149 150 153 154 157 158 161 162 165 166 169 170 173 174 177 178 181 182 185 186 189 190 193 194 197 198 201 202 205 206 209 210 213 214 217 218 221 222 225 226 229 230 233 234 237 238 )
V2X PSSCH PRB Pool contains  3 subchannels, of size  4 PRBs each, with lowest PRB index of subchannel #0 =  2
	[Subchannel  0] PRBs :  2  3  4  5 
	[Subchannel  1] PRBs :  6  7  8  9 
	[Subchannel  2] PRBs : 10 11 12 13 
V2X PSCCH PRB Pool contains  3 subchannels, of size  2 PRBs each, with lowest PRB index of subchannel #0 =  2
	[Subchannel  0] PRBs :  2  3 
	[Subchannel  1] PRBs :  6  7 
	[Subchannel  2] PRBs : 10 11 
============================================================
UE-specific Control Channel (PSCCH) V2X Resource Allocation 
============================================================
 PSCCH Subframes for user 1 : 41 42 
 PSCCH PRBs for user 1 (txOp = 1): 2 3 
 PSCCH PRBs for user 1 (txOp = 2): 6 7 
 PSCCH Subframes for user 2 : 45 
 PSCCH PRBs for user 2 (txOp = 1): 2 3 
=========================================================
UE-specific Data Channel (PSSCH) V2X Resource Allocation 
=========================================================
 PSSCH Subframes for user 1 : 41 42 
 PSSCH PRBs for user 1 (txOp = 1): 4 5 6 7 8 9 
 PSSCH PRBs for user 1 (txOp = 2): 8 9 10 11 12 13 
[UE 0] PSSCH Transport Block Size = 328 bits (Mod Order : 2).
	PSSCH Bit Capacity = 1440 bits  (Symbol Capacity = 720 samples).
 PSSCH Subframes for user 2 : 45 
 PSSCH PRBs for user 2 (txOp = 1): 4 5 
[UE 0] PSSCH Transport Block Size = 120 bits (Mod Order : 2).
	PSSCH Bit Capacity = 480 bits  (Symbol Capacity = 240 samples).

Loading Subframe 41 with V2X-PSCCH for user 1 (tx op: #1) [Used PRBs :  2  3 ]
SCI-1 (32 bits) message 1046000 (hex format) generated

Loading Subframe 41 with V2X-PSSCH for user 1 (tx op: #1) [nXID = 41310][Used PRBs :  4  5  6  7  8  9 ]

Loading Subframe 42 with V2X-PSCCH for user 1 (tx op: #2) [Used PRBs :  6  7 ]
SCI-1 (32 bits) message 1047000 (hex format) generated

Loading Subframe 42 with V2X-PSSCH for user 1 (tx op: #2) [nXID = 41517][Used PRBs :  8  9 10 11 12 13 ]

Loading Subframe 45 with V2X-PSCCH for user 2 (tx op: #1) [Used PRBs :  2  3 ]
SCI-1 (32 bits) message 408000 (hex format) generated

Loading Subframe 45 with V2X-PSSCH for user 2 (tx op: #1) [nXID = 1589][Used PRBs :  4  5 ]

Tx Waveform Passed from Channel...

Rx Waveform Processing Starting...
===========================================================
PSCCH and PSSCH V2X COMMUNICATION RESOURCES POOL FORMATION 
===========================================================
V2X Communication Period starts @ subframe #40 and ends at subframe #239
( SLSS Subframes : 0 20 40 60 80 100 120 140 160 180 200 220 )
V2X PSxCH Subframe pool (total 100 subframes)
( V2X PSxCH Subframes : 41 42 45 46 49 50 53 54 57 58 61 62 65 66 69 70 73 74 77 78 81 82 85 86 89 90 93 94 97 98 101 102 105 106 109 110 113 114 117 118 121 122 125 126 129 130 133 134 137 138 141 142 145 146 149 150 153 154 157 158 161 162 165 166 169 170 173 174 177 178 181 182 185 186 189 190 193 194 197 198 201 202 205 206 209 210 213 214 217 218 221 222 225 226 229 230 233 234 237 238 )
V2X PSSCH PRB Pool contains  3 subchannels, of size  4 PRBs each, with lowest PRB index of subchannel #0 =  2
	[Subchannel  0] PRBs :  2  3  4  5 
	[Subchannel  1] PRBs :  6  7  8  9 
	[Subchannel  2] PRBs : 10 11 12 13 
V2X PSCCH PRB Pool contains  3 subchannels, of size  2 PRBs each, with lowest PRB index of subchannel #0 =  2
	[Subchannel  0] PRBs :  2  3 
	[Subchannel  1] PRBs :  6  7 
	[Subchannel  2] PRBs : 10 11 
============================================================
UE-specific Control Channel (PSCCH) V2X Resource Allocation 
============================================================

 -- Searching for SCI1 messages and recover respective Data in the whole input waveform --

FOUND an SCI-1 message in [Subframe 41, PRB set : 2  3 ]
Information Recovery from SCI-1 message 1046000 (hex format)
Frequency resource location (INT)                                    :  4
Time gap between initial transmission and retransmission  (INT)      :  1
Modulation and Coding (INT)                                          :  3
Retransmission index                                                 :  0
Reserved information bits (INT)                                      :  0
	(FRL Bitmap --> nsubCHstart = 1, LsubCH = 2)
Recovering Data Message in corresponding resources
[UE 0] PSSCH Transport Block Size = 328 bits (Mod Order : 2).
	PSSCH Bit Capacity = 1440 bits  (Symbol Capacity = 720 samples).
CRC detection ok

FOUND an SCI-1 message in [Subframe 42, PRB set : 6  7 ]
Information Recovery from SCI-1 message 1047000 (hex format)
Frequency resource location (INT)                                    :  4
Time gap between initial transmission and retransmission  (INT)      :  1
Modulation and Coding (INT)                                          :  3
Retransmission index                                                 :  1
Reserved information bits (INT)                                      :  0
	(FRL Bitmap --> nsubCHstart = 1, LsubCH = 2)
Recovering Data Message in corresponding resources
[UE 0] PSSCH Transport Block Size = 328 bits (Mod Order : 2).
	PSSCH Bit Capacity = 1440 bits  (Symbol Capacity = 720 samples).
CRC detection ok

FOUND an SCI-1 message in [Subframe 45, PRB set : 2  3 ]
Information Recovery from SCI-1 message 408000 (hex format)
Frequency resource location (INT)                                    :  1
Time gap between initial transmission and retransmission  (INT)      :  0
Modulation and Coding (INT)                                          :  4
Retransmission index                                                 :  0
Reserved information bits (INT)                                      :  0
	(FRL Bitmap --> nsubCHstart = 1, LsubCH = 1)
Recovering Data Message in corresponding resources
[UE 0] PSSCH Transport Block Size = 120 bits (Mod Order : 2).
	PSSCH Bit Capacity = 480 bits  (Symbol Capacity = 240 samples).
CRC detection ok

Acknowledgement

Part of the activities leading to this library received funding from the European Union’s Seventh Framework Programme under grant agreement no 612050, “FLEX Project”, and in particular FLEX Open Call 2 Project “FLEX-D: Experimenting with Flexible D2D communications Over LTE”. FLEX-D is carried out by Feron Technologies and University of Piraeus Research Centre, Greece.

Support

:envelope: Drop us an e-mail if you are interested in using/extending the library or you need further clarifications on the configuration/execution of the examples.