Set-Up, Calibration, and Operation
Modularized Spectrum Analyzer,
Tracking Generator, and VNA
 
Page Started Feb. 26, 2004
Updated July 29, 2008,  Update page to reflect SLIM MSA and Software change to Revision 111.

    This page will describe the operating functions of the MSA system and the various windows used for operator interface.  It will also describe the necessary steps to make an MSA fully operational, including initial set-up and calibration.  This page is relevant for the Original MSA, and the SLIM MSA.  Use your browser's "Refresh" button for the latest updates.  If you came to this page from a Link, return by using your browser's Back button.

To operate the MSA, the user will become familiar with the:
    1.  Code Window , global variables
    2.  Graph and Working Windows , the visual and manual interfaces to the MSA
    3.  Operation , the buttons and boxes to control the MSA
I suggest the user become acquainted with these items before entering the Initial Set-Up Procedures.

Before the MSA is fully operational, an Initial Set-Up must be performed:
Initial Set-Up Procedures for the MSA
    1.  The global variables, in the software, must be changed to match the topology of the MSA
    2.  The cavity filter must be tuned

For the MSA to be accurate, a Calibration must be performed:
Calibration Procedures for the MSA
    3.  Calibrate the Master Oscillator.  Adjusted manually or with software.
    4.  Verify Center Frequency of Resolution Band Pass Filter, each Path
    5.  Calibrate the magnitude gain of the MSA
    6.  Calibrate Phase Detector Module
    7.  Calibrate computer speed

Special Tests Section
    This section will evolve and expand as the MSA project continues.

The Code Window
    This is the window, in which the actual software code is written.  It is written in Liberty Basic and is, as the name implies, Basic.  I'm not a software guru, but this was some pretty easy stuff to write.  I won't get into the total capabilities of Liberty Basic, you can get their software and information at their website. Find it at http://www.libertybasic.com
This is the Code Window you see when opening spectrumanalyzer.bas in Liberty Basic:
operation/codewindow1.gif
   
The beginning lines of code are called the Default Global Variables.  They are at the top of the code, so that the user does not need to go deep into the program to make changes.  These default global variables must be set by the user, to match the hardware topology of his specific MSA.  The calibration tables are at the end of the code.

    To "RUN" the program from the Code Window, the operator will just click on the little blue man, or click on the Run button in the main toolbar. 
