Microsoft Excel Based S-parameter Device Analysis 

Software 

by Brianna Murphy, Ali Darwish, and Thomas Farmer 

ARL-TR-5339 September 2010 

Approved for public release; distribution unlimited. 
NOTICES 

Disclaimers 

The findings in this report are not to be construed as an official Department of the Army position 

unless so designated by other authorized documents. 

Citation of manufacturer’s or trade names does not constitute an official endorsement or 

approval of the use thereof. 

Destroy this report when it is no longer needed. Do not return it to the originator. 
Army Research Laboratory 

Adelphi, MD 20783-1197 

ARL-TR-5339 September 2010 

Microsoft Excel Based S-parameter Device Analysis 

Software 

Brianna Murphy, Ali Darwish, and Thomas Farmer 

Sensors and Electron Devices Directorate, ARL 

Approved for public release; distribution unlimited. 
ii 

REPORT DOCUMENTATION PAGE Form Approved 

OMB No. 0704-0188

Public reporting burden for this collection of information is estimated to average 1 hour per response, including the time for reviewing instructions, searching existing data sources, gathering and maintaining the 

data needed, and completing and reviewing the collection information. Send comments regarding this burden estimate or any other aspect of this collection of information, including suggestions for reducing the 

burden, to Department of Defense, Washington Headquarters Services, Directorate for Information Operations and Reports (0704-0188), 1215 Jefferson Davis Highway, Suite 1204, Arlington, VA 22202-4302. 

Respondents should be aware that notwithstanding any other provision of law, no person shall be subject to any penalty for failing to comply with a collection of information if it does not display a currently 

valid OMB control number. 

PLEASE DO NOT RETURN YOUR FORM TO THE ABOVE ADDRESS. 

1. REPORT DATE (DD-MM-YYYY) 

September 2010 

2. REPORT TYPE 

Final 

3. DATES COVERED (From - To) 

4. TITLE AND SUBTITLE 

Microsoft Excel Based S-parameter Device Analysis Software 

5a. CONTRACT NUMBER 

5b. GRANT NUMBER 

5c. PROGRAM ELEMENT NUMBER 

6. AUTHOR(S) 

Brianna Murphy, Ali Darwish, and Thomas Farmer 

5d. PROJECT NUMBER 

5e. TASK NUMBER 

5f. WORK UNIT NUMBER 

7. PERFORMING ORGANIZATION NAME(S) AND ADDRESS(ES) 

U.S. Army Research Laboratory 

ATTN: RDRL-SER-E 

2800 Powder Mill Road 

Adelphi, MD 20783-1197

8. PERFORMING ORGANIZATION 

 REPORT NUMBER 

ARL-TR-5339

9. SPONSORING/MONITORING AGENCY NAME(S) AND ADDRESS(ES) 10. SPONSOR/MONITOR'S ACRONYM(S) 

11. SPONSOR/MONITOR'S REPORT 

 NUMBER(S) 

12. DISTRIBUTION/AVAILABILITY STATEMENT 

Approved for public release; distribution unlimited. 

13. SUPPLEMENTARY NOTES 

14. ABSTRACT 

When collecting S-parameter data from a 2-port measurement device, such as a vector network analyzer (VNA), it is typically 

necessary to view this data on a computer other than the VNA for use in design or analysis of the measured device. To 

graphically view S-parameter data on a standard Microsoft Windows-based computer requires proprietary software, which 

typically requires licensing or installation. In an effort to eliminate the need for such proprietary software, a Microsoft Excel 

spreadsheet with built in macro software has been developed at the U.S. Army Research Laboratory (ARL) to read in and plot 

S-parameter data collected from a VNA. This technical report discusses the use, the design, and provides a listing of this 

macro-based software. 

15. SUBJECT TERMS

Amplifier, MEMS 

16. SECURITY CLASSIFICATION OF:

17. LIMITATION 

 OF 

 ABSTRACT 

UU 

18. NUMBER

 OF 

 PAGES 

16 

19a. NAME OF RESPONSIBLE PERSON 

Thomas Farmer 

a. REPORT 

Unclassified 

b. ABSTRACT 

Unclassified 

c. THIS PAGE 

Unclassified 

19b. TELEPHONE NUMBER (Include area code) 

(301) 394-0487 

Standard Form 298 (Rev. 8/98) 

Prescribed by ANSI Std. Z39.18
iii 

Contents 

List of Figures iv

1. Introduction 1

2. User Manual 1

3. Structure of the MS Excel Macro Program 2

4. Conclusions and Future Work 4

Appendix. Source Code Listing of the S-parameter Analysis Software 5

Distribution List 10 
iv 

