Background:
I am trying to get GR to receive a signal from a wild life transmitter
on about 160.7073Mhz and calculate the beeps per minute - with an
ultimate goal of logging it to a db or csv.

The project is not for profit and I work with an endangered species
which are fitted with these transmitters. Because the birds are in a
very remote location we would like to use a Rpi4+ and RTL-SDR to
record daily the status of the birds as we only get to the remote
location occasionally ( a few times a year).

I may even invest in a SDRPlay which I understand is a better build of
receiver. I have some java programming experience, and python looks
easy enough for this...anyway to detail what I have done so far:

Signal:
The transmitted pulse is an unmodulated burst of RF energy about 0.2s
in duration and the time between pulses can vary to indicate the
animal is alive (30 beeps per minute), dead (90bpm) or incubating
(48bpm).

Every 10 minutes the are a series of other pulses which convery even
more information, but for now I just want to determine the time
between pulses and workout beeps per minute from that.

In my research I see that a very similar question has already been
asked by others both on this list and here
https://dsp.stackexchange.com/questions/50103/checking-for-vhf-pulse-with-sdr-and-python
with great answers from Andy Walls. I have read all of that and:

1. Read the beginner tutorials
2. Read 
https://dsp.stackexchange.com/questions/50103/checking-for-vhf-pulse-with-sdr-and-python
3. With help from another GR user got a baseband recording of the
signal isolated in a GR project
4. Have completed the tags tutorial on the wiki :
https://wiki.gnuradio.org/index.php?title=Python_Block_Tags
5. Tried to modify the tags tutorial as it applies to my project
6. Got as far as : https://github.com/bigalnz/tracker

This is where I got stuck - I tried to create a embedded python block
using the tags wiki article to my pulse isolator.

I expected `for index in range(len(input_items[0])):` to result in a
counter from 0,1,2,3,.....x but it just seemed to be 0 and 1?

The second issue I encountered was I thought I could detect peaks with
this logic:

if input_items[0][index-1] > input_items[0][index] and
input_items[0][index-1] > input_items[0][index-2]:

But that did not put the tags on the peaks - so before I can even
think about calculating time gaps I presume I need to get the peak
detection working, and to do that I need to understand why the index
is not iterating beyond 0 and 1.

I am very grateful to those that have helped so far, and appreciate
any further input I can get.

Being able to capture this data will be really helpful for the future
of this species - full disclosure this is not a project I am marked
on, I am not a student and am not making any money from this.

Much thanks in advance

Al


****** CODE SNIPPET ******

    def work(self, input_items, output_items):

        print(f"length of input_items : {len(input_items[0])}")
        for index in range(len(input_items[0])):
            #print(f" the index is increasing : {index}")
            if (input_items[0][index] >= self.threshold and
self.readyForTag == True):
                #print("inside loop *********************")
                #print(f"index : {index} input itmes index :
{input_items[0][index]}")
                #print(f"index : {index} input itmes -1 :
{input_items[0][index-1]}")
                #print(f"index : {index} input itmes -2:
{input_items[0][index-2]}")
                if input_items[0][index-1] > input_items[0][index] and
input_items[0][index-1] > input_items[0][index-2]:
                    #print(f"peak at {input_items[0][index-1]}")
                    key = pmt.intern("detect")
                    value =
pmt.from_float(np.round(float(input_items[0][index-1]),2))
                    writeIndex = self.nitems_written(0) + index-1
                    #print(f"Index:{writeIndex}")
                    #print(f"Value:{value}")

                    self.add_item_tag(0, writeIndex, key, value )
                    self.readyForTag = False

            if (self.readyForTag == False):
                self.timer = self.timer + 1
            if (self.timer >= self.report_period):
                self.timer = 0
                self.readyForTag = True

        output_items[0][:] = input_items[0]
        return len(output_items[0])

Reply via email to