# Problem with generate effective permittivity and reflection coefficient?

27 views

### Md. Imtiaz Kamrul

Oct 4, 2021, 11:00:44 AMOct 4
to scikit-rf
Hi, I'm trying to solve the effective permittivity of my transmission line, but it's not generating properly. I'll give my code here. Please assist me in addressing the problems. (I've included the incorrectly generated plot in the attachment.)

########################
import skrf
from skrf.media import CPW, Coaxial
import numpy as np
import matplotlib.pyplot as plt
skrf.stylely()

# load all measurement data into a dictionary
data = skrf.read_all_networks('C:/Users/Imtiaz/Desktop/Lab Material/4. FCCL with new Parameter/Week 17/Data/3. Python Based/')

# pull  out measurements by name into an ordered list

measured_names = ['thru', 'reflect', 'line1', 'line2']
measured = [data[k] for k in measured_names]

# DUT
dut_meas = data['DUT']

# define the line lengths in meters (including thru)

l = [0.01, 0.01398, 0.01092]

#Do the calibration
cal = skrf.NISTMultilineTRL(
measured = measured,  #Measured standards
Grefls = , #Reflection coefficient of the reflect, -1 for short (+1 for open)
l = l,         #Lengths of the lines
er_est = 2.618727,    #Estimate of transmission line effective permittivity
)

#Correct the DUT using the above calibration
corrected = cal.apply_cal(dut_meas)

corrected.plot_s_db()

dut_meas.s21.plot_s_db()
corrected.plot_s_db(m=1, n=0)

# Run NIST Multiline TRL calibration with different combinations of lines

#Put through and reflect to their own list ...
mtr = measured[:2]

#and lines on their own
mlines = measured[2:]

# define the line lengths in meters
line_len = [0.01398, 0.01092]

cals = []
duts = []

line_combinations = [ , , [0,1]]

for used_lines in line_combinations:

m = mtr + [mlines[i] for i in used_lines]

#Add thru length to list of line lengths
l =  + [line_len[i] for i in used_lines]

#Do the calibration
cal = skrf.NISTMultilineTRL(
measured = m,  #Measured standards
Grefls = , #Reflection coefficient of the reflect, -1 for short
l = l,         #Lengths of the lines
er_est = 2.618727,    #Estimate of transmission line effective permittivity
)

#Correct the DUT using the above calibration
corrected = cal.apply_cal(dut_meas)
corrected.name = 'DUT, lines {}'.format(used_lines)

duts.append(corrected)
cals.append(cal)

plt.figure()
plt.title('DUT S21')
for dut in duts:
dut.plot_s_db(m=1, n=0)

plt.figure()
plt.title('DUT S11')
for dut in duts:
dut.plot_s_db(m=0, n=0)

#Normalized Standard Deviation

f_ghz = dut.frequency.f_scaled

plt.figure()
plt.title('Calibration normalized standard deviation')
for e, cal in enumerate(cals):
plt.plot(f_ghz, cal.nstd, label='Lines: {}'.format(line_combinations[e]))
plt.ylim([0,50])
plt.legend(loc='upper right')
dut.frequency.labelXAxis()

#define calibration standard media
freq = dut.frequency
cpw = CPW(freq, z0=49.9009, w=0.000104, s=5e-05, ep_r=3.5,
t=1.2e-05)

#Get the cal with all the lines
cal = cals[-1]

#Plot the solved effective permittivity of the transmission lines
c = 299792458.0
real_er_eff = -(cpw.gamma/(2*np.pi*f_ghz*1e9/c))**2

plt.figure()
plt.title('CPW effective permittivity')
plt.plot(f_ghz, cal.er_eff.real, label='Solved er_eff')
plt.plot(f_ghz, real_er_eff.real, label='Actual er_eff')
plt.legend(loc='upper right')

lines = [cpw.line(l, 'm') for l in line_len]
short = cpw.delay_short(10e-6, 'm')

actuals = [
cpw.thru(),
skrf.two_port_reflect(short, short),
]

actuals.extend(lines)
plt.figure()
plt.title('Solved and actual reflection coefficient of the reflect standard')
cal.apply_cal(measured).plot_s_deg(n=0, m=0)
actuals.plot_s_deg(n=0, m=0)

plt.show(block=True)  ### Julien Hillairet

Oct 5, 2021, 3:10:58 AMOct 5
Dear Md. Imtiaz Kamrul,

Without some data, the code cannot be tested. Could you share a sample of data as well?

By the way, what do you expect and why do you think there are problems?

Best regards,

Julien

--
You received this message because you are subscribed to the Google Groups "scikit-rf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-rf+...@googlegroups.com.

### Md. Imtiaz Kamrul

Oct 5, 2021, 4:13:06 AMOct 5
to scikit-rf
Thank you first for your reply.  I am providing data for my Code in here. I'd like to determine my transmission line's actual effective permittivity. If you look at the example, you'll notice that it generates a graph with effective permittivity.

Here is the data file link:

### Julien Hillairet

Oct 5, 2021, 1:41:07 PMOct 5
I am not familiar with your measurements, but I would suspect something wrong with them: on the thru, S21 is below -40db and S11 higher than -5dB, so a bit strange to me for a thru, isn't it?

Julien

--
You received this message because you are subscribed to the Google Groups "scikit-rf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-rf+...@googlegroups.com.

### alexander arsenovic

Oct 5, 2021, 1:50:49 PMOct 5
troubleshooting calibration is hard  and time consuming. in my experience it can be  hard to tell if its a bug, or your measurements.

### Max Kellermeier

Oct 6, 2021, 3:33:21 AMOct 6

Hi everyone,

Maybe to add to Julien’s comment about S21 being low and S11 being large for a “thru”, could it be that the “reflect” and the “thru” standard were accidently mixed up? The same observation holds for the “reflect” standard. Reflections S11 and S22 are rather small (-20db to -30db) while transmission is rather larger (mainly above -3 db).

Further, „line1“ and „line2“ are rather similar to „reflect“ although one would expect them to be similar to „thru“.

Best,

Max

### Md. Imtiaz Kamrul

Oct 6, 2021, 3:56:50 AMOct 6
to scikit-rf
I am providing a new data file with new measurement...Is it okay now?

### Max Kellermeier

Oct 6, 2021, 4:21:32 AMOct 6