aboutsummaryrefslogtreecommitdiff
path: root/src/tollr.c
blob: 3edce9bb3205635be9719f5995769c1b7ea2be88 (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 <stdio.h>
#include <stdint.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;
}