# Configuration

## Version

This field (`version`) takes a string value representing the targeted mmCEsim version. For compatibility convenience, this string can be used by the compiler to decide the behaviour. The current default value is the same as the compiler version (`0.1.0`).

## Meta

The `meta` is a map that provides metadata which can be used in report. The used fields now include: `title`, `description`, `author`.

## Physics

The `physics` map contains physical system settings.

### Frequency

The bandwidth is specified in `frequency` filed. Currently, this field does not do anything, which is always assumed to be `narrow` (narrow band) now.

### Off Grid

This is actually about the model. With the geometric channel model with grid, there can be off-grid (or power leakage) problems. Recently, there are also super resolution formulations to solve the problem. But we still adopt the grid representation for its popularity and simplicity. By setting `off_grid` field inside `physics` to `false`, you may not consider the off grid effect. The default value is `true`.

### Carriers

For a wideband system, you may specify the number of carriers used in OFDM. Its corresponding macros in CALC is ``CARRIERS_NUM``.

## Nodes

The `nodes` is a sequence (array) of nodes in the channel network. Transmitter (Tx), Receiver (Rx), Reconfigurable Intelligent Surface (RIS) are all considered node (channels are the connecting edges to these nodes). For each of its elements, you need to specify the following fields.

### ID

You need to specify a unique `id` for each node. They are used in `channels` so that we know the direction of channel.

### Role

The `role` field has valid values `transmitter` (`Tx`), `receiver` (`Rx`), and `RIS` (`IRS`).

### Num

The optional field `num` can be used to mean several copies of the same node can be available for simplicity. This is often used for multi-user scenarios. Currently, this value is discarded, and the number is always 1.

### Size

The `size` means the antenna/element number for a node. For Transmitters and receivers, it is the antenna number. For RIS, it is the number of reflecting elements. The value is a scalar for uniform linear array (ULA), and is a 2-value array (for example `[8, 4]`) for uniform planar array (UPA). For a 2-value array that has the second value set to 1, it is still regarded as a ULA.

Its corresponding macros in CALC are ``SIZE.T.x``, ``SIZE.T.y``, ``SIZE.T``, ``SIZE.R.x``, ``SIZE.R.y``, ``SIZE.R``, ``SIZE.*``.

### Beam

The number of beams. Dimensions similar to Size.

Its corresponding macros in CALC are ``BEAM.T.x``, ``BEAM.T.y``, ``BEAM.T``, ``BEAM.R.x``, ``BEAM.R.y``, ``BEAM.R``, ``BEAM.*``.

### Grid

The number of grids. Dimensions similar to Size. This is used in CALC function `\dictionary` and macro ``DICTIONARY.T`` and ``DICTIONARY.R``.

Its corresponding macros in CALC are ``GRID.T.x``, ``GRID.T.y``, ``GRID.T``, ``GRID.R.x``, ``GRID.R.y``, ``GRID.R``, ``GRID.*``.

### Beamforming

In the `beamforming` field, the variable name `variable` is set, and the beamforming scheme `scheme` is defined. The `scheme` supports `random` and `custom`. For a custom beamforming scheme, you also need to set the `formula` field with ALG language.

## Channels

The configuration `channels` is a sequence (array) of channel links. The settings for each channel link is shown below.

### ID

Similar to ID in Nodes, each channel link has a unique identifier as in field `id`.

### From

The node which the link channel is transmitter from. (`from`)

### To

The node which the link channel transmits to. (`to`)

### Sparsity

The `sparsity` (number of clusters) of the channel.

### Gains

The channel `gains` consisting of pass loss. There are two types of gains supported (`mode`): `normal` and `uniform`. For `normal` gains, `mean` and `variance` need to be specified. For `uniform` gains, `min` and `max` need to be set.

## Sounding

Information related to the sounding procedure is defined here.

### Variables

Channel `variables` names are defined here.

• `received`: received signal vector
• `noise`: received noise vector
• `channel`: the cascaded channel

## Preamble

The `preamble` is code part before main simulation (including sounding, estimation and report generation).

Custom functions can be defined here.

This part is specified using the ALG language.

## Estimation

The main code for `estimation`. Function `ESTIMATE` is used here to call the compressed sensing (CS) algorithms either defined in the standard ALG library or in the preamble.

Basic MIMO Example

For a basic MIMO example, the estimation part is about converting the mmWave channel estimation to a compressed sensing problem before using `ESTIMATE`, and recover the channel from the sparse result with `RECOVER`.

This part is specified using the ALG language.

## Conclusion

In `conclusion`, additional code after each simulation job is added here.

This part is specified using the ALG language.

## Appendix

The code in `appendix` is added after all jobs are done.

This part is specified using the ALG language.

## Simulation

### Backend

The `backend` includes `cpp` (C++ with Armadillo library), `python` (Python with NumPy library) and `matlab` or `octave`. This sets the language it exports to and the backend simulation bases on.

### Report

#### Text Report

The simulation report can be exported as plain text report, for example

#### LaTeX and PDF Report

LaTeX and its generated PDF report is also supported in addition to the plain text `.rpt` report.

Example