Agilent Technologies FS2010 Manual de servicio Pagina 247

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 396
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 246
Agilent Signal Generators Programming Guide 239
Creating and Downloading Waveform Files
Creating Waveform Data
Line Code—Interleaving and Byte Swapping for Little Endian Order
20
21
22
23
24
25
26
27
28
29
30
char iqbuffer[NUMSAMPLES*4];
for(index=0; index<numsamples; index++)
{
short ivalue = idata[index];
short qvalue = qdata[index];
iqbuffer[index*4] = (ivalue >> 8) & 0xFF;
iqbuffer[index*4+1] = ivalue & 0xFF;
iqbuffer[index*4+2] = (qvalue >> 8) & 0xFF;
iqbuffer[index*4+3] = qvalue & 0xFF;
}
return 0;
Line Code Description—Interleaving and Byte Swapping for Little Endian Order
20 Define a character array to store the interleaved I and Q data. The character array makes byte swapping
easier, since each array location accepts only 8 bits (1 byte). The array size increases by four times to
accommodate two bytes of I data and two bytes of Q data.
21–29 Create a loop to do the following:
Save the current I data array value to a variable.
NOTE In rare instances, a compiler may define short as larger than 16 bits. If this condition exists,
replace short with the appropriate object or label that defines a 16–bit integer.
Save the current Q data array value to a variable.
Swap the low bytes (bits 0–7) of the data with the high bytes of the data (done for both
Vista de pagina 246
1 2 ... 242 243 244 245 246 247 248 249 250 251 252 ... 395 396

Comentarios a estos manuales

Sin comentarios