Update cubesatsim.ino

pull/161/head
alanbjohnston 4 years ago committed by GitHub
parent 45a265a1e3
commit 9d155efe8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -220,23 +220,24 @@ void config_telem() {
parityLen = 32; parityLen = 32;
amplitude = 32767; amplitude = 32767;
samples = S_RATE / bitRate; samples = S_RATE / bitRate;
Serial.println(samples);
bufLen = (frameCnt * (syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))) * samples); bufLen = (frameCnt * (syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))) * samples);
Serial.println(bufLen);
samplePeriod = ((float)((syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))))/(float)bitRate) * 1000 - 1800; samplePeriod = ((float)((syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))))/(float)bitRate) * 1000 - 1800;
// samplePeriod = 3000; // samplePeriod = 3000;
// sleepTime = 3.0; // sleepTime = 3.0;
//samplePeriod = 2200; // reduce dut to python and sensor querying delays //samplePeriod = 2200; // reduce dut to python and sensor querying delays
sleepTime = 2.2f; sleepTime = 2.2f;
Serial.println(samplePeriod);
frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms frameTime = ((float)((float)bufLen / (samples * frameCnt * bitRate))) * 1000; // frame time in ms
Serial.println(frameTime);
// printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n", // printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d ms per frame %d ms sample period\n",
// bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod); // bufLen, bufLen / (samples * frameCnt), bitRate, frameTime, samplePeriod);
sin_samples = S_RATE/freq_Hz; // sin_samples = S_RATE/freq_Hz;
// printf("Sin map: "); // printf("Sin map: ");
for (int j = 0; j < sin_samples; j++) { // for (int j = 0; j < sin_samples; j++) {
sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples))); // sin_map[j] = (short int)(amplitude * sin((float)(2 * M_PI * j / sin_samples)));
// printf(" %d", sin_map[j]); // printf(" %d", sin_map[j]);
// } // }
// printf("\n"); // printf("\n");

Loading…
Cancel
Save

Powered by TurnKey Linux.