List of Figures 

Figure 1. The run_all_macros() function. .....................................................................................2
1 

1. Introduction 

When using a network analyzer to analyze a 2-port device, S-parameter data is collected, 

typically in an ASCII file known as an S2P file. Several formats for this file exist. In the context 

of this report, we require the S2P file to be in the touchstone format, which was developed by 

EEsof in 1984. In order to analyze this data, it is necessary to import it into a software program 

to both plot and analyze the data. Typically the data plotted in linear representation as 

magnitude versus frequency or in a Smith chart representation. Typical analysis of S-parameters 

for transistor devices is the determination of fT, fMAX, and gm. These plots and analysis are easily 

performed on some network analyzers and several proprietary or purchased licensed only 

software. 

The purpose of this work was to create a Microsoft (MS) Excel program using the MS Excel 

macro scripting language to both plot and analyze S-parameter data from S2P files generated by 

network analyzers. The advantage of using MS Excel is that it allows engineers universal access 

to the plotting and analysis of S-parameters using any standard image computer equipped with 

MS Excel within the U.S. Army Research Laboratory, and possibly in a Department of Defense 

(DoD)-wide environment, to avoid the installation of proprietary or costly S-parameter analysis 

software. 

2. User Manual 

The following are the steps for using the program: 

1. Open the S-parameter analyzer MS Excel Macro Workbook: 

• Filename: SParameter_Analyzer_v1.xslm 

• At the time of this report was written, this file was located on the common 

RDRL-SER-E server share drive: 

– L:\Sparameter_Analysis_Software\Brianna_Murphys_Sparameter_Plotting_Tool\ 

SParameter_Analyzer_v1.xlsm 

• A complete listing of the source code for this MS Excel Macro Workbook is in 

appendix A, so that the reader may create their own instance of this software in their 

own copy of MS Excel if L:\ drive access is not possible or the location listed above has 

expired. 

2. The user is then prompted to select an .S2P file to be analyzed. 
2 

• Note: If the user chooses a file that is not an .S2P file, the program will not work. 

3. Once the appropriate .S2P file is chosen, the program will process the S2P data 

• The original .S2P data file is not be manipulated or changed in any way. 

4. Once the MS Excel macro has completed, there will be multiple sheets/tabs in a newly 

create MS Excel workbook: 

• The first sheet is a listing of the original .S2P data. 

• The second sheet is named Sparams_dB and includes the data with each column 

labeled. This sheet also has four extra columns that show the numerical data for 

20*log(Magnitude) of the S11, S21, S21, and S22 magnitudes. 

• The third sheet has four S-parameter plots. Each of the two-port S-parameters has the 

logarithmic form of the magnitude plotted against frequency: 

– The plots are on top of one another, so the user must drag them apart to see all four 

S-parameters. 

3. Structure of the MS Excel Macro Program 

The MS Excel macro is split into several functions. The function at the top of the macro 

hierarchy is called run_all_macros() and is listed in figure 1. The functions or sub-routines 

called by this top function define the structure of this macro. 

Sub run_all_macros() 

 import_data_file 

 

 analyze_data_dB 

 

 add_sheet 

 

 plot_S11 

 

 plot_S21 

 

 plot_S12 

 

 plot_S22 

End Sub 

Figure 1. The run_all_macros() function. 
3 

As listed previously, the main macro function calls seven sub-routines to perform the tasks 

specified by their names. The following is a brief list of the functionality encapsulated by each 

sub-routine: 

• import_data_file 

 This sub-routine prompts the user for the .S2P file to import. Once the file is located, it 

creates a new MS Excel spreadsheet, then imports the ASCII-based data into that MS Excel 

spreadsheet 

• analyze_data_dB 

 This sub-routine converts the magnitude of each S-parameter into dB, using the following 

MS Excel formula: 20*LOG10(B3). A new tab is created in the current MS Excel 

spreadsheet and the logarithmic form of the magnitude of each S-parameter is placed in this 

tab 

• add_sheet 

 A new tab is created in the current MS Excel spreadsheet to hold the S-parameter plots.

• plot_S11 

 An MS Excel XY-scatter plot of the logarithmic form of S11 versus the frequencies 

defined by the imported data is created and plotted in the new tab of the MS Excel 

spreadsheet.

• plot_S21 

 An MS Excel XY-scatter plot of the logarithmic form of S21 versus the frequencies 

defined by the imported data is created and plotted in the new tab of the MS Excel 

spreadsheet.

• plot_S12 

 An MS Excel XY-scatter plot of the logarithmic form of S12 versus the frequencies 

defined by the imported data is created and plotted in the new tab of the MS Excel 

