Random2.cpp
Random2.cpp
Submitted by:
We hereby declare that the work which is being presented in this report entitled “Design of Multi-
Band RIS using Machine Learning” in partial fulfilment of the requirements for the award of
the degree of BACHELOR OF TECHNOLOGY in Electronics and Communication
Engineering to the Department of Electronics and Communication Engineering, Indian Institute
of Technology Roorkee is an authentic record of our own work carried out under the supervision
of Dr. Akhilesh Mohan, Department of Electronics and Communication Engineering, Indian
Institute of Technology Roorkee. This work has been done during July 2024 to November 2024.
We have not submitted the matter embodied in this report for the award of any other degree or
diploma.
Date: 28/11/2024
Place: Roorkee
This is to certify that the project report entitled “DESIGN OF MULTI-BAND RIS USING
MACHINE LEARNING” submitted by Abhinav Maurya and Shalini Meena to the Department
of Electronics and Communication Engineering, Indian Institute of Technology Roorkee toward
partial fulfilment of the requirements for the degree of BACHELOR OF TECHNOLOGY in
Electronics and Communication Engineering is a record of bonafide work carried out under my
supervision and guidance.
Date: 28/11/2024
Place: Roorkee
I would like to express my sincere gratitude to Prof. Akhilesh Mohan for providing me with the
invaluable opportunity to work on this project. His guidance, support, and expertise have been
instrumental in shaping this report and in enhancing my understanding of the subject matter.
We are truly fortunate to have had the opportunity to work under Prof. Akhilesh
Mohan supervision. Their enthusiasm for the subject matter and their will-ingness to
share their expertise have been inspirational. I am grateful for the time and effort they
invested in helping us develop our technical skills and research capabilities.
I am also grateful to Ph.D. scholar Vimal Kumar who contributed his time, insights, and assistance
throughout the course of this project. His input has been invaluable and has greatly enriched the
quality of this report.
ABSTRACT
Creating efficient transmit arrays requires accurately defining their configurations to achieve
specific electromagnetic properties. Traditional design techniques, which rely on established
theories like Huygens' principle and wave matrix models, often involve complex calculations
and depend heavily on expert knowledge. These methods can be time-consuming and
difficult to scale for modern needs.
This project uses Generative Adversarial Networks (GANs) to simplify and enhance the
design process. GANs are a type of artificial intelligence that excels at generating realistic
and complex outputs by learning patterns from data. Paired with a fully connected neural
network, this approach allows for a streamlined method to design transmit arrays by directly
i
mapping input requirements to optimal configurations, making the process faster, more
accurate, and easier to implement.
Conditional Generative Adversarial Networks (cGANs) to refine the design process and
achieve higher accuracy. By conditioning the output on specific design requirements, such
as desired electromagnetic parameters, cGANs ensure the generated configurations align
closely with target specifications. This approach enhances the precision and relevance of the
design while leveraging a fully connected network to streamline the mapping from input
parameters to optimal transmit array configurations.
To streamline data preprocessing and optimize the workflow for training the cGANs model,
Bash scripting was employed for efficient data handling. The scripts automated tasks such
as data extraction, transformation, and formatting to ensure consistency and accuracy in the
input datasets. By leveraging Bash's powerful text processing capabilities, the pipeline
efficiently managed large-scale datasets, reducing manual intervention and expediting the
model preparation process. It eases the work of managing large datasets.
ii
CONTENTS
DECLARATION................................................................................................................................ 3
CERTIFICATE .................................................................................................................................. 4
ACKNOWLEDGEMENT .................................................................................................................... 5
ABSTRACT ...................................................................................................................................... i
CONTENTS .....................................................................................................................................iii
1 Introduction .......................................................................................................................... 6
2 Implementation ...................................................................................................................11
iii
LIST OF FIGURES
Figure 1.1 Cellular mMIMO vs CF-mMIMO. Error! Bookmark not defined.
Figure 1.2 PHY layer signal processing for centralized, distributed and 7.2x split realization.
8
Figure 2.1 CPU and AP connections with internal layers. 11
Figure 2.2 The proposed functional split for SRS. 15
Figure 2.3 The proposed functional split for PDSCH. 15
Figure 2.4 The proposed functional split for PUSCH. 15
Figure 3.1 Cell-free network visualization of 100 APs and 10 UEs 17
Figure 3.2 Throughput with increasing number of APs. 18
Figure 3.3 ECDF of cell throughput. 18
Figure 3.4 Average cell BLER across simulation time. 18
iv
LIST OF TABLES
Table 2.1 Summary of CPU layers and their functioning 12
Table 3.1 System-level simulation parameters 16
Table 3.2 Physical channel test configuration. 17
v
1 Introduction
1.1 Motivation and Background
Electromagnetic meta-surfaces, which typically consist of metallic scatterers and sub-
wavelength dielectric substrates, have attracted significant attention and found broad
applications across various engineering domains. These include electromagnetic wave
absorption, spatial filtering, anomalous reflection, wave-front manipulation, and dispersion.
Over the past several decades, traditional design methods have been classified into three
main categories: analytical techniques that use Huygens' principle and wave matrices; the
transmission line-based circuit modelling approach; and general super-surface synthesis
methods. However, all these approaches are part of the forward design process, which
involves creating a prototype to achieve the desired electromagnetic response. The selection
of the initial structure often depends on the designer's expertise and foundational
electromagnetic theory, resulting in increased design complexity and challenges.
In contrast, inverse design has gained increasing interest, fuelled by advances in machine
learning and the enhanced computing power provided by modern graphics processing units.
This approach offers a significant advantage in minimizing artificial interference and
provides greater autonomy from designers, especially in the context of nano- and photonic
devices. Despite this, conventional forward design structures, such as the Jerusalem cross,
single split-ring, complete square ring, and dog-bone designs, are still commonly used as
starting points for inverse design models. Consequently, the outcomes of these methods are
often constrained by the initial structure's size and performance limitations.
This paper proposes a novel approach to the reflective meta-surface inverse design using a
Generative Adversarial Network (GAN), achieving an accuracy of 65%. The key
innovations and contributions of the proposed work are outlined as follows:
2. The meta surface unit's bottom layer incorporates a solid metal ground structure,
maintaining consistency in the reflected amplitude of the incident wave. The output
6
1. Introduction
layer of the neural network is expanded, with each element assigned distinct phase
shift values across multiple operating frequencies, which improves the frequency
bandwidth of the unit compared to single-frequency designs.
The final simulated design achieves a side-lobe level (SLL) of 23 dB in the far-field, with a
system efficiency of 36% and a relative 3-dB bandwidth of 7%. These simulation results
suggest that the proposed methodology holds significant potential for the design of multi-
functional meta surfaces.
CF-mMIMO stands out from traditional MIMO networks by having many more access
points (APs) than user equipments (UEs). These studies introduced a unique analytical
approach, considering incomplete channel information, unlike the previous perfect
information assumption. One study suggested localized processing at each AP, while others
showed benefits from partial or full centralization, enhancing efficiency.
7
1. Introduction
1.2 Realizations
The approach described for meta surface design leverages machine learning techniques to
optimize the design process by bridging the gap between geometric parameters and
electromagnetic (EM) responses. In this method, a forward solver algorithm is first used to
generate a dataset of EM responses for a variety of cylindrical structures with different
parameter combinations. These datasets are then used to train a deep neural network,
known as the forward network, which can predict the EM response based on the given
input parameters. Essentially, the forward network learns the relationship between the
geometric parameters of the meta surface and the resulting EM response, allowing for
faster and more efficient design iterations compared to traditional simulation methods.
In parallel, an inverse network is trained through the same process, but with a reversed
objective. Instead of predicting the EM response from a set of parameters, the inverse
network takes the desired EM response as input and outputs the corresponding geometric
parameters of the meta surface that would produce that response. This inverse mapping
allows for the direct generation of structural designs that meet specific performance
criteria. The final optimized solutions from the inverse network are then verified using the
forward solver to ensure that the predicted designs produce the desired EM response. This
combined use of forward and inverse networks enables a more streamlined and adaptive
approach to meta surface design, significantly enhancing the efficiency of the design
process while maintaining accuracy and performance standards.
Figure 1.1 PHY layer signal processing for centralized, distributed and 7.2x split realization.
8
1. Introduction
9
1. Introduction
𝑘∈𝛫𝑚 𝑘∈𝛫\𝛫𝑚
where 𝐻𝑚𝑘 ∈ 𝒞 𝒩×ℒ is the uplink channel between UE−𝑘 and AP-𝑚 , 𝑋𝑘ul ∈ 𝒞 ℒ×ℒ is a
ul
diagonal matrix representing the transmitted signal of UE-𝑘 over 𝐿 subcarriers, and 𝑁𝑚 ∼
𝒩×ℒ (0, 2 )
𝒞𝒩 σ is the additive white Gaussian noise (AWGN) at AP-𝑚. The respective
terms in the above summation represent the intended UEs signal, the interfering UEs signal,
and the noise (from left to right).
It is worthwhile to mention here that the above equation, captures the uplink pilot
transmission as well as the uplink data transmission. For uplink pilot transmission, we
consider ϕ𝑘 as pilot signal vector of length 𝐿 assigned to UE-𝑘, i.e., 𝑋𝑘ul (𝑙, 𝑙) = ϕ𝑘 (𝑙),
where 𝑙 ranges from 1 to 𝐿. For uplink data transmission, 𝑋𝑘ul (𝑙, 𝑙) ∈ 𝒜, where 𝒜 is the
modulation set. Here, off-diagonal elements are zero in both the pilot and data
transmissions, i.e., 𝑋𝑘ul (𝑙, 𝑙̂) = 0 for 𝑙 ≠ 𝑙̂.
𝑦𝑘𝑑𝑙 = ∑ 𝑣𝑒𝑐𝑡(𝐻𝑚𝑘
𝐻
∑ 𝑊𝑚𝑘 ′ 𝑋𝑘𝑑𝑙′ ) + ∑ 𝐻
𝑣𝑒𝑐𝑡(𝐻𝑚𝑘 ∑ 𝑊𝑚𝑘 ′ 𝑋𝑘𝑑𝑙′ ) + 𝑛𝑘𝑑𝑙
𝑚∈𝛭𝑘 𝑘 ′ ∈𝛫𝑚 𝑚∈𝛭\𝛭𝑘 𝑘 ′ ∈𝛫𝑚
where 𝑋𝒌dl ∈ 𝒞 ℒ×ℒ is a diagonal matrix representing the modulated signal for UE-𝑘, 𝑊𝑚𝑘 ∈
𝒞 𝒩×ℒ is the transmit precoding matrix corresponding to the link between AP-𝑚 and UE-𝑘,
and 𝑛𝑘dl ∼ 𝒞𝒩 ℒ×1 (0, σ2 ) is the AWGN.
Here, the operator 𝑣𝑒𝑐𝑡(𝐴) transforms the matrix 𝐴 to vector 𝑎 by selecting its diagonal
elements. The respective terms in the above summation denote the intended APs signal, the
interfering APs signal, and the noise (from left to right).
10
2 Implementation
All APs establish connections to a high-capacity CPU through forward connections. This
configuration essentially transforms the APs into remote radio units, collaborating to
facilitate seamless communication with user equipment. The fronthaul network can
incorporate a mix of not only wireless but also wired links, organized in either a star or mesh
topology. The techniques outlined in this research can be employed for front-end topologies
of any kind.
We have used MATLAB to implement this system. There we created two new entities CPU
and AP. And modified an existing entity UE. The Architecture we used is a 3-layer
architecture for CPU and a single-layer Architecture for AP (Shown in Figure 2.1). No major
changes have been made in UE in terms of its architecture.
Note that this is a system-level simulation and we are sticking with 5G NR standards so we
will be using the codebook-based precoding to calculate a precoder for specified channels
also as MATLAB 5G toolbox supports perfect channel estimation we are also going to
implement the thing in same way. Most of the processing will follow the 3GPP standards
11
2. Implementation
and we are going to modify the data slowly and try to integrate the Cell-Free System with
the existing 5G toolbox. Also, we will be making suitable assumptions based on the
availability of functions and methods to calculate this precoder and many other workarounds
that are there in the 5G toolbox.
Layer Functions
Medium Access Control (MAC) Channel access control, frame formatting, prioritization
In our implementation we haven’t made any changes to this Layer and its functionality, it
will be operating according to the 5G system only.
12
2. Implementation
The Scheduler considers three scheduling strategies, Round Robin, Maximum CQI and
Propositional Fair, we can specify that at the beginning of the simulation.
We have three different implementations based upon the Realization we choose among
centralized, distributed or 7.2x split realization. All those implementations are encapsulated
in the single class entity. We can toggle between them while setting up the CPU by
providing a split value.
#!/bin/bash
output_file="matrix_configurations.xlsx"
temp_csv="matrix_temp.csv"
echo "ConfigurationID,MatrixValues" > "$temp_csv"
for i in $(seq 1 1000); do
matrix=$(for j in $(seq 1 100); do echo -n "$((RANDOM % 2)),"; done | sed 's/,$//')
echo "$i,\"$matrix\"" >> "$temp_csv"
done
ssconvert "$temp_csv" "$output_file"
rm "$temp_csv"
echo "Matrix configurations saved to $output_file."
13
2. Implementation
#!/bin/bash
for i in $(seq 1 1000); do
folder_name="BTP_PATTERN_$i"
angle_file="$folder_name/Angle_Pat_$i.xlsx"
magnitude_file="$folder_name/Magnitude_Pat_$i.xlsx"
if [[ -d "$folder_name" ]] && [[ -f "$angle_file" ]] && [[ -f "$magnitude_file" ]]; then
echo "Processing files in folder: $folder_name"
ssconvert "$angle_file" "$folder_name/Angle_Pat_$i.csv"
awk -F, 'NR==1 {print $0; next} {print $0 | "sort -t, -k2,2n"}' "$folder_name/Angle_Pat_$i.csv" >
"$folder_name/Sorted_Angle_Pat_$i.csv"
ssconvert "$folder_name/Sorted_Angle_Pat_$i.csv" "$folder_name/Sorted_Angle_Pat_$i.xlsx"
rm "$folder_name/Angle_Pat_$i.csv" "$folder_name/Sorted_Angle_Pat_$i.csv"
ssconvert "$magnitude_file" "$folder_name/Magnitude_Pat_$i.csv"
awk -F, 'NR==1 {print $0; next} {print $0 | "sort -t, -k2,2n"}' "$folder_name/Magnitude_Pat_$i.csv" >
"$folder_name/Sorted_Magnitude_Pat_$i.csv"
ssconvert "$folder_name/Sorted_Magnitude_Pat_$i.csv" "$folder_name/Sorted_Magnitude_Pat_$i.xlsx"
rm "$folder_name/Magnitude_Pat_$i.csv" "$folder_name/Sorted_Magnitude_Pat_$i.csv"
echo "Processed and sorted files in $folder_name"
else
echo "Folder or files missing: $folder_name"
fi
done
echo "Processing complete for all folders."
The script automates the processing of Excel files in multiple folders (BTP_PATTERN_1 to
BTP_PATTERN_1000), with each folder containing two Excel files: Angle_Pat_i.xlsx and
Magnitude_Pat_i.xlsx. The script begins by looping through the folder names using a
for loop (for i in $(seq 1 1000)), iterating from 1 to 1000. It checks whether each
folder and its corresponding Excel files exist with if [[ -d "$folder_name" ]] && [[
-f "$angle_file" ]] && [[ -f "$magnitude_file" ]].
For data processing, the ssconvert function (from the gnumeric package) is used to
convert Excel files to CSV format (ssconvert "$angle_file"
"$folder_name/Angle_Pat_$i.csv"), allowing easier manipulation. The awk command
is then used to sort the data in CSV files by the second column (frequency) using the -F,
flag to specify the delimiter and the sort -t, -k2,2n function for sorting. The sorted
CSV data is converted back to Excel format with ssconvert (ssconvert
"$folder_name/Sorted_Angle_Pat_$i.csv"
"$folder_name/Sorted_Angle_Pat_$i.xlsx").
Finally, the script cleans up temporary CSV files using the rm command to remove
intermediate files (rm "$folder_name/Angle_Pat_$i.csv").
14
2. Implementation
2.3 Layers of UE
Similar to the CPU, UE also has three layers, and they are the same with their functionalities.
The downlink signal decoding methods are modified to account for multiple connectivity of
UE. The uplink signal processing is kept the same.
2.3.1
2.4 Signal Processing
Similar to the above, AP-𝑚 receives the signals from all the UEs as in uplink system model
equation and converts them to a digital waveform. The AP removes the CP from the digital
waveform and performs FFT to obtain the time-frequency grid. The grid is subsequently
used for local LS channel estimation, MMSE equalization, layer demapping, and
descrambling to obtain the LLR values, say ̂𝑏 LLR . These LLR values are then transmitted to
𝑚𝑘
̂
the CPU, where they are added for UE-𝑘 across the APs in ℳ𝓀 , as follows, 𝑏 LLR ̂
= ∑𝑏 LLR
𝑘 𝑚𝑘 .
This 𝒃LLR
𝑚𝑘 is used for the TB decoding of UE-𝑘 data.
15
3 Simulation and Results
We investigate the performance of the end-to-end CF-mMIMO system for centralized and
distributed realizations and compare it with the mMIMO cellular (5G) system. To evaluate
the performance, we consider 100 APs with four antennae each, uniformly distributed over
1000 × 1000 𝑚2 along with 10 single antenna UEs. Also, we consider that each UE is
served by a maximum of four nearest APs, and an AP can serve any number of UEs. The
detailed list of system and physical channel parameters is tabulated in Table 3.1 and 3.2 as
per the 3GPP test configurations. The modulation, code rate, payload size and code block
size are dynamically selected based on CSI calculated at the CPU for each UE. For obtaining
the results for the cellular system, we consider the BS employing 32 antennas and serving
the UEs at a transmit power of 34 dBm. The rest of the physical channel parameters are the
same as in Table 3.2.
16
3. Simulation and Results
17
3. Simulation and Results
3.1. Results
We evaluate the downlink performance and
outline the results in terms of empirical
cumulative distribution function (ECDF) of
throughput, average throughput (AT) for the
increasing number of APs, and the BLER by
averaging it over the increasing runtime. The
respective results are outlined in Fig. 3.2, 3.3,
3.4. From the figures, we can see the
centralized and distributed CF-mMIMO
Figure 3.3 ECDF of cell throughput.
18
3. Simulation and Results
3.2 Conclusion
From the above results, we can conclude that in general cell-free is outperforming cellular
with centralized realization performing better than distributed realization. We have
proposed an SRS-based channel estimation and precoding algorithm for the centralized and
distributed realization of the CF-mMIMO system by splitting the PUSCH and PDSCH
processing among the APs and the CPU. In the simulation result, we investigate the
performance of the design system-level simulator in terms of the throughput and BLER.
19
References
[1] Özlem Tugfe Demir; Emil Björnson; Luca Sanguinetti, Foundations of User-Centric
Cell-Free Massive MIMO , now, 2021.
[5] H. He, X. Yu, J. Zhang, S. Song and K. B. Letaief, "Cell-Free Massive MIMO for
6G Wireless Communication Networks," in Journal of Communications and
Information Networks, vol. 6, no. 4, pp. 321-335, Dec. 2021, doi:
10.23919/JCIN.2021.9663100.
[6] ETSI TS 103 859 V7.0.2 (2022-09). O-RAN Fronthaul Control, User and
Synchronization Plane Specification v07.02; (O-RAN-WG4.CUS.0-v07.02).
20