How to use Log Power FFT module in python

I want to do some function in frequency domain and just writen a C++
block
already.
Now, I just want to use GRC to constuct a front end and connect to my
own
block.

The interface bewteen these two is a power vector of FFT results and I
use
a Log Power FFT module in GRC.

My question is Log Power FFT module in GRC seems that have a very
strange
output format(not stream or vector),
So what is the format of that module and How clould I use it if my C++
block
have a float vector input(512 points power result of FFT).

Thanks

nansai hu wrote:

I want to do some function in frequency domain and just writen a C++ block
already.
Now, I just want to use GRC to constuct a front end and connect to my own
block.

The interface bewteen these two is a power vector of FFT results and I use
a Log Power FFT module in GRC.

My question is Log Power FFT module in GRC seems that have a very strange
output format(not stream or vector),

It outputs stream, where each element in the stream is a vector of
floats with length fft_size.

the output signature of the block is fft_size*sizeof(float)

specifically, what problem are you having?

-josh

My question is I can’t find any module in GRC can be conncet to Log
Power
FFT module in right format.
Could you tell me which module in GRC can be use to receive Log Power
FFT
module?

2009/12/16 Josh B. [email protected]

all blocks that have:

  1. a float input/sink port
  2. a vector length set to fft_size

-josh

Ok. I add a vector sink in GRC and to observe the data in that module.
But when I run GRC there is no result shown. I need to add some other
block
to see or I need write some code like “prinf” in Python?

2009/12/16 Josh B. [email protected]

A few ways I can think of off-hand:

  1. make a custom gr.hier_block2 in python, it can read from a message
    queue

  2. use a file sink to dump the data from the log power fft to file,
    post-process the file

  3. you could use the variable sink in grc to write the fft vectors to a
    variable called fft_vec. Then another variable could be
    print(str(fft_vec)). I think it would actually work, but I have not
    tried. :slight_smile:

-josh

Many Thanks.
I use a file sink to received the result of Log Power FFT and it can be
excute successfully.
But the file which I saved is hard to read and understand.

In my mind, I think a scenario like this:
I use a signal generater to transmit a signal, then I use USRP to
received.
USRP include a USRP source,a Log Power FFT and a File sink.
When I transmit a CW signal,I imagine that I could get the file data in
512points(one snapshot) and see a peak value and noise in other 511
points.

2009/12/16 Josh B. [email protected]

nansai hu wrote:

Many Thanks.
I use a file sink to received the result of Log Power FFT and it can be
excute successfully.
But the file which I saved is hard to read and understand.

Its binary floating point data.

In my mind, I think a scenario like this:
I use a signal generater to transmit a signal, then I use USRP to received.
USRP include a USRP source,a Log Power FFT and a File sink.
When I transmit a CW signal,I imagine that I could get the file data in
512points(one snapshot) and see a peak value and noise in other 511 points.

Im not sure that the problem is. There is a graphical fft sink in grc,
so you can look at a live/running fft plot.

In the binary floating point data,how many bits represent data and how
many
bits represnt the right?

2009/12/16 Josh B. [email protected]