spreadsheet.

• plot_S22 

 An MS Excel XY-scatter plot of the logarithmic form of S22 versus the frequencies 

defined by the imported data is created and plotted in the new tab of the MS Excel 

spreadsheet.

A complete listing of each of these functions is given in the appendix. This section serves 

merely as an explanation of the programs hierarchy and flow. 
4 

4. Conclusions and Future Work 

This program will allow all users to easily convert S-parameter data into graphs using MS Excel 

as opposed to using proprietary or costly S-parameter analysis software. Future work includes 

expanding this software into a more robust tool that will allow engineers future insight into the 

devices they are measuring. 

Future improvements to this software include the following: 

1. Auto-separating the four S-parameter plots. 

2. Plotting the Smith chart representations of the imported S-parameter data. 

3. Calculating H21 from the imported S-parameter data to plot fT for a single transistor. 

4. Calculating the U-parameter from the imported S-parameter data to plot fMAX parameter for 

a single transistor. 

5. Calculating the gm from the imported S-parameter data. 
5 

Appendix. Source Code Listing of the S-parameter Analysis Software 

This is the complete source code listing of the S-parameter Analysis Software created in the 

Visual Basic Macro Scripting Language for MS Excel, version 2007. 

This code can be copied and pasted into the macro section of an MS Excel spreadsheet and then 

saved as an .XLSM (macro-enabled workbook) file. 

Afterwards, this .XLSM file can be opened and it will prompt to user for an .S2P file to analyze. 

Sub run_all_macros() 

' 

' This Macro will call all the subsequent macros (consider in like main() in C) 

' 

 

 ' Import Data 

 import_data_file 

 

 ' Analyze Data - Convert to dB 

 analyze_data_dB 

 

 add_sheet 

 

 plot_S11 

 

 plot_S21 

 

 plot_S12 

 

 plot_S22 

 

End Sub 

Sub import_data_file() 

' 

' This macro will import the S2P file and save it as an .XLSX file 

' 

 

 ' Prompt user for filename 

 

 Dim vFile As Variant 

 ' Showing Excel Open Dialog Form 

 vFile = Application.GetOpenFilename("S2P files (*.S2P*)," & _ 

 "*.S2P*", 1, "Select S2P File", "Open", False) 

 

 ' Open S2P file and create new file 

 Workbooks.OpenText Filename:= _ 

 vFile, _ 

 Origin:=437, StartRow:=1, DataType:=xlDelimited, TextQualifier:= _ 

 xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, Semicolon:=False, _ 

 Comma:=False, Space:=True, Other:=False, FieldInfo:=Array(Array(1, 1), _ 

 Array(2, 1), Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 1), Array(7, 1), 

Array(8, 1), _ 

 Array(9, 1), Array(10, 1)), TrailingMinusNumbers:=True 

 

 
6 

 ' Save in .XLSX format 

 ActiveWorkbook.SaveAs vFile + ".xlsx", FileFormat:=51 

 

 Set dataWorkBook = ActiveWorkbook 

 

End Sub 

Sub analyze_data_dB() 

' 

' This macro will copy the imported S2P data into a separate tab, convert it to dB, 

and plot it 

' 

 ' Copy data from one tab to a new tab 

 Sheets.Copy After:=dataWorkBook.ActiveSheet 

 

 ' rename new tab 

 ActiveSheet.Name = "Sparams_dB" 

 

 ' organize columns and rows 

 

 Rows("1:3").Select 

 Selection.Delete Shift:=xlUp 

 Columns("A:A").Select 

 Selection.Delete Shift:=xlToLeft 

 Range("A1").Select 

 ActiveCell.FormulaR1C1 = "Frequency" 

 Range("B1").Select 

 ActiveCell.FormulaR1C1 = "S11 Magnitude" 

 Range("C1").Select 

 ActiveCell.FormulaR1C1 = "S11 Phase" 

 Range("D1").Select 

 ActiveCell.FormulaR1C1 = "S21 Magnitude" 

 Range("E1").Select 

 ActiveCell.FormulaR1C1 = "S21 Phase" 

 Range("F1").Select 

 ActiveCell.FormulaR1C1 = "S12 Magnitude" 

 Range("G1").Select 

 ActiveCell.FormulaR1C1 = "S12 Phase" 

 Range("H1").Select 

 ActiveCell.FormulaR1C1 = "S22 Magnitude" 

 Range("I1").Select 

 ActiveCell.FormulaR1C1 = "S22 Phase" 

 Range("A2").Select 

 

 Columns("C:C").Select 

 Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove 

 Columns("F:F").Select 

 Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove 

 Columns("I:I").Select 

 Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove 

 Columns("L:L").Select 

 Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove 

 Range("C1").Select 

 ActiveCell.FormulaR1C1 = "20log(S11)" 

 Range("C2").Select 

 ActiveCell.FormulaR1C1 = "=IF(ISBLANK(RC[-1])=TRUE,"" "",20*LOG10(RC[-1]))" 

 Range("C2").Select 

 Selection.AutoFill Destination:=Range("C2:C402") 

 Range("C2:C402").Select 

 Range("F1").Select 
