diff --git a/main.cpp b/main.cpp index cf04827..598e371 100644 --- a/main.cpp +++ b/main.cpp @@ -16,9 +16,10 @@ static constexpr int OFS = 20; static CFFT fft (ORDER); static vector mono; -static bool sign = false; +static bool odd = false; void cputs (const char * s) { + odd = ! odd; const complex plus (0.0, 256.0), minus (0.0, -256.0); complex data [TAPS]; memset (&data,0, TAPS * sizeof(complex)); @@ -27,12 +28,12 @@ void cputs (const char * s) { const char c = s [n]; if (c == '\0') break; if (c == '#' ) { + const bool sign = (n & 1) xor odd; // Střídání fáze 0/180 dost potlačí rozmazání spektra. const complex fill = sign ? plus : minus; const int k = n + OFS; data[k] = fill; data[TAPS - k] = fill; - sign = ! sign; } putchar(c); n += 1;