No description
.gitignore | ||
channel.py | ||
channel_helper.py | ||
client.py | ||
decoder.py | ||
encoder.py | ||
main.py | ||
README.md |
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, andoutput.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