Code covered by the BSD License  

Highlights from
Agilent Spectrum Analyzer Seminar Examples

image thumbnail
from Agilent Spectrum Analyzer Seminar Examples by Richard Overdorf
Agilent MXA, PSA Seminar Examples

MXA_GetXAxisArray( handle )
function X = MXA_GetXAxisArray( handle )
% MXA_GetXAxisArray Returns an array of the x-axis frequency points.

global g_MXASampleData;

if handle ~= -1
    %*---------------------------------------------------*
    %  Live mode
    %*---------------------------------------------------*
    % Read the center frequency
    center=query(handle,'FREQ:CENT?','%s','%f'); 
    
    % Read the span
    span=query(handle,'FREQ:SPAN?','%s','%f');
    
    % Read the number of points
     points=query(handle,':SWE:POIN?','%s','%d');
    
    
else
    %*---------------------------------------------------*
    %  Debug mode
    %*---------------------------------------------------*
    center = 1.0e9;
    span = 100e6;
    points = size( g_MXASampleData, 1 );
    
end

% Create the array of x-axis values
start = center - (span / 2);
stop = center + (span / 2);
incr = (stop - start) / (points - 1);
X = start:incr:stop;

Contact us at files@mathworks.com