-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rayandaod/PC_receiver
Pc receiver
- Loading branch information
Showing
19 changed files
with
1,328 additions
and
558 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
A wonderful serenity has taken possession of my entire soul, like these sweet mornings of spring which I enjoy with my whole heart. I am alone, and feel the charm of existence in this spot, which was. | ||
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,26 @@ | ||
import sys | ||
import time | ||
|
||
import mappings | ||
import params | ||
import pulses | ||
import read_write | ||
import receiver | ||
import transmitter | ||
|
||
if __name__ == "__main__": | ||
moment = time.strftime("%Y-%b-%d__%H_%M_%S", time.localtime()) | ||
log_file = open("../logs/" + moment + ".log", "w+") | ||
if params.logs: | ||
moment = time.strftime("%Y-%b-%d__%H_%M_%S", time.localtime()) | ||
log_file = open("../logs/" + moment + ".log", "w+") | ||
sys.stdout = log_file | ||
|
||
# Write the parameters in the log file | ||
if params.logs: | ||
params.params_log() | ||
|
||
# Transmitter | ||
symbols = transmitter.encoder(transmitter.message_to_ints(), mappings.choose_mapping()) | ||
_, h = pulses.root_raised_cosine() | ||
samples_to_send = transmitter.waveform_former(h, symbols) | ||
read_write.write_samples(samples_to_send) | ||
samples_to_send = transmitter.waveform_former(h, transmitter.encoder()) | ||
transmitter.send_samples() | ||
|
||
# Wait for the user to press enter (in case the server is down for example) | ||
sys.stdout = sys.__stdout__ | ||
input("Press Enter to continue...") | ||
if params.logs: | ||
sys.stdout = log_file | ||
|
||
# Receiver | ||
receiver.received_from_server() | ||
|
||
sys.stdout = sys.__stdout__ | ||
input("Press Enter to end the transmission!") | ||
data_symbols, removed_freq_range = receiver.n_tuple_former() | ||
receiver.decoder(data_symbols, removed_freq_range) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.