Metadata-Version: 2.2
Name: de_embedding_rf
Version: 0.2.6
Summary: methods for de-embedding process: T-R-L, L-L and T-VR-L
Home-page: https://github.com/aplatag/project_de_embedding_rf.git
Author: Aplata
License: MIT
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-rf
Requires-Dist: matplotlib
Requires-Dist: scipy
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: summary

# De-embedding in Free Space Using the T-VR-L Method:
<div align="justify">
Free-space measurements require the use of identical antennas and a material under test (MUT). During this process, the obtained results include the effects of the error box, which comprises the effects of the antennas and the separation distance between them (see Figure 1). Therefore, a post-measurement de-embedding process is essential to isolate and extract only the S-parameters of the MUT.
</div>

<p align="center">
    <img src="https://raw.githubusercontent.com/aplatag/project_de_embedding_rf/main/img/setup.png" alt="methodology" width="500" >
</p>
<div align="center">
Figure 1. Measurement Scenario.
</div>


## Table of Contents
- [Required Measurements](#Required-Measurements)
- [Installation](#installation)
- [Code Example](#code-Example)



## Required Measurements

1.	**Embedded DUT**: It is necessary to save the data in a .s2p file.
2.	**Thru**: It is constructed by uniformly separating both antennas at a distance d1. It is necessary to save the data in a .s2p file.
3.	**Line**: It is constructed by moving only one antenna backward by a distance of λ/4.It is necessary to save the data in a .s2p file. 
4. **Reflect**: It is constructed by placing a reflective plate at the reference plane. This measurement is required if the user intends to apply the T-R-L method. It is necessary to save the data in a .s1p file for each port.

<div align="justify">

The "de-embedding-rf" program includes three example simulations named Thru.s2p, DUT.s2p, and Line.s2p, designed to implement and validate the T-VR-L method. Additionally, it features a simulation of a reflect standard, named open.s1p, which enables the application of the conventional T-R-L method.
</div>




## Installation

Instructions on how to install the project. For example:
```bash

pip install de-embedding-rf
```
## Code Example
For instance, the following code can be executed in Google Colab. Simply copy and paste it into a new Colab notebook.
<div align="justify">
**The variables "path_embedded_dut", "path_thru", "path_line_1", "path_reflect_port_1", and "path_reflect_port_2" represent the paths where the user’s data is stored. Addicionally, in the functions "CreateDict_TRL" and "CreateDict_TVRL", the parameter "example = False" must be set to allow the program to read the user’s data. If the user wishes to use the example data provided in the package, the paths should remain unchanged and "example=True".**
</div>
```bash

#--------------------------------------------------------------------------------
# 1) Load libraries:
import de_embedding.modules.visualization.plot_s_parameters as plot_trl_dut

from de_embedding.modules.methods.calibration_trl import CalibrationTRL
from de_embedding.modules.methods.calibration_trl_virtual import CalibrationSymmetricalTRL
from de_embedding.create_dict import CreateDict_TRL, CreateDict_TVRL

#--------------------------------------------------------------------------------
#1) data: 
path_embedded_dut = 'RA_dut_RB.s2p'
path_thru = 'Thru.s2p'
path_line_1 = 'L1.s2p' #line lambda/4
path_reflect_port_1 = 'open.s1p'
path_reflect_port_2 = 'open.s1p'

#--------------------------------------------------------------------------------

# 2) Create Dictionary:
dicc_TRL = CreateDict_TRL(path_embedded_dut,path_thru,path_line_1,path_reflect_port_1,path_reflect_port_2,example=True)
dicc_TVRL = CreateDict_TVRL(path_embedded_dut,path_thru,path_line_1,reflect='open',example=True)

#--------------------------------------------------------------------------------

#3) Execute Calibration Methods

# 3.1) TRL method
instant_ntwk_trl = CalibrationTRL(dicc_TRL)
ntwk_dut_TRL = instant_ntwk_trl.run()

# 3.2) T-Virtual Reflect-L method 
instant_ntwk_virtual_open = CalibrationSymmetricalTRL(dicc_TVRL)
ntwk_virtual_open = instant_ntwk_virtual_open.run()


#--------------------------------------------------------------------------------
#4) show figure of S parameters
plot_trl_dut.s_parameters_db_deg_unwrap( (ntwk_dut_TRL,'T-R-L method'),(ntwk_virtual_open,'T-VR-L method'))
plot_trl_dut.s_parameters_real_imag((ntwk_dut_TRL,'T-R-L method'),(ntwk_virtual_open,'T-VR-L method'))



```
