R&S AFQ100A
AFQ Commands - Signal Generation
1401.3084.32 6.25
E-3
The contents of the waveform file SICO.WV for 20 I/Q pairs is now ready for
operation and reads.
{WAVEFORM-81: # ... }
I Q I Q I Q I Q
I Q
81bytes
{CLOCK: 10e6}
20 I/Q pairs = 80 bytes
{TYPE: SMU-WV,0}
The tags TYPE, CLOCK and WAVEFORM are mandatory for each waveform. All
other tags are optional and can be inserted after the TYPE tag in arbitrary order,
e.g.
{TYPE: SMU-WV,0}
{COMMENT: I/Q=sine/cosine, 20 points, clock 10 MHz}
{CLOCK: 10e6}
{Samples:20}
{WAVEFORM-81:#
IQIQIQIQIQIQ
...
IQ
}
C-program for creating the file SICO.TXT containing 20 sine and cosine pairs:
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void main(void)
{
const unsigned int samples = 20;
const float pi = 3.141592654;
float grad, rad;
FILE *fp;
int i;
fp = fopen("SICO.TXT", "w");
if (fp == 0)
return;
for (i=0; i<samples; i++)
{
grad = (360.0 / (float)samples) * (float)i;
rad = grad * (pi / 180.0);
fprintf(fp, "%f %f\n", sin(rad), cos(rad));
}
fclose(fp);
}
Contents of the file
SICO.TXT:
Sine (I) Cosine (Q)
0.000000 1.000000
0.309017 0.951057
0.587785 0.809017
0.809017 0.587785
0.951057 0.309017
1.000000 -0.000000
0.951056 -0.309017
0.809017 -0.587785
0.587785 -0.809017
0.309017 -0.951056
-0.000000 -1.000000
-0.309017 -0.951057
-0.587785 -0.809017
-0.809017 -0.587785
-0.951056 -0.309017
-1.000000 0.000000
-0.951056 0.309017
-0.809017 0.587785
-0.587785 0.809017
-0.309017 0.951057