EasyManua.ls Logo

Rohde & Schwarz SMBV100A - Creating an ASCII C-List Manually

Rohde & Schwarz SMBV100A
911 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Remote Control Commands
R&S
®
SMBV100A
530Operating Manual 1176.8016.02 ─ 17
// SICO.wv
// Generating a binary data set from the I/Q pairs in the file SICO.txt
// and storing the result to file SICO.wv
FILE *fp_sour, *fp_dest;
float i_float, q_float;
unsigned short i_usint, q_usint;
fp_sour = fopen("SICO.TXT", "rt");
if (fp_sour == 0)
return -1;
fp_dest = fopen("SICO.WV", "wb");
if (fp_dest == 0)
{
fclose(fp_sour);
return -1;
}
// Write required tags to waveform file
fprintf(fp_dest, "{TYPE: SMU-WV,0}");
fprintf(fp_dest, "{CLOCK: 10e6}");
fprintf(fp_dest, "{SAMPLES: %d}", samples);
// RMS, Peak
fprintf(fp_dest, "{LEVEL OFFS: %f,%f}", -1.0f * 20.0f * log10(1.0f/sqrt(2.0f)), 0.0f);
fprintf(fp_dest, "{WAVEFORM-%d:#", (samples * 4) + 1);
for (i=0; i<samples; i++)
{
// Read I/Q pair from ASCII file
if (fscanf(fp_sour, "%f %f", &i_float, &q_float) == EOF)
break;
// Convert I/Q pair to unsigned short
i_usint = (unsigned short)floor((i_float * 32767.0) + 0.5);
q_usint = (unsigned short)floor((q_float * 32767.0) + 0.5);
// Write converted I/Q pair to waveform file
fwrite(&i_usint, 2, 1, fp_dest);
fwrite(&q_usint, 2, 1, fp_dest);
}
fprintf(fp_dest, "}");
fclose(fp_dest);
fclose(fp_sour);
return 0;
}
7.4.4 Creating an ASCII C-List Manually
When you create the C-list in the editor, as shown in the figure, you get an ASCII file
with the extension *.dm_iqc (see the example C-List ASCII File).
Waveform and List Format

Table of Contents

Other manuals for Rohde & Schwarz SMBV100A

Related product manuals