Excel S-Parameter Mixer

Click here to go to our main page on receivers

Click here to go to our main page on mixers

Click here to learn more about spectral inversion

Updated December 2021 to fix group delay calculation for high-side mixing.  Did you ever design a receiver in a linear simulation environment, like Microwave Office, then get stuck with questions: "how do I add a mixer and plot my receiver's instantaneous frequency response?"  Then at the design review:  "What does the IF filter do at RF frequencies?" "Are you sure the gain slope has been equalized?" Etc.

As a distraction, here's a song about a different type of mixer. This is a version of "Cement Mixer" by Alvino Rey recorded after WWII.  BTW, Alvino Rey was once a Lockheed employee, hopefully they have a statue of him in a lobby somewhere... The song was written and first recorded by Slim Galliard in the 1930s, but you need to learn Vout-o-Reenee to understand that version. If someone says your design is "meloroony", this is generally not a compliment. If you read the Unknown Editor's LinkedIn profile, you would know why "Cement Mixer Pu-Ti Pu-Ti" is near and dear to His Grace (thee, thine are appropriate UE pronouns).

Cement Mixer, Pu-Ti Pu-Ti

As you know or will soon find out, there is no way to add a mixer in the Microwave Office linear simulator. You could switch to large signal analysis which maybe your company didn't purchase, and even if it did it would take 10 times longer to simulate something.

What if you "mixed" the S-parameters of the IF amp so they corresponded to the RF frequency? Then you could cascade all the IF stuff with all the RF stuff, with a fake mixer in the middle (a fixed attenuator would be the simplest case).  Let's try it! Go to our download area and grab a copy of the S-parameter mixer spreadsheet. We'll try to explain it here on this page (let us know how we are doing!) Before we get any comments, you will need to do a separate spur analysis to see what products are polluting your spectrum.

We used Excel to make the mixing tool, but it does seem like cutting down an oak tree with a butter knife.  We had to make some compromises so that different numbers of frequency rows could be input, and moving the S-parameter file in and out of a spreadsheet can be a headache. Excel is what we are good at, and it is much better than doing the math with a crayon on a paper bag.  An executable file would be much better; if you volunteer to do this in MatLab, send us the result and we'll post it after we virus scan it. We'll send you a nice gift!

Here is the basic procedure we want to follow to modify S-parameters and put them back into Microwave Office (or other linear tools):

1. Import the chosen S2P "Touchstone" S-parameter file into Excel so you can manipulate the data.

2. Based on user inputs, subtract the chosen LO frequency and RF frequencies. If you used high-side mixing, you will subtract RF from LO. If you used low-side mixing, you will subtract LO from RF. We did not consider using the spreadsheet for up-conversion, where you need to add the LO to the IF frequencies; Oh well, we'll add that later, if anyone finds that useful.

3. For high-side mixing, you will need to re-sort the S-parameters so that the frequency rows increment up, which is a PITA. Our ;spreadsheet does this for you.

4. You will need to delete any negative frequencies or Microwave Office will "freq out". What would Foghorn T. Leghorn say to that?

5. You will have to delete a bunch of duplicate lines in the output file. What do you want for free?

6. The output must be copied into a text file with the file extension .s2p, and it must meet the Touchstone S2P format.


Suppose you are working on a new missile which your company plans to manufacture in Saudi Arabia so they can launch a few at people you have never met in Yemen... If your design doesn't work they will send you to Saudi Arabia to fix it. How do you feel about receiving 100 lashes for drinking a beer? Leadership wants you to your part for the shareholders, right? Foreign sales are sooooo profitable. Make sure that bomb uses lead-free solder!

Back to the subject at hand. The "system guy/gal" picked 20 GHz for the RF frequency and 3 GHz for the IF. Let's say you already went to EverythingRF, used their search tool, and picked out a CMD308P4 for the IF amp, but so far you have not decided on high-side or low side mixing, so we will look at it both ways.

Importing S-parameters from a Touchtone file to Excel

You downloaded the S-parameters in a file "cmd304p4_sparameters.s2p". To open it in Excel, change the file type to "all", then answer two questions: first, the file is delimited...

And second, the delimiters could be spaces or tab, so check both boxes.

