The samples calculation is very simple:
int i;
float mref19;
float mref1;
float mref2;
float m19;
float c19 = 0.6217735; // Pilot increment angle per sample
float r19;
m19 = 10.0 * pilot_level;
r19 = 525.0 * pilot_level; // The RDS level should be near the DAC maximum
// This value should give 2.5v +- 2v. ie 4v peak-peak
for(i = 0; i < 192; i++)
{
mref19 = ((float)i) * c19; // The phase angle
mod_buf[i] = m19 * sinf(mref19); // The pilot
mod38_buf[i] = sinf(2.0 * mref19); // The 38KHz
if(bPilot) modaux_buf[i] = 7.5 * mod_buf[i]; // Copy of pilot
// else modaux_buf[i] = r19 * sinf(3.0 * mref19); // The 57KHz
else modaux_buf[i] = r19 * sinf(mref19 - 48*c19); // The 19KHz phase shift
}
A pilot increment is calculated as the phase jump between samples. Then the carrier array are the iterative count of this, with the subcarrier incrementing twice the pilot. There some scaling factors to get the output levels correct, but note: these are equipment design dependent!
The possiblity of introducing a 57KHz carrier or phase offset pilot is shown.