Hello Guys

I'm creating a customized block in the GNU Radio framework using python
that takes in a number of input items and once that number of input items
surpasses a certain number, 1024 of the input items are taken and stored
into an array, and then those items are converted to dB and lastly compared
to a threshold value, 5 in this case. If any of the values are greater than
the threshold value, a message is printed indicating a signal is present,
and if none of the values are greater than 5, this is indicated with a
message stating "No signal is present".

When I run the flow graph which uses this block I get the following error.

handler caught exception: a float is required
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/gateway.py",
line 55, in eval
    try: self._callback()
  File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/gateway.py",
line 144, in __gr_block_handle
    ) for i in self.__out_indexes],
  File "/home/tellrell/Ener_detec.py", line 42, in general_work
    c = math.log10(in1)         #converts 1024 values stored in in1 to dB
and stores them in c
TypeError: a float is required
thread[thread-per-block[8]: <block ED_block (22)>]: caught unrecognized
exception



The .py script for the customized block along with the corresponding .grc
file are attached below.

Any help would be great.

Tellrell

Attachment: Ener_detec.py
Description: Binary data

Attachment: ener_dtec.grc
Description: Binary data

_______________________________________________
Discuss-gnuradio mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to