From 2ccbbea5141c5bc61f45e61478873c542037837f Mon Sep 17 00:00:00 2001 From: Paul Walko Date: Thu, 2 Mar 2017 14:45:36 +0000 Subject: [PATCH] rename --- bluetooth.m => packetParser.m | 3 ++- physicalLayer/packetFinder.m | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) rename bluetooth.m => packetParser.m (99%) create mode 100755 physicalLayer/packetFinder.m diff --git a/bluetooth.m b/packetParser.m similarity index 99% rename from bluetooth.m rename to packetParser.m index 061cad8..0754b2d 100755 --- a/bluetooth.m +++ b/packetParser.m @@ -1,6 +1,7 @@ #!/usr/bin/octave-cli ## Paul Walko -## bluetooth-undergrads +## Inputs an packet by an array of 1s and 0s +## Then finds all possible data in it ### Variables diff --git a/physicalLayer/packetFinder.m b/physicalLayer/packetFinder.m new file mode 100755 index 0000000..86f5226 --- /dev/null +++ b/physicalLayer/packetFinder.m @@ -0,0 +1,32 @@ +#!/usr/bin/octave-cli +## Paul Walko +## Finds packets in a binary data file + +## Includes +pkg load signal; + +## Global vars +############################################# +global proto_vars = -1; # struct +global raw_data = -1; # array + +############################################# +function loadFile(fileName, count) + global preamble_proto; + global raw_data; + source "createPrototype.m" + proto_vars = struct("preamble_proto", preamble_proto, "freq_sep", freq_sep, "samps_per_symb", samps_per_symb, "symb_span", symb_span, "gauss_taps", gauss_taps, "samp_rate", samp_rate, "symb_rate", symb_rate, "time_bw_prod", time_bw_prod); + + raw_data = read_complex_binary(fileName, count); +endfunction + +function main(fileName = "channel37_3.dat") + arg_list = argv(); + if length(arg_list) > 0 + fileName = arg_list{1}; + endif + loadFile(fileName); + +endfunction + +main();