### Author Topic: Converting magnitude ratio to complex form  (Read 894 times)

0 Members and 1 Guest are viewing this topic.

#### chamathkv

• Newbie
• Posts: 2
• Country:
##### Converting magnitude ratio to complex form
« on: April 11, 2018, 03:43:57 am »
Greetings,

I recently acquired an AD8302 module http://www.analog.com/media/en/technical-documentation/evaluation-documentation/AD8302.pdf which reads to signals and provides an analog reading showing the magnitude ratio. I want to convert this to complex form in order to create a touchstone file (.s1p) http://na.support.keysight.com/plts/help/WebHelp/FilePrint/SnP_File_Format.htm. What is the formula to convert a magnitude ratio (dB) to complex form? (x + iy)

#### TheUnnamedNewbie

• Frequent Contributor
• Posts: 680
• Country:
• Sending EM through plastic.
##### Re: Converting magnitude ratio to complex form
« Reply #1 on: April 11, 2018, 05:32:08 am »
Magnitude is just that - magnitude. Without any information of phase, you cannot turn this into a real-imaginary format.
The best part about magic is when it stops being magic and becomes science instead

#### hagster

• Frequent Contributor
• Posts: 281
##### Re: Converting magnitude ratio to complex form
« Reply #2 on: April 11, 2018, 06:45:37 am »
Thats an interesting chip. It measures both magnitude ratio and phase difference.

I do note that the pgase measurement has a 180degree ambiguity. Not sure if there is an easy way to resolve that.

I dont see the problem in taking those and writing to it a touchstone file.

#### chamathkv

• Newbie
• Posts: 2
• Country:
##### Re: Converting magnitude ratio to complex form
« Reply #3 on: April 11, 2018, 03:54:59 pm »
Sorry, I forgot to mention that the phase is also provided.

#### hagster

• Frequent Contributor
• Posts: 281
##### Re: Converting magnitude ratio to complex form
« Reply #4 on: April 11, 2018, 04:45:23 pm »

Or touchstone files can have log amplitude phase data.
« Last Edit: April 11, 2018, 05:11:59 pm by hagster »

#### kerrsmith

• Regular Contributor
• Posts: 74
• Country:
##### Re: Converting magnitude ratio to complex form
« Reply #5 on: April 16, 2018, 08:05:58 am »
I have been using this chip (AD8302) myself for the last week or so and have also been hunting for this kind of information. The most useful site I have found so far is the 'HF Arduino Vna' one:

https://hamprojects.wordpress.com/2016/02/21/hf-arduino-vna-english-version/

This site explains a lot about creating your own VNA but as far as equations go their Github page is really good:

https://github.com/f4goh/VnArduino

Take a look at the file 'VnArduino.ino' starting at line 549, just after this point there is a list of all the equations needed to calculate things such as reflection coefficient, return loss, SWR and the real and imaginary parts of the impedance.
« Last Edit: April 17, 2018, 11:41:06 pm by kerrsmith »

#### Bud

• Super Contributor
• Posts: 2883
• Country:
##### Re: Converting magnitude ratio to complex form
« Reply #6 on: April 17, 2018, 04:49:57 am »
Sorry, I forgot to mention that the phase is also provided.

You can make a Touchstone file directly using mag(db) and phase, just make a right header for it, search for more information on Touchstone file format.

#### kerrsmith

• Regular Contributor
• Posts: 74
• Country:
##### Re: Converting magnitude ratio to complex form
« Reply #7 on: May 07, 2018, 11:54:17 pm »
I have been working with the AD8302 for a while now and have created a handy equations sheet to help me remember what I did to work out how the various calculations are derived.

This sheet shows how return loss, reflection coefficient, SWR, complex load impedance and mismatch loss are calculated using data from the AD8302.

I have attached the PDF to this post as a reference in case anyone else is interested in this.

Smf