C-Netz: Use cosine-square ramp for better signal generation

This commit is contained in:
Andreas Eversberg 2016-08-02 07:39:02 +02:00
parent ce7a98206a
commit eb85afa49c
1 changed files with 2 additions and 2 deletions

View File

@ -66,12 +66,12 @@ static void dsp_init_ramp(cnetz_t *cnetz)
PDEBUG(DDSP, DEBUG_DEBUG, "Generating smooth ramp table.\n"); PDEBUG(DDSP, DEBUG_DEBUG, "Generating smooth ramp table.\n");
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
c = cos((double)i / 256.0 * PI); c = cos((double)i / 256.0 * PI);
#if 0 /* use cosine-square ramp. tests showed that phones are more
* happy with that. */
if (c < 0) if (c < 0)
c = -sqrt(-c); c = -sqrt(-c);
else else
c = sqrt(c); c = sqrt(c);
#endif
ramp_down[i] = (int)(c * (double)cnetz->fsk_deviation); ramp_down[i] = (int)(c * (double)cnetz->fsk_deviation);
ramp_up[i] = -ramp_down[i]; ramp_up[i] = -ramp_down[i];
} }