SDR: Display DC line (center frequency) in the spectrum view

This commit is contained in:
Andreas Eversberg 2019-05-30 21:08:23 +02:00
parent 831b68401a
commit 4362c78f38
1 changed files with 16 additions and 0 deletions

View File

@ -368,6 +368,22 @@ void display_spectrum(float *samples, int length)
}
}
}
/* add center (DC line) to spectrum */
j = width / 2 + 0.5;
if (j < 1 || j >= width-1) /* check out-of-range, should not happen */
continue;
for (k = 0; k < HEIGHT; k++) {
/* skip green/yellow/white graph */
if (screen_color[k][j] == 13 || screen_color[k][j] == 17 || screen_color[k][j] == 12)
continue;
screen[k][j] = '.';
screen_color[k][j] = 7;
}
screen[0][j-1] = 'D';
screen[0][j+1] = 'C';
screen_color[0][j-1] = 7;
screen_color[0][j+1] = 7;
/* display buffer */
printf("\0337\033[H");
for (j = 0; j < HEIGHT; j++) {
for (k = 0; k < width; k++) {