Remote Control Commands
R&S
®
SMJ100A
509
Operating Manual 1403.7458.32 ─ 14
// 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
Waveform and List Format
Содержание SMJ100A
Страница 34: ...Preface R S SMJ100A 18 Operating Manual 1403 7458 32 14 Notes on Screenshots...
Страница 86: ...Preparing for Use R S SMJ100A 70 Operating Manual 1403 7458 32 14 LXI Configuration...
Страница 139: ...Manual Operation R S SMJ100A 123 Operating Manual 1403 7458 32 14 Legend of Front Panel Controls...
Страница 140: ...Manual Operation R S SMJ100A 124 Operating Manual 1403 7458 32 14 Legend of Front Panel Controls...
Страница 454: ...Instrument Function R S SMJ100A 438 Operating Manual 1403 7458 32 14 Baseband Signal Baseband Block...
Страница 826: ...Remote Control Commands R S SMJ100A 810 Operating Manual 1403 7458 32 14 UNIT Subsystem...
Страница 828: ...Maintenance R S SMJ100A 812 Operating Manual 1403 7458 32 14 Storing and Packing...
Страница 843: ...Hardware Interfaces R S SMJ100A 827 Operating Manual 1403 7458 32 14 Figure A 2 BERT circuit diagram BERT Connector...
Страница 844: ...Hardware Interfaces R S SMJ100A 828 Operating Manual 1403 7458 32 14 BERT Connector...