Hi,

I’m trying to capture trace data from a N9020A MXA spectrum analyzer using Matlab. With a FFT sweep, 10 MHz FFT width, 10 MHz span and appropriate RBW for the application I get a sweep time of 2 ms. Using Matlab on a decent workstation and a LAN connection, I’m able to capture a trace every 20 ms, pretty much regardless of the number of sweep points used. GPIB is faster for a limited number of trace points but slows down with increased number of sweep points.

Does anyone have any idea for improvement of the time to capture a trace? See Matlab code used below (based on Agilent example program). The code is based on direct I/O, which I understand is the fastest method.

The intention is to gather as much data as possible in both time and frequency domain and in a way that is as close to continuous in time as possible.

…

%mxa=visa(‘agilent’, ‘GPIB0::18::INSTR’);

mxa=tcpip(mxa_ip, 5025);

set(mxa,'InputBufferSize',100000);

set(mxa,'Timeout',5);

fopen(mxa);

fprintf(mxa,':FORM:DATA REAL,32');

…

fprintf(mxa,':INIT:CONT ON');

data=zeros(100,numberOfSweepPoints)

for i=1:100

fprintf(mxa,':TRAC? TRACE1');

data = binblockread(mxa,'float32');

fscanf(mxa); %removes the terminator character

data(i,:)=data;

end

…

I’m trying to capture trace data from a N9020A MXA spectrum analyzer using Matlab. With a FFT sweep, 10 MHz FFT width, 10 MHz span and appropriate RBW for the application I get a sweep time of 2 ms. Using Matlab on a decent workstation and a LAN connection, I’m able to capture a trace every 20 ms, pretty much regardless of the number of sweep points used. GPIB is faster for a limited number of trace points but slows down with increased number of sweep points.

Does anyone have any idea for improvement of the time to capture a trace? See Matlab code used below (based on Agilent example program). The code is based on direct I/O, which I understand is the fastest method.

The intention is to gather as much data as possible in both time and frequency domain and in a way that is as close to continuous in time as possible.

…

%mxa=visa(‘agilent’, ‘GPIB0::18::INSTR’);

mxa=tcpip(mxa_ip, 5025);

set(mxa,'InputBufferSize',100000);

set(mxa,'Timeout',5);

fopen(mxa);

fprintf(mxa,':FORM:DATA REAL,32');

…

fprintf(mxa,':INIT:CONT ON');

data=zeros(100,numberOfSweepPoints)

for i=1:100

fprintf(mxa,':TRAC? TRACE1');

data = binblockread(mxa,'float32');

fscanf(mxa); %removes the terminator character

data(i,:)=data;

end

…

If so, you may want to change your RBW and VBW settings to see if the instrument can make the acquisition faster, based on your specified settings.