-1

I am using GNU Radio with hackrf. I need to get a picking for each frequency in accordance with the selected decibel level or a level above a certain decibel threshold and save the frequencies/db to a file.

Trying to solve this, I decided to recreate the "QT GUI Frequency Sink" algorithm through the Embedded python block, but unfortunately I lack knowledge of how to convert comlex64 data to fft freq / amplitude signal. I hit the wall for several months, I will be glad to any advice.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94

1 Answers1

0

First off: the hackRF is not a calibrated measurement device. You need to use a calibrated device to know at any given gain, sampling rate and RF frequency, what a digital power corresponds to in physical units. No exceptions.

but unfortunately I lack knowledge of how to convert comlex64 data to fft freq / amplitude signal.

You literally just apply the FFT of the length of your choosing, then calculate the magnitude of each complex value in that result. There's nothing more to it. (If the FFT being an algorithm that works on vectors of complex number and produces vectors of complex numbers of the same size confuses you, you don't have a programming, but a math basics problem!)

In GNU Radio, you can ask for your signal to come in multiples of any given length, so that getting vectors of input samples to transform is trivial python slicing.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Thanks for the quick answer, but unfortunately this does not solve my question. My goal is to write script in python, which will scan the broadcast over the selected frequency range, if the selected frequency during scanning exceeds the set decibel threshold, the frequency will be recorded in the file ("time - frequency"). – Bazil9202 Jan 06 '22 at 02:18
  • that has exactly *nothing* to do with the Qt GUI Frequency sink. – Marcus Müller Jan 06 '22 at 11:00
  • Yes you are right. I was going in the wrong direction. Now I have built a chain of blocks - signal source> throttle> stream to vector> log power fft> qt gui vector sink. I will try to insert an embedded python block into this block chain to snatch the data. If you were faced with the task of making an analytical application related to the analysis of carriers in a given frequency range, would you go the same way or see better? – Bazil9202 Jan 08 '22 at 21:59
  • I'd probably look through what gr-specest does. (admittedly, I used to contribute code to gr-specest, but it's... been a while) – Marcus Müller Jan 08 '22 at 22:25