7 

 ActiveCell.FormulaR1C1 = "20log(S21)" 

 Range("F2").Select 

 ActiveCell.FormulaR1C1 = "=IF(ISBLANK(RC[-1])=TRUE,"" "",20*LOG10(RC[-1]))" 

 Range("F2").Select 

 Selection.AutoFill Destination:=Range("F2:F402") 

 Range("F2:F402").Select 

 Range("I1").Select 

 ActiveCell.FormulaR1C1 = "20log(S12)" 

 Range("I2").Select 

 ActiveCell.FormulaR1C1 = "=IF(ISBLANK(RC[-1])=TRUE,"" "",20*LOG10(RC[-1]))" 

 Range("I2").Select 

 Selection.AutoFill Destination:=Range("I2:I402") 

 Range("I2:I402").Select 

 Range("L1").Select 

 ActiveCell.FormulaR1C1 = "20log(S22)" 

 Range("L2").Select 

 ActiveCell.FormulaR1C1 = "=IF(ISBLANK(RC[-1])=TRUE,"" "",20*LOG10(RC[-1]))" 

 Range("L2").Select 

 Selection.AutoFill Destination:=Range("L2:L402") 

 Range("L2:L402").Select 

 Range("Q2").Select 

 

End Sub 

Sub add_sheet() 

' 

' This macro will add a new sheet to put the plots on 

 

 Sheets.Add After:=Sheets(Sheets.Count) 

 ActiveSheet.Select 

 ActiveSheet.Name = "Sparam_plots" 

 

 Sheets("Sparams_dB").Select 

 

 End Sub 

 

 Sub plot_S11() 

' 

' plot_S11 Macro 

' Will plot grap of freq vs. 20log(S11) 

' 

' 

 Range("A:A,C:C").Select 

 Range("C1").Activate 

 Charts.Add 

 ActiveChart.ChartType = xlXYScatterSmooth 

 ActiveChart.SetSourceData Source:=Sheets("Sparams_dB").Range( _ 

 "A1:A405,C1:C405"), PlotBy:=xlColumns 

 ActiveChart.Location Where:=xlLocationAsObject, Name:="Sparam_plots" 

 With ActiveChart 

 .HasTitle = True 

 .ChartTitle.Characters.Text = "S11" 

 .Axes(xlCategory, xlPrimary).HasTitle = True 

 .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Frequency" 

 .Axes(xlValue, xlPrimary).HasTitle = True 

 .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "20log(S11)" 

 End With 

End Sub 
8 

Sub plot_S21() 

' 

' plot_S21 Macro 

' Will plot grap of freq vs. 20log(S21) 

' 

 Range("A:A,F:F").Select 

 Range("F1").Activate 

 Charts.Add 

 ActiveChart.ChartType = xlXYScatterSmooth 

 ActiveChart.SetSourceData Source:=Sheets("Sparams_dB").Range( _ 

 "A1:A405,F1:F405"), PlotBy:=xlColumns 

 ActiveChart.Location Where:=xlLocationAsObject, Name:="Sparam_plots" 

 With ActiveChart 

 .HasTitle = True 

 .ChartTitle.Characters.Text = "S21" 

 .Axes(xlCategory, xlPrimary).HasTitle = True 

 .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Frequency" 

 .Axes(xlValue, xlPrimary).HasTitle = True 

 .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "20log(S21)" 

 End With 

End Sub 

Sub plot_S12() 

' 

' plot_S12 Macro 

' Will plot grap of freq vs. 20log(S12) 

' 

' 

 Range("A:A,I:I").Select 

 Range("I1").Activate 

 Charts.Add 

 ActiveChart.ChartType = xlXYScatterSmooth 

 ActiveChart.SetSourceData Source:=Sheets("Sparams_dB").Range( _ 

 "A1:A405,I1:I405"), PlotBy:=xlColumns 

 ActiveChart.Location Where:=xlLocationAsObject, Name:="Sparam_plots" 

 With ActiveChart 

 .HasTitle = True 

 .ChartTitle.Characters.Text = "S12" 

 .Axes(xlCategory, xlPrimary).HasTitle = True 

 .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Frequency" 

 .Axes(xlValue, xlPrimary).HasTitle = True 

 .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "20log(S21)" 

 End With 

