Detecting frequency with gr.goertzel_fc() in python

Hello, I have written a few static blocks in python, but i am still
very much a beginner.

I want to be able to detect frequency of a single tone in gnuradio. I
have read that perhaps gr.goertzel_fc() is something I should use.
However, the documentation is very vague and I am unsure how exactly I
should even start using it, what ‘len’ means in its arguments, how i
connect something to it, and what it outputs. I am wondering if
someone can point me in the right direction. I have written a small
test script using a sine wave generator as an example. the end goal
is to detect various tones to input into a state machine using the USRP.

Thank you!


#!/usr/bin/env python

from gnuradio import gr
from gnuradio import audio
import time

class my_top_block(gr.top_block):
def init(self):
gr.top_block.init(self)
sample_rate = 32000
ampl = 0.1
src1 = gr.sig_source_f (sample_rate, gr.GR_SIN_WAVE, 1200,
ampl)
det = gr.goertzel_fc(32000,100??,1200)
self.connect (src1, det, ???)

if name == ‘main’:
try:
my_top_block().run()
except KeyboardInterrupt:
pass

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs