aboutsummaryrefslogtreecommitdiff
path: root/src/tollr.c
blob: 11d5bd640a96f988110a5c7a2244f50128e510ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*
  FILE...: tollr.c
  AUTHOR.: David Rowe
  CREATED: July 2020

  Converts oneBitPerByte hard decisions to LLRs for LDPC testing.
*/

#include <stdint.h>
#include <stdio.h>

int main(void) {
  uint8_t bit;
  while (fread(&bit, sizeof(uint8_t), 1, stdin)) {
    float llr = 10.0 * (1 - 2 * bit);
    fwrite(&llr, sizeof(float), 1, stdout);
  }
  return 0;
}