3

How can I calculate the average power of a signal within a certain bandwidth and store that value in a variable that I can reference for later?

For example, I have a low pass filter 15kHz wide, I want to know if there's a tool in GNU Radio Companion that will allow me to calculate the average power over a certain time to see if the power level passes a threshold.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
BBEng
  • 155
  • 3
  • 17

1 Answers1

5

The power of a digital signal x[t] is simply abs(x)². Thus in order to do the following:

calculate the average power

  • use the "complex to magnitude square" block to convert your signal to signal power

over a certain time

  • use the "moving average" block to calculate the moving average of a specific time slice

see if the power level passes a threshold

  • use the "threshold" block to calculate... you guessed it, the threshold.

Have you read the tutorials? http://tutorials.gnuradio.org

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • I`m gnu to gnu radio (sorry couldn`t resist the pun). I`ve read a bunch of tutorials but I am having trouble understanding a lot of it. Would you mind elaborating your answer? I have the following so far: Source --> LPF --> QT GUI frequency sink. – BBEng May 23 '17 at 18:30
  • Thanks for the answer! The only problem I'm still having is I don't know what to connect after complex to mag^2. That block has a float output and moving average has a complex input, so I cannot connect them. Can I do this? LPF--->cmplx to mag^2--->Threshold--->Float to cmplx--->Moving Avg--->sink – BBEng May 23 '17 at 19:11
  • You can use the float to complex block by setting one input to a constant (0). – eeKnud May 24 '17 at 14:44
  • One thing to note is that the approach above calculates relative power, which is probably what you want if all you are doing is comparing with a threshold, but unless you calibrate your system, it would be incorrect to consider the measurements as absolute aka true power. – eeKnud May 24 '17 at 14:46
  • @eeKnud don't convert power (a real number) to complex. The Moving Avg should exist in a real version. You can just select "type=float" instead of "complex" in the moving average's block option. Damian, your question indicates you might want to re-visit the guided tutorials I've linked to! – Marcus Müller May 24 '17 at 19:56
  • @Marcus Müller Ya I figured that out almost immediately after asking. I should have played around with it first, that's my bad. For anyone in the future looking to find out if a signal passes a threshold dB, I used cmplx to mag^2 --> Threshold (not a dB measurement) --> probe signal. – BBEng May 26 '17 at 12:44