jhshi / openofdm

Sythesizable, modular Verilog implementation of 802.11 OFDM decoder.
http://openofdm.rtfd.io
Apache License 2.0
380 stars 191 forks source link

Out of range error in test.py with sample file #16

Open andreaskuster opened 3 years ago

andreaskuster commented 3 years ago

First, thanks a lot for this cool project!

During some initial tests with the code base, i run into the following issue, which seems to be a bug:

I run the test.py script with your sample from https://openofdm.readthedocs.io/en/latest/_downloads/samples.dat using the following command: python2 test.py samples.dat --no_sim

I am running the script on a Ubuntu 20.04 LTS, x86_64 system and end up with an out of range error. Below, you can find the log:

andreas@dev-pc:~/mnt/hdd1/openofdm/scripts$ python2 test.py samples.dat --no_sim
Using file /home/andreas/mnt/hdd1/openofdm/scripts/samples.dat (21440 samples)
Decoding...
Power trigger at 0
Decoding packet starting from sample 11
[COARSE OFFSET] 0.010686 (2)
[FINE OFFSET] 0.000318 (0)
[FREQ OFFSET] 0.010686 (2)
[PILOT OFFSET] 0.016022 (4)
[NO PUNCTURE]
[SIGNAL] {'parity_bits': '1', 'len_bits': '010100010000', 'rsvd': '0', 'length': 138, 'ht': False, 'tail_bits': '000000', 'rate': 24, 'parity_ok': True, 'rate_bits': '1001', 'mcs': 0}
12 DATA OFDM symbols to decode
[PILOT OFFSET] 0.086909 (22)
[PILOT OFFSET] 0.110029 (28)
[PILOT OFFSET] 0.104411 (26)
[PILOT OFFSET] 0.133532 (34)
[PILOT OFFSET] 0.205433 (52)
[PILOT OFFSET] 0.227036 (58)
[PILOT OFFSET] 0.255751 (65)
[PILOT OFFSET] 0.279896 (71)
[PILOT OFFSET] 0.312476 (79)
[PILOT OFFSET] 0.349655 (89)
[PILOT OFFSET] 0.362203 (92)
[PILOT OFFSET] 0.392154 (100)
[NO PUNCTURE]
[  0] 88 42 2c 00 e4 90 7e 15 2a 16 e8 de 27 90 6e 42
[ 16] e8 de 27 90 6e 40 70 13 00 00 05 01 00 20 00 00
[ 32] 00 00 43 e0 7b 59 2e 77 13 34 95 a7 85 f5 32 69
[ 48] 08 38 4f c5 99 0f ea a6 13 c4 ee df f7 22 e2 fe
[ 64] 34 7d 75 95 f3 74 45 f5 1a 33 18 bb 8b 02 53 ed
[ 80] dc e9 74 28 b7 08 33 04 82 fc a2 f5 72 ac 8f 87
[ 96] 99 8f 22 64 79 62 ac f9 9d 38 3d ed 8c c4 bc 95
[112] ce ed da 08 cc 1d a2 d2 39 07 9b 0a 43 2f 4c f4
[128] ad 61 5b 2a dc 7c 52 7f 21 e9
Stop after 1640 samples
Traceback (most recent call last):
  File "test.py", line 217, in <module>
    test()
  File "test.py", line 97, in test
    if getattr(expected_signal, attr) == signal_out[idx]:
IndexError: list index out of range
JiaoXianjun commented 3 years ago

Have you tried the dot11zynq branch?

andreaskuster commented 3 years ago

@JiaoXianjun Assuming you are referring to the dot11zynq branch from the opensdr fork (here) , i can confirm that the error is present there as well.

Btw: Which is your actual development repo? Is it this (https://github.com/jhshi/openofdm) or the one in opensdr (https://github.com/open-sdr/openofdm) ? I am asking since I am porting this library to the Ettus B210 device and will eventually open a PR..

bby0616 commented 2 years ago

@JiaoXianjun Assuming you are referring to the dot11zynq branch from the opensdr fork (here) , i can confirm that the error is present there as well.

Btw: Which is your actual development repo? Is it this (https://github.com/jhshi/openofdm) or the one in opensdr (https://github.com/open-sdr/openofdm) ? I am asking since I am porting this library to the Ettus B210 device and will eventually open a PR..

have you ever solved this problem? I have faced the same trouble with you

andreaskuster commented 2 years ago

@bby0616 Yes, I did. However, since there has been no activity here so far, I haven't PRd it back to this repo. I upgraded the script to python3 (including many additional adjustment. Feel free to have a look/fork it from here: https://github.com/andreaskuster/openofdm

bby0616 commented 2 years ago

@bby0616 Yes, I did. However, since there has been no activity here so far, I haven't PRd it back to this repo. I upgraded the script to python3 (including many additional adjustment. Feel free to have a look/fork it from here: https://github.com/andreaskuster/openofdm

Thanks bro, I am really appreciate your help