---
title: "CDMA"
subtitle: "Software Defined Radio"
output: pdf_document
date: "`r Sys.Date()`"
---
# Assignment
In the R environment for statistical computing, develop
software support for generating a CDMA composite
signal. Provide four parallel communication channels
with corresponding characteristic code sequences of 5
bits length. Define software support for accepting
ASCII characters (via a terminal or reading from a data
file), converting ASCII characters into binary data,
coding with the respective code sequence of the given
communication channel, and decoding and deciding
on the receiving side.
  
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Getting Input
We first get input by reading a file `input.txt`, where each line (0-3) is one communication channel.
Because UTF8 maintains compatibility with ASCII, the UTF8 conversion can be used assuming that the input is only ASCII.
ASCII characters require 7 bits of information per character.
```{r input}
lines <- readLines('./input.txt')
lines_bin <- unlist(lapply(lines, utf8ToInt))
```

```{r input-demo, echo=FALSE}
print(lines)
print(lines_bin)
```

## Orthogonal Code
For an orthogonal code, we are looking for vectors $(a,b,...n)$ in  that satisfy pairwise orthogonality $a \perp b$.