Once clicked, the code is compiled, beginning at the first line and continues sequentially to the last line.  Any code that is preceeded by a ( ' )  symbol is a remark and will not be compiled.
   
When the code has finished compiling, the Graph Window and the Working Window will open, and the system will begin sweeping in the Spectrum Analyzer Mode.

Graph Window and Working Window
   This is a screen print of the Graph Window when the Spectrum Analyzer is running.operation/graphwindow1.gifspworkwin0cf20bw.gif   
   This is a screen print of the Working Window when the Spectrum Analyzer is sweeping.

Operation of the Spectrum Analyzer:
   
The following operating explanations are given with the assumption, that the MSA is fully operational and calibrated.
    The far, lower right Button, labeled "Running" indicates that the system is sweeping.  To stop the sweeping, position your Mouse curser over any of the Buttons within the Working Window or anywhere within the Graph Window, and "Left Click" the Mouse.  The "Running" Button will change it's name to "Restart" and the system will enter the "Halted" mode.  Even though there is no obvious activity on the display, the software program is continually running in the background.  It is waiting for the user to exercise an option.  Be aware that this program, like any other, can create conflicts within your computer if any other program is running.
    The operator has several options when the sweep is Halted, but ONLY when the sweep is halted.  Don't enter values into any of the boxes while the program is sweeping.  You won't actually hurt anything, but the program is likely to go goofy and hang up.  If the program ever hangs up and won't respond to a Halt, find the Code Window, which is probably hidden behind the Graph and Working Windows.  Click the upper right (X) box and exit out.  This has happened to me a few times, for no apparent reason.  I have Win ME, and it is prone to burps I can't explain.
    To normally exit the sweeping program, Halt the sweep, then, put the mouse pointer over the X box in the upper right corner of either the Working Window or Graph Window, and left click.  Both, the Working Window and the Graph Window will close (disappear).  The program will completely close, leaving the Code Window open.

Boxes and Buttons in the Working Window
    The blue boxes are status indicators.  They are values of variables that are created in the program code.  Highlighting and changing anything in the blue boxes will have no effect.  They will self-update and change as the program is run.
    The red boxes are where the user will change the operating characteristics of the MSA.  Any changes to the data in the red boxes will take effect after clicking the "Restart" button.
    The data in the green boxes will also change the operating characteristics of the MSA.  Any changes to the green boxes will take effect after clicking the "Restart", "Continue", or "One Step" buttons.
    Clicking the labeled buttons will cause the program to Halt or perform a preset action.

Boxes and Buttons for the Spectrum Analyzer
    When the system is sweeping, clicking on ANY of the following buttons will Halt the sweep.
  Also, clicking any Mouse button when it's pointer is within the Graph Window will Halt the sweep.  The following descriptions are relevant only when the system is Halted.
    When the sweep is Halted, several things happen, other than just Halting.  The sweep will stop on the last step that was commanded.  The step number is displayed in the upper "Step" Box.  The commanded frequency, associated with this step, is displayed in the upper "This Freq" Box.  The power level of the input signal is displayed in the upper "Power (dBm)" Box.
    Left Mouse Button :  If the Mouse pointer (curser) is placed in the Graph Window, near a displayed graphed point, and the Mouse's Left Button is clicked, these 3 boxes will update to the information closest to the Mouse pointer :
  Upper "Step" Box, upper "This Freq" Box, and the upper "Power (dBm)" Box.  If the Cent button is pressed, the frequency that is in the upper "This Freq" box will be inserted into the "Center Frequency" Box.  When Restart is clicked, the Spectrum Analyzer will begin sweeping with this new entered frequency as the Center Frequency.  This action is called "centering".  It is helpful when a particular display point is not in the center of the graph, but the operator would like it there.  Simply Halt the sweep, point the mouse at the frequency of interest and click, then click "Cent", then click "Restart".
    Right Mouse Button :  If the Mouse pointer (curser) is placed in the Graph Window, near a displayed graphed point, and the Mouse's Right Button is clicked, these 3 boxes will update to the information closest to the Mouse pointer :  Lower "Step" Box, lower "This Freq" Box, and the lower "Power (dBm)" Box.  If the Mouse's Left Button has been clicked, the program takes the frequency values in the upper and lower "This Freq" Box and does two things.  One, it makes an automatic calculation of the frequency difference and places that value into the "Sweep Width" box.  Two, it calculates the average frequency and places that value into the "Center Frequency" box.  The operator can then click "Restart" and the system will begin sweeping with the new values.  This is helpful when you want to "expand" a signal of interest.  Example, locate a frequency of interest on the Graph.  While Halted, position the Mouse pointer on the left side of the signal and click the Mouse's left button.  Then, position the Mouse pointer on the right side of the signal and click the Mouse's right button.  Then, click "Restart".  The signal of interest will be near the center of the graph, with a narrower sweep.
    F1 through F4 buttons: these tell the program which Final Xtal Filter Path is used.  Clicking any one of these will change the status in the "Final I.F." box to reflect the center frequency of that filter.  It will also change the status of the "Res. B.W." box to reflect the bandwidth of the selected filter.  It will also send signals to an optional Bank of Switched Filters.  These filters determine the Resolution Bandwidth of the SA and is shown in the "Res. B.W." box.  F1 is the Default path.  When selecting a filter with a different center frequency from the present one, the "Restart" must be clicked for the system to be accurate.
     Restart button: will tell the program to do several things at one time.  Any Working Window variables that were changed, will be loaded into the program, overwriting any preset global variables.  The Graph Window will be totally erased and recreated.  The sweeping action will begin from the start (step number 0) and continue to the last step.  At each step, data is printed to the Graph Window, with a representation determined by the user. (See
Histo Erase button).   When the last step is reached, the sweep will revert to step 0 and continue this process until the sweep is "Halted" by the user.
    Histo Erase button:  This tells the Graph Window which type of trace is desired.  This button has 5 positions.  It will change each time it is clicked.  The program will be updated with the button information when
clicking the "Restart", "Continue", or "One Step" buttons.
    Histo Erase :  The input signal to the MSA is represented by a Histogram.  This is a vertical line from the base of the graph to the magnitude level of the signal.  Each histogram will remain on the graph until the next sweep, where it will be erased and re-written with new data.
    Histo Stick :  Same as Histo Erase, except the histograms will not be erased.  They will be overwritten by subsequent sweeps.  This is useful for accumulated peak readings.
    Trace Off :  No new graphing will be written to the Graph Window.  However, the data is being collected and the Graph Markers will update.
    Norm Erase : The input signal to the MSA is represented by a data point at each step.  The data point is connected to the previous data point by a blue line.  Each trace will remain on the graph until the next sweep, where it will be erased and re-written.  This is the most common display for spectrum analyzers.
    Norm Stick :  Same as Norm Erase, except the traces will not be erased.  They will be overwritten by subsequent sweeps.  This is useful for accumulated peak readings.
    There is a caution when using Histo Stick or Norm Stick.  Any time something is printed into the Graph Window, the position information is held in the computer's RAM (random access memory, allocated to Liberty basic).  When graphed information is erased, it is also removed from the RAM.  But in the "Stick" mode, the information is not erased, thus filling up the RAM.  After some finite number of sweeps, the RAM will fill up and cause the program to crash.  I don't know how many it will take.  I let mine sweep, in both modes, several hundred times without crashing.  You will clear, and reclaim the memory any time the "Restart" button is clicked.
    One Step button: will advance the sweep from the last point where it was Halted, but only by one step.  Each click on this button will step the frequency once and automatically Halt.
    Continue button: will resume the sweep from the last point where it was Halted.  Sweeping will continue until Halted by the user.
    Show Variables (or Close Variables) button:  This will open a window on the right side of the Graph Window.  It will show many of the variables, and their values, that are used in the program.  All data is relevant for the step at which the sweep was Halted or for the step at which the Left Mouse button is clicked.  The sweep can be "Continued" with the Variables Window open and the data will update with each step.
    Spur Test is OFF (or ON) button is a method to verify if a signal on the Graph is a real input signal or a spur that is created by the Spectrum Analyzer.  Pushing this button will change the Phase Detector Frequency of PLL 1 a small amount.  If a questionable signal on the graph changes location or goes away when the sweep is resumed, it means the signal is a spur.  The Spur Test will activate when clicking the "Restart", "Continue", or "One Step" buttons.
    Special Tests button:  Push this button to enter the Special Tests Mode of operation.  This will open a window near the center of the Graph Window.  The button will change it's name to Close Special .  The window contains provisions for testing various portions of the MSA while in the "Halted" mode.
    The red "Center Frequency" box is the actual frequency you want in the center of the Graph.  Enter the frequency, in MHz.  25.0 MHz can be entered as "25", the decimal and zero's are not necessary.  ie., 25.200 MHz would be entered as "25.2" ; 455 KHz, ".455" ; 1 Hz, ".000001".  And, yes, "0" is a valid center frequency.  The Graph, shown on this page is taken at 0 center frequency.  This graphed signal is the LO 1 isolation in the first mixer, through the cavity filter, mixed with the second LO 2, through the Final Xtal Filter and on to the Log Detector.  The shape of the Graph is the actual shape of the Final Xtal Filter.  No doubt, this is a great way to tune a home brew Final Xtal Filter.  The noise amplitude levels on each side of the pedestal is the close-in phase noise created by PLL 1 and PLL 2. 
    The red "Sweep Width" box is the total amount of range you want the sweep to cover.  Enter the range, in MHz, with the same consideration for decimals and zeros as in the Center Freq box.  Here again, "0" is a valid sweep width.  Use "0" when you want the MSA to "sweep" at a fixed center frequency, while monitoring the signal's activity.
    The red "Steps/Sweep" box.  Enter the number of steps to compose a single sweep.  Valid numbers are from 1 to 720.  Keep an even number if you want the real center frequency to be in the center of the Graph.  I suggest using a number that is a submultiple of the Sweep Width.  Or, if you happen to like 400 steps, as I do, select a Sweep Width that is a direct multiple of the "Steps / Sweep" box.  This will assure a "whole" number for each sweep step.  Sweeping begins at step number 0 and ends on the step number entered into the "Steps/Sweep" box.  You can use 720 but the horizontal reference lines will be erased during the sweep.  They will be reinserted when the sweep is halted.
    The red "Place Markers at Steps" boxes.  Enter the step numbers where you want the markers to display information.  Valid numbers are from 0 through the number in the "Steps per Sweep" box.  If you don't want any markers displayed, enter numbers into these boxes that are higher than the number you have in the "Steps per Sweep" box.  The software, as written, will print marker information as: the frequency at the marker, its' reported Bit level, and a "processed" power level.  After using the MSA for a while, the user may want to dispense with the bits information and replace it with something else.  That code is deeper in the program, but, can certainly be changed or deleted.
    The green "Wait" box.  A number entered into this box will create a delay, from the time a step command is given to the time the Log Detector video is read by the A to D comparator.  A certain amount of delay is required to allow the PLLs to lock up after a frequency change.  Time is also required to allow the Final Xtal Filter to settle.  Valid numbers are 0, and any whole number above 0.  The amount of real time for each whole number increment is, approximately, 1 millisecond.  As this value is increased, the sweep is slowed and the measured data becomes more precise.  As a general rule of thumb, if the Video Bandwidth Selection Switch is selecting maximum bandwidth (center position), then enter 0 or 1 for fastest response with minor data error.  For medium video bandwidth , enter 1 to 10.  For minimum bandwidth, enter 10 to 500.  Higher values are fine.
    The red "Top Reference" box.  A number entered into this box (in dBm, ie. 10 or -30, etc.) will determine the Reference power for the top line of the power scale in the Graph Window.  The maximum number entered can not be greater than the maximum input level to the Spectrum Analyzer.  If a higher value is entered, the software will correct it.
    The red "Bottom Ref" box.  A number entered into this box (in dBm) will determine the Reference power for the bottom line of the power scale in the Graph Window.  The number entered can not be greater than the Top Reference level and must be greater than the minimum input level to the Spectrum Analyzer.  This minimum input level is 130 dB below the maximum input level to the Spectrum Analyzer.  There are 10 divisions between the Top and Bottom reference lines and the scale will automatically print the proper level for each division.  The operator can make the difference between the Top and Bottom reference lines as little as 1 dB, and as much as 130 dB.  I like a difference value of 100 dB.
    The blue "MHz/Step" box will display the actual step size (in MHz).  I suggest using whole number multiples of sweep width vs. steps/sweep.  This will prevent displaying a long string of numbers (in engineering notation) in this box.
   The blue "Message" box.  This box displays any error messages that are created within the program.  If an error message is displayed, the system will automatically halt.  The program must be exited and the error corrected before running again (from the Code Window).  Explanations of the errors can be found at the bottom of the code, in the Code Window.  The message window will also display a test bit (when Halted), that can be used for troubleshooting. The test bit default is "0".  I will describe the use of this test bit in another area.

Boxes and Buttons for the Tracking Generator
    The following buttons and actions are available when the Tracking Generator option is added to the Basic MSA.
    Signal Generator (or Tracking Generator) button: controls the tracking generator.  Clicking the button will select either the Signal Generator Mode or the Tracking Generator Mode.  The program will update, with entered values, when the "Restart" is clicked.
    Signal Generator Mode:  The output of Mixer 3 will be a fixed frequency, corresponding to the value that is entered in the "Enter Freq" Box.  Next to the Signal Generator button is the Preset button.  When pushed, the default frequency will be entered into the
"Enter Freq" Box.  It can be changed in the Code Window.  The operator may enter any frequency (in MHz) between -90 and 1200, with 6 places of decimal accuracy.  Yes, negative values are acceptable.  The output of Mixer 3 will be a positive frequency, but a negative value will command the PLO3 to a lower frequency for special testing.  The limits are determined by the range of PLO3.
    When the Tracking Generator Mode is selected, the Preset button name changes to Normal :
    Tracking Generator - Normal:  The
output of Mixer 3 will be a frequency, corresponding to the Offset frequency that is entered in the "Enter Offset" Box.  If the Offset is "0", which is the default, the output frequency will be the same as what the MSA is commanded to.  The output will "Track" the MSA, step for step, throughout it's entire frequency range.  If an offset is entered, for example "-.455", the output will always be 455 KHz below the MSA commanded frequency.  The offset value is limited in two ways.  One, by the range of PLO3, and two, at what frequency the MSA is commanded to.  The offset value should not allow the Tracking Generator to output a frequency below 0 MHz nor above the maximum limit of the MSA, which is nominally, 1050 MHz.
    Tracking Generator - Reverse:  When in the Tracking Generator Mode and the Normal button is clicked, the name changes to Reverse :  In this mode, the Tracking Generator is "reverse" tracking the MSA commanded input frequency.  The MSA will always sweep from a lower frequency to a higher frequency.  Here, the Tracking Generator output is sweeping from a higher frequency to a lower frequency.  The two frequencies will intersect in the middle of the sweep with an offset determined by the value entered into the "Enter Offset" Box.  For example, the MSA is commanded to sweep from 1 MHz to 2 MHz.  If the Offset is "0", the Tracking Generator will sweep from 2 MHz to 1 MHz.  Both the MSA and the Tracking Generator will be set to 1.5 MHz in the center of the sweep.  If the offset is -.455 MHz, the Tracking Generator will be 1.045 MHz in the center.  It sweeps from 1.545 MHz to .545 MHz.  This is quite useful when testing radios with a "reversed" I.F. 
    Take note that when in either the Signal Generator Mode, or Tracking Generator Mode, there will always be a frequency exiting Mixer 3 and there will be other frequencies generated by PLO3 within the MSA/TG.  Sometimes this can effect normal MSA operation.  When in the Spectrum Analyzer Mode, it is advisable to "park" the Signal Generator to a frequency that will not effect spectrum analyzer operations.  I suggest "parking" the Signal Generator to a few hundred MHz above the selected sweep of the Spectrum Analyzer.
    Go-VNA button:  Push this button to enter the VNA Mode of operation.  The button will change it's name to Go-MSA Mode, so that the Spectrum Analyzer Mode can be re-entered from the VNA Mode. 

Boxes and Buttons for the Vector Network Analyzer
    Screen print of the Graph Window while in the VNA Mode, TG output connected to MSA Input.
operation/graphwindow2.gif
operation/workingwindow2.gif
    This is a screen print of the Graph Window while in the VNA Mode.
The following buttons, boxes, and actions are available only while in the Vector Network Analyzer  Mode.
    When entering the VNA Mode,
sweeping will automatically begin, with default values left over from the MSA Mode.  Two signal parameters are displayed in the Graph Window.  Magnitude, in blue, and Phase, in red.  The parameters have not been calibrated, so the responses are "raw" measurements.  The magnitude is an absolute power level of the input signal to the MSA, with it's graph reference on the right side.  The phase is an absolute phase measurement of the Phase Detector Module, with it's reference on the left side of the Graph.  This phase measurement is meaningless until the VNA system is calibrated.  Halting the sweep is accomplished by using the same methods as MSA Mode.
    The Magnitude Graph Scale can be changed the same way as the MSA Mode : the red "Top Ref Line", and "Bot Ref Line" boxes.  The left Phase Scale can be changed with the red "Phase Top" and "Phase Bot" boxes.  The
"Phase Top" scale value can be anywhere between 360 and -359.9, with a resolution of .1 degree.  The "Phase Bot"can be anywhere between 359.9 and -360, but, it's value must be more negative than the "Phase Top".  The difference between the "Phase Top" and "Phase Bot" must not be greater than 360.  The default values are 180 and -180.  Note: The phase data that is printed under the markers or phase data that is printed in the Working Window will use the 180/-180 format, even if the Graph scale uses a different format.
    Calibrate ? button :  Pressing this button will begin the Reference Calibration.  The button will change it's name to "Calibrating".  The VNA will begin sweeping at step 0 and continue to the last step, then Halt.  The "Calibrating" button will change it's name to "Calibrated".  Any future Reference Calibrations are accomplished by pressing the same button, now named, "Calibrated".  While "calibrating", the absolute magnitude and phase measurements, at each step, are placed in the software's calibration arrays.  The magnitude of the signal is converted to 0 dB.  The phase is converted to 0 degrees.  Both Magnitude and Phase are displayed on the graph but at the end of the sweep, they may be overwritten by the black graph scale lines.
    Once a Reference Calibration has taken place, all future signal measurements are referenced to the calibration arrays.  A signal with a magnitude higher than when taken during
Reference Calibration, will be displayed as a positive dB value.  Conversely, a signal with a magnitude lower than when taken during Reference Calibration, will be displayed as a negative dB value.  Exiting the VNA Mode and entering the MSA Mode will erase the Reference Calibration arrays.
    When the VNA sweep is Halted, the blue upper "Phase" box will indicate the phase of the signal at the step where the sweep was Halted.  The lower "Phase" box will indicate the phase of the signal when the Mouse pointer is placed near a displayed signal and the Mouse's right button is clicked.  The two Mouse buttons operate the same as the MSA Mode.
    The red "PDM Inversion" box indicates the absolute phase difference of the Phase Detector Module's Normal and Inverted Modes.  More information for this box will be explained in the Calibration Procedures Section.
    The Mag Erase and Pha Erase buttons, each have three positions:
Mag Erase will display the blue magnitude trace as a line that will be erased and rewritten on each sweep.  Mag Stick will display the magnitude trace as a line that will not be erased. It will be overwritten on each sweep.  Mag Off will not display the magnitude trace, although the data is collected and the Graph Markers will update.
Pha Erase will display the red phase trace as a line that will be erased and rewritten on each sweep.  Pha Stick will display the phase trace as a line that will not be erased. It will be overwritten on each sweep.  Pha Off will not display the phase trace, although the data is collected and the Graph Markers will update.

Initial Set-Up Procedures for the MSA:
Software Set-Up for the Computer
    First you need the software to operate the MSA.  It is in two parts, the Application and the Program.
    The Application is Liberty Basic and can be downloaded at
http://www.libertybasic.com .  Their latest is version 4 and has a free trial period.  Download the Liberty application and run it's set-up routine.  Liberty application will be placed in your Program Files section of your computer. 
    The MSA Program is spectrumanalyzer.bas , version 111 .  I wrote this software using Liberty Basic version 3.01 and runs fine on later versions of Liberty.  Download this program and place it inside the Liberty Basic folder.

Hardware Set-Up for the MSA
The SLIM MSA design has only one mechanical adjustment, tuning of the Cavity Filter.
The Original MSA has modules which need preliminary adjustments before running for the first time:
    For the  original 8 Bit parallel
A/D, adjust both pots to the centers.
    For the original 12 Bit parallel A/D, adjust both pots to the centers.
    For the original 16 Bit serial A/D, adjust both pots to the centers (2.5 volts).
    For the original Master Oscillator, adjust pot for oscillator Vcc = 5.0 volts.

1.  Change the Global Variables in the Code Window.
    Open Liberty Basic.  Open it's file folder, and find and open the code: spectrumanalyzer.bas.  Before changing anything, resave this Code under a different name. Do this by clicking : File/Save As, and enter a name, such as, johnspectrumanalyzer.bas.  Use any name you wish.  This will preserve the integrity of the original
spectrumanalyzer.bas.  The first line will show the date and version.

    Each global variable, in the Code Window, has an explanation as to what it's value should be.  The following are supplemental explanations that should minimize confusion.
    The default global variable values shown, are for the SLIM Modularized Spectrum Analyzer, with these attributes:  Tracking Generator installed.  VNA installed.
Do not change the wording (ie,  masterclock = ), change only the value (ie,   64 ):
masterclock = 64    'enter the exact frequency of the Master Clock (in MHz)

This the absolute frequency of the Master Clock.  If it is adjustable, enter the masterclock's nominal value (64 in this case).   If it is not adjustable, enter the actual frequency that the clock is creating (in MHz).  If you are not sure, enter nominal value of the masterclock, and you can change this value during calibration.  My masterclock is = 63.9995093 (a .3 Hz resolution)

centfreq = 0     'enter the default center frequency, in MHz. For initial set-up use "0"
This value is inserted into the "Center Frequency" box, by default.  This is the center frequency of the sweep, in MHz.
  Yes, you can sweep below 0 MHz.  Using "0" here should cause the MSA to display a response, even if the cavity filter is not adjusted to optimum.
sweepwidth = .04    'enter the default sweep width, in MHz. For initial set-up, use 10 times the bandwidth of your Final Xtal Filter (installed in default path 1).  The value s
hown, is for a .004 MHz BW filter.  This value is inserted into the "Sweep Width" box, by default.
wate = 0            'value to "slow" the sweep speed for more accurate data.  Use "0" as default.
This value is entered into the "Wait" box, by default.  It is used by a program wait statement, to slow the computer down, after the MSA is commanded and before the data take, to allow the circuits to settle.
glitchtime = 0     'default=0. "glitchtime" x value in "Wait" box = 1 msec. In my Toshiba, "80" delays data taking by 1 msec. The program software will automatically determine a nominal value if "0" is entered.  A more accurate value can be determined during the calibration procedure.
steps = 400         'whole number of steps per sweep. 1 thru 720 is acceptable.  400 is a good number.
This value is inserted into the "Steps/Sweep" box, by default.  There is a maximum of 720 horizontal screen pixels allocated for the X axis of the Graph, when using an 800 x 600 pixel monitor.  An "even" number will assure the center frequency is in the center of the Graph.
marker1 = 100       'marker 1 step placement, default.  Use these for initial set-up.
marker2 = 200       'marker 2 step placement, default.
marker3 = 300       'marker 3 step placement, default.
These step values are inserted into the "Place Markers at Steps" boxes, by default.  A marker will be placed on the graph, at these step numbers.  If no markers are wanted, enter the value, 750.  If the value is greater than "steps", no marker will be displayed.
adconv = 16         'AtoD topology. "8" for original 8 bit,"12" for optional 12 bit ladder,"16" for serial 16 bit AtoD, or "22" for serial 12 bit AtoD
topref = 0        'default, top magnitude reference line on scale, in dBm input to MSA. For initial set-up, use "0"
botref = -100       'default, bottom magnitude reference line on scale, in dBm input to MSA. For initial set-up, use "-100"

finalfreq1 = 10.7  'freq of Final Xtal Filter # 1, in MHz.  (Path 1 Resolution Filter)
This is the exact center frequency of Final Xtal Filter # 1. This number is used in the program to establish the exact frequency of the Final IF.  Enter the number in MHz.  If you don't know the exact center frequency, enter the nominal value.  The correct value will be determined during calibration. For the first SLIM MSA, I built a final xtal filter that was nominally 10.695 MHz.  It's exact center was actually 10.694785 MHz.  This is the correct value to be entered.
finalbw1 = 4.0      'this is the bandwidth (in KHz) of Final Xtal Filter # 1. (Path 1 Resolution Filter)
Note, everything else has been entered in MHz.  Enter this number in KHz

    Change global variables for the next 3 filter paths.  If you have only one filter, duplicate the values from path 1 for the next 3 sets of variables.
finalfreq2 = 10.7     'freq of Final Xtal Filter # 2
finalbw2 = 10          'BW (in KHz)of Final Xtal Filter # 2. This represents a 10 KHz bandwidth.

finalfreq3 = 10.7      'freq of Final Xtal Filter # 3
finalbw3 = 30          'BW (in KHz)of Final Xtal Filter # 3
. This represents a 30 KHz bandwidth.
finalfreq4 = 10.7      'freq of Final Xtal Filter # 4
finalbw4 = 200        'BW (in KHz)of Final Xtal Filter # 4
. This represents a 200 KHz bandwidth.
    I should inject a note of caution when using multiple final filters.  Each of the multiple filters must have a center frequency and operating bandwidth that is within the range of the MSA's Cavity Filter bandwidth.  The
Cavity Filter bandwidth is nominally 1.8 MHz.  Therefore, the minimum to maximum bandpass of the final filters must be 1.8 MHz or less.
cb = 2              '0= old Control Board, 1= old Control Board with new harness, 2 = SLIM Control Board
This is the type of Control Board used.  The Original MSA uses an old Control Board that has an integrated A to D converter.  As an option, t
he Original MSA can use a revised version of the Control Board that uses an external A to D converter.  If either of these Control Boards are used, enter "0".  However, if you are using either of these original Control Boards and have modified the wiring harness for the SLIM upgrade, enter "1".  For the SLIM MSA, enter "2".
dds1parser = 1      '0 if DDS 1 is commanded in parallel mode, 1 if serial commanding. "0" not allowed on SLIM Control Board.  If you are using the Original MSA with an Original parallel command DDS 1, enter "0".
  If you are using the Original MSA, with an Original parallel command DDS 1 that has been modifed for serial commanding, and have modified the wiring harness for the SLIM upgrade enter "1".    For the SLIM MSA, enter "1".
appxdds1 = 10.7      'this is the nominal DDS1 output frequency (in MHz) that steers PLL 1, must be the center freq. of DDS1 xtal filter.  This value is not critical, but should be close, to within .001 MHz.  My SLIM-DDS-107 has a centered bandwidth at 10.695 MHz, even though I used the specified 10.7 MHz crystal filter.  The exact center frequency can be determined in the section called "Special Tests".
dds1filbw = .015     'this is the DDS1 xtal filter bandwidth (in MHz, at the 3 dB points).  It is not critical, use the manufacturer's specification to within .001 MHz.
PLL1 = 2326         '
enter PLL #, (LMX) 2325, 2326, 2350, 2353, (ADF) 4112
PLL1phasefreq = .974   'approximate Phase Detector Frequency (MHz) for PLL 1.
If appxdds1 = 10.7 and
if dds1filbw is greater than .010 (MHz), enter .974 (this is the case for the SLIM MSA).  For other topologies, this number can get rather involved.  There are several factors that determine the value to be used,  but, in all cases, the absolute maximum value can be determined using the following formula: PLL1phasefreq = (VCO 1 minimum frequency) x dds1filbw/appxdds1
PLL1mode = 0        '0 = Integer Mode, 1 = Fractional Mode for PLL 1.  Enter "0" for SLIM MSA.  Use Fractional Mode only when using Fractional N type PLL's. (LMX 2350, 2353).  Even if using Fractional N PLL's, I recommend using the Integer Mode for the MSA.  It is less noisey.
PLL1phasepolarity = 0  'for non-inverting loop filter, enter 1; for inverting op amp, enter 0 (SLIM MSA)
PLL2 = 2326         'enter PLL #: 2325, 2326, 2350, 2353, 4112, or 0 for SRD multiplier
appxLO2 = 1024      '2nd LO frequency (MHz). 1024 is nominal for the MSA. Must be a whole number multiple of "PLL2phasefreq". 
If PLL 2 is replaced with a multiplier scheme (PLL2 = 0), it needs to be a whole number multiple of the Master Oscillator nominal value.
PLL2phasefreq = 4   'PLL2 phase frequency (MHz).  This must be a numerical sub-multiple of "appxLO2". 4 is nominal for the MSA.
PLL2phasepolarity = 1  'for non-inverting loop filter, enter 1
(SLIM MSA); for inverting op amp, enter 0
TGtop = 2           'Tracking Generator Topology: "0" for not installed, "1" for original Trk Gen, "2" for New TG (DDS3/PLL3 combination).  Use "2" for SLIM MSA.
PLL3 = 2326         'enter PLL #: 2325, 2326, 2350, 2353, 4112. Enter "0" (zero) for no Tracking Generator.  Only the 2350 and 2353 can be used as fractional-N.
appxdds3 = 10.7     'Nominal DDS3 output frequency (in MHz) that steers PLL 3 (center freq of DDS 3 filter).  Enter "0" if TGtop = 0 or 1.  The original Trk Gen does not use a DDS3.  This value is not critical, but should be close, to within .001 MHz.  My SLIM-DDS-107 has a centered bandwidth at 10.695 MHz, even though I used the specified 10.7 MHz crystal filter.  The exact center frequency can be determined in the section called "Special Tests".

  If no Tracking Generator is installed, do not change the following 8 global variables.
dds3filbw = .015    'this is the DDS3 xtal filter bandwidth (3 dB points), in MHz. It is not critical, use the manufacturer's specification to within .001 MHz.
PLL3phasepolarity = 0  'enter 1 for non-inverting loop filter; for inverting op amp, enter 0(SLIM MSA)
PLL3mode = 0        '0 = Integer Mode, 1 = Fractional Mode for PLL 3. Enter "1" only if PLL3 = 2350 or 2353.  Enter "0" for new DDS3/PLL3 combination (SLIM MSA).
PLL3phasefreq = .974    'PLL3 phase frequency (MHz). If Tracking Generator is DDS3/PLL3 combo, use same technique as PLL1phasefreq (SLIM MSA = .974). If using the Original TG (TGtop=1) then this must be a sub-multiple of both Master Clock and Final Xtal Filter Frequency.

sgpreset = 10         '(in MHz) Default Output freq of Tracking Generator when in Signal Generator Mode
offset = 0          'Enter "0" (Mhz). Default Tracking Generator frequency output, relative to MSA input.
maxpdmout = 65535    'bit count for Phase AtoD converter when Phase Det Module output is maximum.
  For SLIM-ADC-16 = 65535, SLIM-ADC-12 = 4095.  For the Original Control Board and: 12 Bit Parallel AtoD = 4095, 16 Bit Serial AtoD = 65535, and
8 Bit Parallel AtoD = 255
invdeg = 169.89        'actual phase change when PDM is inverted. Nominally, 180.  Enter actual value after calibration.  This default value will dispay an obvious PDM inversion.
'The calibration tables are at the end of the code.  Their default values may need changing.

Calibration Tables (at end of code)
    The default values, preinstalled in the table, [CalTablePath1], are values for a typical SLIM MSA, with SLIM-ADC-16, A to D Converter.  If this duplicates your system, these values do not need to be changed.
    If your system has a different topology than the SLIM MSA, change
[CalTablePath1].  Use the following default values that are shown in [CalTablePath2].  You can start with these values during the Set-Up, before actual calibration.  Use the values in the column that matches your MSA's topology.
Input Power            SLIM-ADC-16    SLIM-ADC-12   8 Bit Par    12 Bit Par    Orig 16 Bit Ser
calpwr0 =  15        calbits0 = 31771          = 3540            = 244         = 3930         = 62913

calpwr1 =  -100     calbits1 = 3932            = 439              = 31          = 491           = 7864
calpwr2 =  -174     calbits2 = 0                 = 0                  = 0            = 0               = 0
The remaining calpwr3(thru20) and calbits3(thru20) globals have an initial value of "0".

    For tables, [CalTablePath2], [CalTablePath3], and [CalTablePath4], duplicate the values in [CalTablePath1].

    The remaining global variables, for the Initial Set-Up, are the values in the last table, [CalTableFreqError].  The values of the global variables, "pwreratf0" through "pwreratf24" should be set to "0".
    After the user has established the Global Variable values, for his specific Analyzer, the Code Window should be saved, ie.  File/Save.  From this point on, the MSA should Run, and command normally.  However, it will not have correct magnitude sweep plots until the Cavity Filter is tuned, and Calibration is performed.

2.  Cavity Filter Tuning
    Once the Coaxial Cavity Filter is constructed and integrated into the MSA, it will require tuning.  If it has been pre-adjusted with the mechanical information given in the construction procedures, it will be fairly close.  For correct adjustment, perform the following steps.
    1.  Install a 50 ohm load on the input to the MSA
    2.  Run Program from Code Window.  Select maximum Magnitude Video Bandwidth.
    3. 
Halt sweep.  Click F1 button
    4.  Change, or verify,
"0" in the Center Frequency Box.
    5.  In the Sweep Width Box, enter 10 times the bandwidth of the Final Crystal Filter (in MHz).
    6.  Click "Restart".  The Graph Window should show a response curve, even if the cavity filter is badly mistuned.  It is possible that the response is below the Bottom Reference Line.  If so, Halt sweep and change "Bot Ref Line" box to -120.  Click "Restart".
    7.  Verify the center of the response curve is in the center of the Graph.  If not, Halt the sweep.  There are two things that will prevent the response curve from not being centered.  The Master Oscillator is not calibrated, and/or, the global variable, finalfreq1, (center frequency of the Final Crystal Filter) is incorrect.  Either error is not important for this tuning procedure.  Place Mouse pointer over the center of the response curve and Left click the mouse.  Click "Cent" button.  Click "Restart".
    8.  Adjust the tuning of the Cavity Filter for maximum amplitude response (maximum bit count).  The response should look similar to the Graph Window near the top of this page.
      9.
  Halt sweeping.  For more critical tuning, perform the following extra steps:
    10.  Change Sweep Width to "0".  Enter 300 into "Wait" box. 
Click "Restart".
    11.  Halt sweep.  Click "Show Variables" button. The "Variables" Window will open.
    12.  Click "Continue".  The sweep will be very slow and the variable, Magdata = xxxxx will update and display the Bit Count value of the MSA output.  Tune the Cavity Filter for maximum Bit Count.
    13.  Halt sweep.  Exit the Working Window.  The windows will close.  Tuning is completed.

Calibration Procedures for the MSA:
3.  Master Oscillator Calibration

    If your system is the Basic MSA, ie, no Tracking Generator, use Method A.  If your MSA has the Tracking Generator addition, with or without VNA extension, use Method A or Method B.
Method A.  For the Basic MSA (no Tracking Generator). Beat Frequency Method.
    This method requires an external AM radio receiver (and appropriate antenna) that will recieve WWV at 2.5 MHz, 5 MHz, 10 MHz, or 20 MHz.  This is for North America.  For Europe or other countries, you can use a Frequency Standard radio station, operating below 32 MHz.
  The DDS 1 spare signal is used as a "beat" frequency oscillator.
    1. 
Tune the external receiver to WWV, 10 MHz.  Use an antenna, if necessary.  I will use 10 MHz during this procedure, but others may be used.
    2.  From the code window, RUN the program. Halt the sweep.
    3.
  Connect a length of hook-up wire to the DDS 1 spare output, and position the wire close to the radio reciever or antenna input.  If the MSA's DDS 1 spare output is brought out to the front panel, the center conductor of the hook-up wire should fit snuggly in the center pin of the connector.  If the DDS 1 spare output is not brought out, it is available on the bottom of the SLIM-DDS-107 and is J3.  Use a hook-up wire size so that it's center conductor will fit snuggly in the pwb hole.
    4.  (allow the MSA to warm up for 30 minutes).  In the Working Window, Click "Special Tests".  In the Special Tests Window, enter the frequency of WWV into "Command DDS 1" red box (10).  The "with DDS Clock at" red box will display the value of the default global variable, "masterclock" (64.xxxyyyz).  Click the "Command DDS 1" button.  DDS 1 will immediately command to approximately "10" MHz.  The program software used the value in the "with DDS Clock at" box as "masterclock" for it's calculation.
     5.  Couple the DDS 1 spare output wire close to the receiver to obtain an audio beat signal.  If the DDS 1 and WWV frequencies are more than a few hundred Hz apart, this "beat" may sound like a tone.
  For best results, the WWV input power to the radio reciever and the DDS 1 signal input power to the radio reciever should be equal.  Move the DDS 1 signal wire to a location near the radio to obtain best results.
    6.  Adjust the Master Oscillator for zero beat, use a. or b.
        a. 
If you have a mechanical adjustment for the master oscillator, the nominal Master Oscillator frequency value should be in the "with DDS Clock at" red box.  If not, Halt the sweep and enter it, then click the "Command DDS 1" button.  Manually adjust the Master Oscillator for zero beat.  A final zero beat is less than 1 noticeable cycle per second. When found, you are finished. Skip b.
        b.  If you don't have a
mechanical adjustment for the master oscillator, zero beat is found by changing the value in the "with DDS Clock at" red box and clicking the "Command DDS 1" buttonThe goal is to find the lowest frequency zero beat.  If the beat frequency increases when changing values, you are changing in the wrong direction.  When the final value in the "with DDS Clock at" box is determined, you are finished.
    7.  Exit the Special Tests Window.  Exit the Working Window.  In the code window, change the global variable, "masterclock" to the final value that was entered in the "with DDS Clock at" box Save the Code.
    If a zero beat to within 1 cycle per second can be obtained, the Master Oscillator is calibrated to within 1 part in 10 million, (using WWV, 10 MHz).  If WWV, 5 MHz is used, the calibration is within 1 part in 5 million, etc.  This is a one-tme calibration.

  Method B.  For the MSA with Tracking Generator or VNA. Beat Frequency Method.  This method requires that the cavity filter be adjusted first.  No external receiver is required.
    This method uses the MSA as a radio reciever for WWV at 2.5 MHz, 5 MHz, 10 MHz, or 20 MHz.  This is for North America.  For Europe or other countries, you can use a Frequency Standard radio station, operating below 32 MHz.
  DDS 3 is used as the "beat" frequency oscillator.
    1.  Connect an antenna or long wire into the input of the MSA.  This injects WWV into the MSA.
    2.  From the code window, RUN the program. Halt the sweep.
    3.  Enter "-20" into the "Top Ref Line" box.  Enter "-120" into the Bot Ref Line" box.
    4.
  Command the MSA Center Frequency to WWV, 10 MHz.  I will use 10 MHz during this procedure, but others may be used.
    5.
  Click "Restart".  Verify signal response is in the center of the Graph.  If not, Halt and center the signal.  Click Restart.  Allow the MSA to warm up for at least 30 minutes.  The Master Oscillator should stabilize in this time period.
    6.  Verify the input signal level has at least 10 dB of signal to noise ratio.  Note this input power level, as WWV power. Example, -90 dBm.
    7.  Halt the sweep.  Enter "0" into the "Sweep Width" box.  Enter "-70" into the "Top Ref Line" box.  Enter "-110" into the Bot Ref Line" box. (use +20 dB and -20 dB above and below the WWV power.
    8.
  Click "Restart".  A uniform, horizontal, magnitude trace will be displayed, along with some noise ripple.  Some magnitude change may occur if the WWV signal is fading.  Halt the sweep.
    9.  In the Working Window, Click "Special Tests".  In the Special Tests Window, enter the frequency of WWV into "Command DDS 3" red box (10).  The "with DDS Clock at" red box will display the value of the default global variable, "masterclock"(64.xxxyyyz).  Click the "Command DDS 3" button.  DDS 3 will immediately command to approximately "10" MHz.
    10.  Combine both the DDS 3 spare output signal, and the antenna input, using a "T" connection on the input to the MSA.  For best results, the WWV input power to the MSA and the DDS 3 signal input power to the MSA should be equal.
        a.  If the MSA's DDS 3 spare output is brought out to a front panel coaxial connector, it's power level is very high, about -8 dBm.  Add an appropriate attenuator so that the DDS 3 power into the MSA is approximately equal to the level of the WWV signal.
        b.  If the DDS 3 spare output is not connectorized, it is available on the bottom of the SLIM-DDS-107 and is J3.  Use a hook-up wire with a center conductor that will
fit snuggly in the pwb hole.  The end of the wire can be loosely coupled to the WWV antenna input to the MSA, so that it's power level is somewhat equal to the WWV power level.
    11. 
Click "Continue".  The previous uniform magnitude trace will look like waves on water.  These waves are a result of the beat frequency between WWV and DDS 3.  There could be many "waves" per sweep, meaning the Master Oscillator is far off frequency.  You can "grab" and move the Special Tests Window out of the way to see the Graph display.
    12.  Adjust the Master Oscillator for zero beat, use a. or b.
        a.
  If you have a mechanical adjustment for the master oscillator, the nominal Master Oscillator frequency value should be in the "with DDS Clock at" red box.  Example, "64".  If not, Halt the sweep by clicking the "Running" button.  Enter the correct Master Oscillator value, then click the "Command DDS 3" button, then click "Continue".  Manually adjust the Master Oscillator for zero beat.  Zero beat occurs when the "waves" occur very slowly (less than one per second).  The sweep can be slowed for better display of the very slow waves.   Halt the sweep, enter "20" into the "Wait" box, "Continue".   When this adjustment is found, you are finished. Halt the sweep and skip the next step b.
    I have mechanical adjustment in my Original MSA.  It is very easy to adjust to 1 wave (1 beat) every 5 seconds.
        b.  If you don't have a
mechanical adjustment for the master oscillator, zero beat is found by changing the value in the "with DDS Clock at" red boxThe goal is to find the lowest frequency zero beat.  If the beat frequency increases when changing values, you are changing in the wrong direction.  The procedure is: Halt the sweep, change the value in the "with DDS Clock at" red box, then click the "Command DDS 3" button, then click "Continue".  Repeat, until the value of "with DDS Clock at" red box creates the slowest waves (less than one per second).  Halt the sweep.  You are finished.
    In the SLIM MSA, I was able to command the value of the Master Oscillator until I got 1 wave (1 beat) every 3 seconds.
    13.  Exit the Special Tests Window.  Exit the Working Window.  In the code window, change the global variable, "masterclock" to the final value that was entered in the "with DDS Clock at" red box Save the Code.
    If a zero beat to within 1 cycle per second can be obtained, the Master Oscillator is calibrated to within 1 part in 10 million (using WWV, 10 MHz).  If WWV, 5 MHz is used, the calibration is within 1 part in 5 million, etc.  This is a one-tme calibration.

4.  Verify Center Frequency of Resolution Band Pass Filter
    The center frequency of the
Resolution Band Pass Filter (Final Crystal Filter) may not be exactly as the manufacturer states.  For wide band filters of 20 KHz or greater, this is not much of a concern.  But for narrow filters, this error will be indicated when the swept response in not in the center of the graph, when it should be.  To determine the real center frequency of the Final Xtal Filter, follow these steps.
    1.  The Master Oscillator must have been calibrated and the code updated for it.
    2.
  Run Program from Code Window.
    3. 
Select maximum Magnitude Video Bandwidth.
    4.  Halt sweep.  Click F1 button
    5.  Change the MSA Center Frequency to "0"
    6.  In Sweep Width box, enter 5 times the bandwidth of the Resolution Filter in Path 1 (Final XtalFilter)
    7.  Enter "20" into the "Wait" box
    8.  Click "Restart".
    9.  The trace on the Graph is the actual frequency response curve of the Resolution Filter.  A perfectly tuned Resolution Filter will have low ripple within the 3 dB bandwidth.
    10.
  Verify the response is centered. Centered, means that the 3 dB points are equally distanced from the center of the Graph, and the maximum power indication is in the center of the Graph.
    11.  If centered, verification is complete. Repeat steps 4 through 10 for each Path (F2, F3, F4).
    12.  If the response is not centered, Halt the sweep. Position Mouse pointer over the center of the response curve.  Left click the Mouse.  The value in the "This Freq" box will indicate the MSA tuning frequency.  A negative value is allowed.  We will call this value, the "Error".
    13.  To determine the true center frequency of the Resolution Filter:
        a.  true center frequency = value in "Final I.F." box - Error
        b. 
example, if the Error was at 0.0011 then true center frequency = 10.7 - 0.0011 =  10.6989
        c.
  or, if the Error was at -0.0015 then true center frequency = 10.7 - (-0.0015) =  10.7015
        d.  this "true center frequency" will be entered into the Global Variable, "finalfreq1"
        e.  or, for subsequent Paths, "finalfreq2", "finalfreq3", and "finalfreq4"
    14.  Change the Global Variables in the Code Window
       a.  In the Code Window, find the globals,
"finalfreq1", "finalfreq2", "finalfreq3", and "finalfreq4"
       b.  Change the appropriate global, if necessary
       c.  Verify sweeping is Halted
       d.  Exit out of Working Window.  This closes the Graph Window, also.
       e.  In the Code Window toolbar, under "File", click "Save"
       f.  Verification of Resolution Band Pass Filter center frequency is complete for each Path.


5.  Spectrum Analyzer Magnitude Calibration

    The MSA can be constructed with a variety of topologies, and I cannot cover them all in a single calibration procedure.  However, the following is common to all topologies:
*  At some input power level to the MSA, the system will saturate.  This simply means that any further increase of input power will not result in an increase in the Log Detector output.  This is the upper limit of the instantaneous dynamic range of the MSA.
*  With only a 50 ohm load on the input to the MSA (no signal), the Log Detector will have a minimum output.  The level of an input signal to cause this minimum Log Detector output to increase, corresponds to the lower limit of the instantaneous dynamic range of the MSA.
*  Input signals within the dynamic range of the MSA, will cause the Log Detector to output a voltage that has a "relationship" to the input power to the MSA.
*  The purpose of magnitude calibration is to determine, exactly, what this input to output " relationship" is.  This is basically, the "gain" of the MSA.
*  MSA gain is not consistant over all input signal conditions.  The gain changes versus frequency input, about 2 dB over the frequency range of 0 to 1000 MHz.  The gain changes versus the level of input power, especially when the input power is within 10 dB of the upper and lower limits of the dynamic range.  The gain changes when different Final Xtal Filters are changed.  Calibration will determine these three gain relationships.
    There are two basic magnitude calibrations for the MSA.  The Path Calibration and the Frequency Error Calibration.
Path Calibration:
    For any Path Calibration, a signal with a known power level is injected into the MSA and the output is recorded. The input power is then changed to another known power level and the output recorded again.  This process is repeated for multiple input power levels.  The final accuracy of the MSA depends on the accuracy of the known input signal level and the number of calibration points taken.  The first calibration point is at a power level that is somewhat higher than the MSA's dynamic range.  Each subsequent calibration point's power level is less than the previous.  The level of the final calibration point will be below
the lower limit of the dynamic range of the MSA.  The MSA has up to four Paths, one for each Resolution Bandwidth Filter.  A Path Calibration is taken for each path, 1 through 4.
Frequency Error Calibration:
    Since the MSA has an operating range of 0 to 1000 MHz, the gain is not expected to be "flat" across the entire range.  Therefore, the gain error versus frequency is calculated.  This is accomplished by injecting a known power level at a known frequency into the MSA.  The displayed MSA power level is subtracted from the known power level, resulting in a "gain error vs. freq".
    The software originates with 5 calibration tables that are "preset" with default values.  4 Tables are for Path Calibration and 1 Table is for Frequency Error Calibration.  During calibration, these default values will be replaced with "actual" values.  The default values are the ones resulting from testing and calibration of the first complete SLIM MSA.  Other MSA topologies using these defaults should operate but will not be accurate.

Step by Step Instructions for Path Calibrations:
        Note:  Do not skip step 29.
    Path 1 Calibration
    1.  Initial set-up and verification for Path 1:
        a. 
Inject a CW signal into the input of the MSA, any frequency between .5 MHz and 1000 MHz
        b.  Signal Power level anywhere between -20 dBm and -90 dBm
        c.  Run Program from Code Window.  Select maximum Magnitude Video Bandwidth.
        d. 
Halt sweep.  Click F1 button
        e.  Change the MSA Center Frequency to the signal input frequency
        f.  In Sweep Width box, enter 10 times the bandwidth of the Resolution Filter in Path 1 (Final XtalFilter)
        g.  Click "Restart".
        h.
  Verify the response is centered (If not, the Center Frequency must be changed).
    2.  Halt the sweep
        a.  Change the Sweep Width to "0" (zero)
        b. 
Select minimum Magnitude Video Bandwidth
        c.  In the "Top Ref Line" box, enter "20".  In the "Bot Ref Line" box, enter "-120".
        d.  Restart sweep.
    3.  Change input power to a Known Power level between +5 dBm and +15 dBm, ie, +13.53 dBm. 
    4.  There will be a display similar to the one below.  If the MSA has not been previously calibrated, the power level values in dBm are meaningless.  The Graph will display the uncorrected Bit count below each Marker.  If the MSA is using a SLIM-ADC-12 or SLIM-ADC-16, the bit count will be less than 4095 or 65535, respectively.  If one of the Original MSA AtoD converters are used, the bit count may be adjustable.  If so, adjust that AtoD module's potentiometer until the bit count is a few bits less than maximum.
  Record this calibration point's results as:  calpwr0 = known input power level; calbits0 = Bit results.

operation/graphwindow3.gif
In the case of this screen print, the SLIM MSA has previously been calibrated, so the input power matches the power displayed on the graph.  ie,
calpwr0 = 13.53 : calbits0 = 31772 (Bit results).
    5.  Decrease the amplitude of the input signal by approximately 5 dB, ie, 4.93 dBm.  Record this calibration point's results as:  calpwr1 = known input power level; calbits1 = Bit results.
    6.  Repeat the process of decreasing the input signal power and recording data until a decreasing input signal no longer decreases the Bit count.  This is the lower limit of the dynamic range of the MSA.
The difference in calibration points of 5 dB is not mandatory.  Any value can be used, but smaller differences will result in more accurate calibration of the MSA.  I suggest 3 dB to 5 dB steps when in the highest and lowest areas of the dynamic range, and 10 dB steps in the most linear area of the dynamic range.
  Verify that each step's data values are less than the previous step's values.  If not, there is a problem.
    7.  Halt the sweep.  In the Code Window, find the subroutine called [CalTablePath1].  It is near the bottom of the code.  Using the recorded results of the calibration, change the values of the variables, calpwr0 through calpwr20 and calbits0 through calbits20.  The full calibration table may not be used.  The last calibration point, taken in the last step, is the lowest input power detectable.  After this value is entered into the table, enter into the next row, calpwr_ = -174 : calbits_ = 0.  The remaining data points in the table need not be changed.
  
Path 2 Calibration
    8.  If only one final crystal filter is used in the MSA, only Path 1 calibration is necessary.  If so, find [CalTablePath2],[CalTablePath3], and[CalTablePath4].  Fill these tables with the same calibration values that were used in [CalTablePath1].  If multiple Paths are used, continue to the next step.
    9.
  Initial set-up and verification for Path 2:
        a.  Inject the same
CW signal into the input of the MSA as used in Path 1 calibration
        b.  Signal Power level anywhere between -20 dBm and -90 dBm
        c.  Run Program from Code Window.  Select maximum Magnitude Video Bandwidth.
        d. 
Halt sweep.  Click F2 button
        e.  MSA Center Frequency does not need changing
        f.  In Sweep Width box, enter 10 times the bandwidth of the Resolution Filter in Path 2 (Final XtalFilter)
        g.  Click "Restart".
        h.
  Verify the response is centered (If not, the center frequency of the Resolution Filter is not correct).
    10.
  Halt the sweep
        a.  Change the Sweep Width to "0" (zero)
        b. 
Select minimum Magnitude Video Bandwidth
        c.  Restart sweep.
    11.  Change input power to a Known Power level between +5 dBm and +15 dBm, ie, +13.53 dBm.   The Graph will display the uncorrected Bit count below each Marker.  Record this calibration point's results as:  calpwr0 = known input power level; calbits0 = Bit results.
 &