Once imported, your Excel file will look like this. All that title stuff gets smeared into columns because the words were separated by spaces which are treated as delimiters. You have to break eggs to make an omelet, but we will put the eggs back together later.

Using the spreadsheet

Now, you have to copy the data into the "input data" page of our spreadsheet. Open up our spreadsheet and go to the "Load S-pars here" tab. Copy your S-parameters in, starting on row 26. Use the yellow field to insert (or cut and paste) any comments. And make sure that line 25 agrees with the format of the data (frequency units, dB or magnitude, etc.)

Then, go to the "Intermediate Calc" tab, and you will see some blue boxes for your inputs, and a pair of plots. You can plot any of the eight S-parameter columns versus frequency, but mainly you will want to look at column 3, which is S21 magnitude. Below, we have chosen low side mixing, with an IF frequency of 17 GHz. You can compare the unmixed and mixed plots below. Just a simple shift in the X axis, of 17 GHz. Note the IF amplifier that is intended for 3 GHz has its best "mixed" gain at 20 GHz, the RF frequency.

Next, let's look at the result with high-side mixing, in this case we chose 24 GHz as the LO frequency. The gain curve of the amplifier is now backwards. This is called "spectral inversion". Once again, the mixed gain sweet spot is at 20 GHz where we want it. Note that some of the plot is now at negative frequency. That is not a real thing, just something we need to delete later.

Update December 2021: It turns out that when you "mix" S-parameters with high-side LO, you need to take the conjugate of S21 and S12, and then group delay comes out as expected. Otherwise the group delay will appear negative when you plot it. This information is detailed in is a paper by Dr. Dylan Williams, reference at the bottom of the page. Thanks to Frauke for pointing this out. when he answered this message board post.

The spreadsheet has been updated to fix the high-side group delay problem, but the text below was not....

For yucks, we plotted the S21 phase angle for high-side mixing. In the band (near 20 GHz) the slope changes from negative to positive. Guess what that does to the group delay calculation? Hold that thought...


Outputting the file back to Touchstone format

Once you have chosen the LO frequency and high or low side mixing, the mixed S-parameters are available in the "output S-pars" tab. we even dropped in a comment about the mixing, on row 1, so you won't forget where this file came from. The image below is for the high-side mixer. Note the frequencies start with -16 GHz (negative 16 GHz). Now it's time to exit the Excel sandbox and create a valid S2P file, you will have to do a little work here. Make a copy of this worksheet into a brand new spreadsheet...

From the new spreadsheet, grab all the data and re-paste it in as "values" to get rid of all the formulas. Then delete any lines that include negative frequencies, or are duplicate frequencies. Now, save the save the data in a text file that is tab delimited. Then, rename the file extension to ".S2P".

Here is what that .txt file looks like.

You could just change the file extension to .s2p and hope for the best. Chances are, the file will have some problems. That is why we recommend "SDataConversion" by AWR. This executable file repairs all sorts of problems in S2P files. Unfortunately, we can't seem to find in on the Cadence web site. If you google "sdataconversion awr" you will see a zip file of it on a Chinese web site... we don't recommend trying that copy.  Send us a note and we will send you a non-virus-infected copy of the utility, circa 2006. Even better, tell Cadence to put it back on web.

Here is a link where you can download SdataConversion, verified November 2021 (we hope it lasts...)


Below is the dashboard of the SData Conversion utility. You pull up a file you want tweaked (it must end in ".s2p"), process it, and it is outputted with a "_mwo" suffix.


Here is what a proper, mixed, S2P file looks like.  That wasn't too hard, was it?

We imported the high-side mixed data into Microwave Office, and plotted S21 group delay. Yikes, it is negative! But this is just a consequence of spectral inversion.  The signal will still take positive (not negative) time to propagate.

You can do a lot more by building up an IF chain in MWO, then outputting one combined S-parameter file that you convert all at once. We're sorry we did not finsih the example, by cascading it with an RF chain.  Another time...

Did you find this useful? Let us know!


D. F. Williams, F. Ndagijimana, K. A. Remley, J. A. Dunsmore and S. Hubert, "Scattering-parameter models and representations for microwave mixers," in IEEE Transactions on Microwave Theory and Techniques, vol. 53, no. 1, pp. 314-321, Jan. 2005,


Author : Unknown Editor