AnsweredAssumed Answered

How to reduce the amount of IQ data?

Question asked by jjr on Mar 22, 2009
Latest reply on May 4, 2010 by tabbott
http://www.agilent.com/find/sa_programming

I want to capture a FM signal with N8201A (Options B7J & H02) in basic mode,demodulate it,and play it out the PC speaker.but the Tune and listen program spend much time on reading the IQ data. And the voice was not continuous.So I want to change this program,only want to let the voice continuous.

Q1: How to reduce the amount of IQ data? How to save time to get the data back?

If I use the following commands:

% Get IQ data,do not change.
fprintf(mxa,':WAVeform:SWEep:TIME 100.000e-2');
fprintf(mxa,':WAV:SRAT 12.5E+4');
sample_period = str2double(query(mxa,':WAVeform:APERture?'));

%Decimation,just for reducing the amount of IQ data.
fprintf(mxa,':WAVeform:DECimate:STATe ON');
fprintf(mxa,':WAVeform:DECimate 4');

% Get the data back
fprintf(mxa,':READ:WAV0?');
tic
data=binblockread(mxa,'float');
t=toc;


It would produce 483872 or 120969[(1/sample_period)+1] points,It is huge,and the binblockread which get the data back need about 4.4(t) seconds or even more.

10,000 could be fine,how to reduce it?
1 second could be ok ,how to save time?
thanks!

Q2: the same question in C++,the folowing commands takes 4.25 seconds or even more.
SYSTEMTIME m;
GetSystemTime(&m);
long start=m.wMinute*60000+m.wSecond*1000+m.wMilliseconds;

/* fetch the IQ data*/
viPrintf(viSA,":READ:WAV0?\n");        

/* sBuffer[0]=#,sBuffer[1]=7*/
viRead (viSA,(ViBuf)sBuffer,2,&lBytesRetrieved);
            
//sBuffer=3870976                  
viRead (viSA,(ViBuf)sBuffer,sBuffer[1] - '0',&lBytesRetrieved);
                     
/*lBytesRetrieved=7*/
sBuffer[lBytesRetrieved] = 0;          

/*lNumberBytes=3870976*/
lNumberBytes = atoi(sBuffer);     
           
/*Points=967744*/
Points=lNumberBytes/sizeof(ViReal32);

IQdata=new float[Points];
for(i=0;i<Points;i++)
{
IQdata&#91;i&#93;=0;
}

/*get and save IQdata*/
viRead (viSA,(ViBuf)IQdata,lNumberBytes,&lBytesRetrieved);

/* read the terminator character and discard */
viRead (viSA,(ViBuf)sBuffer,1, &lLength);

GetSystemTime(&m);
long end=m.wMinute*60000+m.wSecond*1000+m.wMilliseconds;
printf("acquire time:%f\n",(end-start)/1000.0);     

Outcomes