C-Netz: Use raised cosine to shape data signal

This commit is contained in:
Andreas Eversberg
2024-08-15 21:52:56 +02:00
parent e6fb4e5b83
commit c67dcc8170

View File

@@ -87,13 +87,8 @@ static void dsp_init_ramp(cnetz_t *cnetz)
LOGP(DDSP, LOGL_DEBUG, "Generating smooth ramp table.\n"); LOGP(DDSP, LOGL_DEBUG, "Generating smooth ramp table.\n");
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
/* use square-root of cosine ramp. tests showed that phones are more /* Use raised cosine ramp. */
* happy with that. (This is not correct pulse shaping!) */
c = cos((double)i / 256.0 * PI); c = cos((double)i / 256.0 * PI);
if (c < 0)
c = -sqrt(-c);
else
c = sqrt(c);
cnetz->fsk_ramp_down[i] = c * (double)cnetz->fsk_deviation; cnetz->fsk_ramp_down[i] = c * (double)cnetz->fsk_deviation;
cnetz->fsk_ramp_up[i] = -cnetz->fsk_ramp_down[i]; cnetz->fsk_ramp_up[i] = -cnetz->fsk_ramp_down[i];
} }