/*--------------------Set up Spectrum Analyzer-----------------------------*/
printf ("\n\nSet up Spectrum Analyzer");
printf ("\n\n 1. Ref Level = 25 dBm");
printf ("\n 2. Span = 1 kHz");
printf ("\n 3. Resolution BW = 30 Hz");
printf ("\n 4. Video BW = 30 Hz");
printf ("\n 5. Connect Spectrum Analyzer to AFG Output");
printf ("\n\nPress ENTER when ready");
getchar ();
/*--------------------Perform Test-----------------------------------------*/
for (i = 0;i <= 5;i ++)
{
if (i == 3)
/* Set AFG output to 10dBm */
{
dbm_out = 10;
iprintf (id, "VOLT %uDBM", dbm_out);
printf ("\n\nSet Spectrum Analyzer Ref Level to 12 dbm");
printf ("\nPress ENTER to continue");
getchar ();
}
iprintf (id, "ABORT\n");
/* Set Frequency */
iprintf (id, "FREQ %lf\n", freq[i]);
iprintf (id, "INIT:IMM\n");
printf ("\n\nFUNDAMENTAL");
/* Enter fundamental amplitude */
printf ("\n\n Set Spectrum Analyzer center frequency to %.2e Hz", freq[i]);
printf ("\n Measure amplitude at the center frequency");
printf ("\n Enter amplitude (in dBm) : ");
scanf ("%lf", &baseline);
sum = 0;
for (harmonic = 2;harmonic <= 5;ha+)
{
printf ("\n\nHARMONIC = %u", harmonic);
/* Enter harmonic amplitude */
printf ("\n\n Set Spectrum Analyzer center frequency to %.2e Hz",
freq[i]*harmonic);
printf ("\n Measure amplitude at the center frequency");
printf ("\n Enter amplitude (in dBm) : ");
scanf ("%lf", &reading);
result = reading - baseline;
sum = sum + pow (10,(result/10));
/* Sum squared voltages */
}
thd = 20 * log10(sqrt(sum));
/* Calculate THD in dBc */
printf ("\n\nAmplitude = %u dBm", dbm_out);
/* Display results */
printf ("\nFundamental Frequency = %.2e Hz", freq[i]);
printf ("\nTHD = %4lf dBc", thd);
printf ("\n\nPress ENTER to continue");
98 Verification Tests - C Programs
Appendix A
Содержание E1340A
Страница 6: ...Notes 6 HP E1340A Arbitrary Function Generator Service Manual ...
Страница 8: ......
Страница 10: ...Notes 12 What s in this Manual HP E1340A Service Manual ...
Страница 18: ...Notes 20 General Information Chapter 1 ...
Страница 74: ...Notes 76 Adjustments Chapter 3 ...
Страница 78: ...Notes 80 Replaceable Parts Chapter 4 ...
Страница 104: ...Notes 106 Verification Tests C Programs Appendix A ...