End Sub 

 Sub plot_S22() 

' 

' plot_S22 Macro 

' Will plot grap of freq vs. 20log(S22) 

' 

' 

 Range("A:A,L:L").Select 

 Range("L1").Activate 

 Charts.Add 

 ActiveChart.ChartType = xlXYScatterSmooth 

 ActiveChart.SetSourceData Source:=Sheets("Sparams_dB").Range( _ 

 "A1:A405,L1:L405"), PlotBy:=xlColumns 

 ActiveChart.Location Where:=xlLocationAsObject, Name:="Sparam_plots" 

 With ActiveChart 
9 

 .HasTitle = True 

 .ChartTitle.Characters.Text = "S22" 

 .Axes(xlCategory, xlPrimary).HasTitle = True 

 .Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Frequency" 

 .Axes(xlValue, xlPrimary).HasTitle = True 

 .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "20log(S22)" 

 End With 

End Sub 
10 

No. of 

Copies Organization 

 1 ADMNSTR 

 ELEC DEFNS TECHL INFO CTR 

 ATTN DTIC OCP 

 8725 JOHN J KINGMAN RD STE 0944 

 FT BELVOIR VA 22060-6218 

 1 CD OFC OF THE SECY OF DEFNS 

 ATTN ODDRE (R&AT) 

 THE PENTAGON 

 WASHINGTON DC 20301-3080 

 1 US ARMY RSRCH DEV AND ENGRG 

 CMND 

 ARMAMENT RSRCH DEV & ENGRG 

 CTR 

 ARMAMENT ENGRG & TECHNLGY 

 CTR 

 ATTN AMSRD AAR AEF T J MATTS 

 BLDG 305 

 ABERDEEN PROVING GROUND MD 

 21005-5001 

 1 PM TIMS, PROFILER (MMS-P) 

 AN/TMQ-52 

 ATTN B GRIFFIES 

 BUILDING 563 

 FT MONMOUTH NJ 07703 

 1 US ARMY INFO SYS ENGRG CMND 

 ATTN AMSEL IE TD A RIVERA 

 FT HUACHUCA AZ 85613-5300 

 1 COMMANDER 

 US ARMY RDECOM 

 ATTN AMSRD AMR 

 W C MCCORKLE 

 5400 FOWLER RD 

 REDSTONE ARSENAL AL 35898-5000 

 1 US GOVERNMENT PRINT OFF 

 DEPOSITORY RECEIVING SECTION 

 ATTN MAIL STOP IDAD J TATE 

 732 NORTH CAPITOL ST NW 

 WASHINGTON DC 20402 

 1 US ARMY RSRCH LAB 

 ATTN RDRL CIM G T LANDFRIED 

 BLDG 4600 

 ABERDEEN PROVING GROUND MD 

 21005-5066 

No. of 

Copies Organization 

 3 US ARMY RSRCH LAB 

 ATTN IMNE ALC HRR 

 MAIL & RECORDS MGMT 

 ATTN RDRL CIM L TECHL LIB 

 ATTN RDRL CIM P TECHL PUB 

 ADELPHI MD 20783-1197 

 18 US ARMY RSRCH LAB 

 ATTN RDRL SER E 

 ROMEO DEL ROSARIO 

 EDWARD VIVEIROS 

 JOHN PENN 

 KWOK TOM 

 BENJAMIN HUEBSCHMAN 

 ROBERT PROIE 

 TONY IVANOV 

 CAROLINE WAIYAKI 

 KEN MCKNIGHT 

 KHAMSOUK KINGKEO 

 JAMES WILSON 

 ROGER KAUL 

 ALI DARWISH 

 THOMAS FARMER (5 COPIES) 

 ADELPHI MD 20783-1197 

 1 UNIVERSITY OF MARYLAND 

DEPARTMENT OF ELECTRICAL AND 

COMPUTER ENGINEERING 

 STEVE NORTON 

 2425 AV WILLIAMS BUILDING 

 COLLEGE PARK MD 20742 

 1 UNIVERSITY OF MARYLAND 

 1125 CUMBERLAND HALL 

 BETSY MENDELSOHN 

 COLLEGE PARK MD 20742 

 1 UNIVERSITY OF MARYLAND 

DEPARTMENT OF ELECTRICAL AND 

COMPUTER ENGINEERING 

MS. BRIANNA MURPHY C/O STEVE 

NORTON 

 2425 AV WILLIAMS BUILDING 

 COLLEGE PARK MD 20742 

TOTAL: 32 (1 ELEC, 1 CD, 30 HCS)