Closed ZiadHatab closed 2 years ago
I just read through the thread https://github.com/scikit-rf/scikit-rf/issues/651 I think it addresses a similar question as mine. From what I understood, in newer release the impedances will be flipped? correct me if I'm wrong.
Hello @ZiadHatab ,
Thank you a lot for your interest in CPW media and reporting this !
Can you try this : from_skrf = cpw.line(length, 'm', z0=cpw.Z0, embed=True)
?
I just read through the thread #651 I think it addresses a similar question as mine. From what I understood, in newer release the impedances will be flipped? correct me if I'm wrong.
We are looking forward to changing the behaviour described in #651, hopefully in the next release following the upcoming v0.23.0.
The new behaviour will be like this: if there is a media or line z0, the network port impedance will be Z0 renormalized to z0 (without the wrong impedance flip), else if there is none z0, the network will have Z0 for port impedance (again without the flip).
We did not find an agreement yet however to change z0 and Z0 names that are very error prone.
@mhuser
Thanks for the hint. I don't think writing cpw.line(length, 'm', z0=cpw.Z0, embed=True)
would do anything, as I'm embedding the line in its own characteristic impedance, because I didn't define a port impedance when constructing cpw
(see my code above).
In any case, I think I understand now how the CPW media works. I need to define my mismatch impedance as the port impedance in the main object CPW. Then, when I create a line I should set z0 to the characteristic impedance (similar to what you wrote). So, to get a correct mismatched line I would need to write:
z0_new = 20
cpw = CPW(freq, w=40e-6, s=25e-6, ep_r=12*(1-0.001j), t=5e-6, rho=2e-8, z0=z0_new)
from_skrf = cpw.line(length, 'm', z0=cpw.Z0, embed=True)
Now, I'm going to be honest with you. This whole thing with port impedance in the CPW object makes no sense to me. Why even including it to begin with? I mean, a transmission should be defined, by default, only by its characteristic impedance. After that, the user can do whatever he wants, to renormalize it to whatever he desire. So, for me something like this makes more sense:
cpw = CPW(freq, w=40e-6, s=25e-6, ep_r=12*(1-0.001j), t=5e-6, rho=2e-8) # no mention of Z0 nor z0
matched_line = cpw.line(1e-3, 'm')
mismatched_line = cpw.line(1e-3, 'm').renormalize(z0_new) # the ports are now set to z0_new
I think a transmission line should only be defined by its characteristic impedance, and it is the responsibility of the user to renormalize it to create a mismatch line or what ever he wants. I say this, because I work a lot with EM simulations as HFSS, and there when you define a wave port, you always get the results referenced to characteristic impedance of the port. After that you can renormalize it to whatever you want. The same goes with (multiline) TRL calibration, by default your reference impedance is the characteristic impedance of the lines, after that you renormalize to whatever you want.
So, what I'm trying to say is: just deprecate both Z0 and z0 from transmission line media, and put a message to the user that they need to use .renormalize()
if they want their network to be in a different impedance than the characteristic impedance of the line. Of course, Z0 (characteristic impedance) should remain as a property of the CPW object, similar to the effective epsilon and gamma.
Anyways, thanks for the clarification :)
Now, I'm going to be honest with you. This whole thing with port impedance in the CPW object makes no sense to me. Why even including it to begin with? I mean, a transmission should be defined, by default, only by its characteristic impedance. After that, the user can do whatever he wants, to renormalize it to whatever he desire. So, for me something like this makes more sense:
Thank you a lot for your feedback and honesty @ZiadHatab :) Your understanding sounds correct. Currently the embed
parameter almost does not works at all outside defining z0
at media initialization and with the z0=media.Z0 trick.
This could even be worse as you think: not only CPW but all media inherit from this behaviour.
I think this come from the past and from a kind of misusage with some users wanting to define an arbitrary impedance line quick (but without using an appropriated media such as DefinedGammaZ0
) and others wanting to see "the same line as if measured on a 50 ohm VNA". However, having only the raw Z0 line would be much simpler.
Hi!
I was running some numerical tests with the CPW media object and I was using the method line(). As I wanted a mismatched line, I used the "embed=True" option. But when I checked the phase of S11 (or S22) of the resulted network, it comes with a flipped sign (180deg offset).
I did my own testing and implemented my own TL method using the equations in:
In all cases, I get the correct answer. Interestingly, when I don't use the "embed=True" option, and afterward just renormalize the network, then I get the same answer as in the paper.
Below is my code. I think the problem is that the impedances are flipped in the line() method, because when I flip the impedances in my implementation, then I get the same result as in line(embed=True).