No description
Find a file
2025-05-30 02:16:51 +02:00
.gitignore first commit 2025-05-19 19:44:29 +02:00
channel.py chore: delete comments 2025-05-30 02:01:17 +02:00
channel_helper.py first commit 2025-05-19 19:44:29 +02:00
client.py first commit 2025-05-19 19:44:29 +02:00
decoder.py feat: add contribution 2025-05-30 02:16:51 +02:00
encoder.py feat: add contribution 2025-05-30 02:16:51 +02:00
main.py feat: add contribution 2025-05-30 02:16:51 +02:00
README.md feat: improve 2025-05-30 02:12:48 +02:00

Communication System README

This repository contains a Python-based transmitter/receiver system for sending 40-character text messages over a simulated noisy channel (local or remote server).


Prerequisites

  • Python 3.7+
  • NumPy

Install dependencies:

pip install numpy

Files

  • encoder.py — builds codebook and encodes messages.
  • decoder.py — decodes received samples back into text.
  • channel.py — local channel simulator.
  • client.py — client stub to send samples to the remote server.
  • main.py — main driver: wraps encode → channel → decode, plus performance testing.

Usage

All commands assume you are in the project root directory.

1. Test locally for 1 trial

python3 main_backup.py \
  --message "Lorem ipsum dolor sit amet. consectetuer" \
  --trials 1 \
  --mode local

2. Test locally for 500 trials

python3 main_backup.py \
  --message "Lorem ipsum dolor sit amet. consectetuer" \
  --trials 500 \
  --mode local

3. Test on the remote server (1 trial)

This will write input.txt and output.txt in your working directory.

python3 main_backup.py \
  --message "Lorem ipsum dolor sit amet. consectetuer" \
  --trials 1 \
  --mode server \
  --input_file input.txt \
  --output_file output.txt \
  --hostname iscsrv72.epfl.ch \
  --port 80

After running, input.txt contains your transmitted samples, and output.txt contains the noisy output from the server.

4. Create input.txt

python3 encoder.py "message_40_characters"

5. Create output.txt throught the channel

python3 channel.py

6. Decode the output.txt

python3 decoder.py

7. send input.txt to the server and get output.txt

python3 client.py \
  --input_file input.txt \
  --output_file output.txt \
  --hostname iscsrv72.epfl.ch \
  --port 80