discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions On GNU Radio FFT Data logging


From: Johannes Demel
Subject: Re: Questions On GNU Radio FFT Data logging
Date: Fri, 10 Dec 2021 12:27:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Chong Zhi,

I assume you want to observe the FM band ~90MHz to ~100MHz is that correct?

If you want to listen to audio, have a look at gr-rds.
https://github.com/bastibl/gr-rds
It helps quite a bit more to understand FM.

Since this discussion seems to have started in the GR Matrix chat, I infer you actually want to re-implement the Qt GUI Frequency Sink block outside of GNU Radio.
Further, this needs to happen online.

As Martin mentioned, at your current sample rate a CSV is a bad choice.
If CSV is a hard requirement, sent the resulting CSV to the person requesting it and ask them to open it. I just hope they understand the issue after their spreadsheet visualization tool crashed/is unresponsive or anything else.

The file format is explained in the GR wiki, as Marcus pointed out.
https://wiki.gnuradio.org/index.php/File_Sink#What_is_the_file_format_of_a_file_sink.3F_How_can_I_read_files_produced_by_a_file_sink.3F

Let's assume you use a binary file and want to open in in Python, in your case this would be
```
import numpy as np
samples = np.fromfile('your_file.cdat', dtype=np.complex64)
```
Please mind that the File extension (.cdat) is an arbitrary choice. In your flowgraph, the filename is just "Yes933FFT".

The most common tool for visualization in Python is matplotlib. However, this is more directed at drawing a static graph. It might be a good idea to look into e.g. pyqtgraph, if you want to continuously update your graph. There are probably hundreds of libraries that will cater your needs depending on what you want to do. e.g. there are libraries that help you create an interactive website, if you want to do that.

The Qt GUI Frequency Sink block does quite a few more things. The processing chain looks a bit like this:
1. FFT
2. compute magnitude squared
3. moving average
4. compute dB values, i.e. 10*log10(...)
5. Discard most samples and only draw a new line at the "update rate".

You might be able to swap step 4 and 5.
It might be interesting for you to perform some, most, or all of these steps in your GNU Radio flowgraph. This might lower your sample rate.

Besides, if you want to visualize your data "online", a file is a bad choice for data exchange. I would expect that you end up in "concurrency hell". GNU Radio offers quite a few useful options here. e.g. UDP or TCP sinks. Or there are ZeroMQ sinks. With Python you should be able to receive data from these sinks with just a few lines of code. For example, you might use a UDP sink in your flowgraph and send all data to a UDP port on your machine. Then, your visualization tool listens on that UDP port, receives your data and does what it is supposed to do.

Cheers
Johannes



On 10.12.21 09:59, Zen Chen wrote:
Yes933_10_12_20212nd.csv <https://drive.google.com/file/d/1tEaxr9bQICfDm-Uu6nIfGcLSQd6Rfb1Z/view?usp=drive_web> HI all,My name is Zen Chen , a GNU radio Novice and I tried to create an account on the GNU Radio .org website to post my questions on the mailing list however I could not . I am using GNU radio and Hack RF 1 to design a power spectrum analyser and I am using the attached flowgraph to and python script to give me the attached CSV file however , the results (FFT connect to file sink) is to large to be contained in a single excel file . Is there a problem in my GNU Radio Flowgraph?

Regards,
Chong Zhi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]