0
$\begingroup$

When I enable file sink,I could save and read data of Gnuradio as below:

enter image description here

Questions as below:

1.Is the file sink data time domain data or frequency domain data?
2.Set samp_rate to 32k,running above flow graph 1 second,does data size of file sink changed when I change bandwidth from 32k to 16k?

Thanks in advance.

$\endgroup$
1
  • 1
    $\begingroup$ Re: hey, we've talked about file sink really extensively. File sink saves what you put in. It doesn't care whether it is time or frequency domain or anything else. You know that! $\endgroup$ Commented Mar 16, 2022 at 11:22

1 Answer 1

4
$\begingroup$
  1. The question isn't valid because domains only matter when describing or manipulating the data using dimensions in $n$D space. They are a way we conceptualize numbers in relation to each other, not anything intrinsic about those numbers themselves. The File Sink takes the complex data on its input and writes it out to a file as binary values in the described manner. The idea is that the File Sink saves the data such that something else that does care about the domain(s) can manipulate or present the data in a particular domain. If you are familiar with the software practice of serialization (or pickling) it wouldn't be completely incorrect to think of the process in those terms.

  2. "Sample Rate" means something related but a little different when considering Sources and Sinks. Sinks often behave as if they use the sample rate to determine the actual values for incoming data. Think of the sample rate as a "ruler" that the Sink needs to use to measure what the actual values of sample-dependent data of the incoming data are.

You can try this yourself. See what a GUI Sink displays for the actual value of the frequency components when you set its Sample Rate setting to samp_rate, samp_rate/2, or samp_rate/10. The results will look the same, but the actual values reported will be scaled down by the amount you have chosen. How this affects the File Sink is left as an exercise for the reader, but my guess is that the values it saves will be scaled down by any "under-sampling" factor.

(At the risk of introducing link-rot, you should definitely watch Michael Ossmann's Part 4 presentation on sampling in GNU Radio. Actually, watch the whole thing, and do the "homework". Seeing someone describe it and then trying it yourself answers these questions better than I could.)

A comment has pointed out that one could think of the saved data as in the time domain under some circumstances because it is literally series of 32-bit values written as fast as possible in time order. I think this is a conceptual mistake, however. It only really holds for data that you know is sensible values vs. time. But since any data could be read into it then you would already know this.

So, yes. If you are capturing Complex data, it will be a series of real and imaginary parts in order that could be easily expressed as being in the time domain. It still needs to be interpreted by something. Whether that interpretation is a YT graph or an FFT, it is still interpretation.

$\endgroup$
7
  • $\begingroup$ I can get frequency domain data after fft(grc_iq_data),how to get time domain data when I do time domain analysis?I think ifft(fft(grc_iq_data)) is same as grc_iq_data. $\endgroup$
    – kittygirl
    Commented Mar 18, 2022 at 17:46
  • $\begingroup$ That sounds like a different question! However, you take a vector of floats or complex values and either calculate the FFT or the IFFT with that block -- the domain is how you interpret the data, not the data itself. To convert from the FFT output you may need to convert to a different output. For example, to get the magnitude. $\endgroup$
    – user21417
    Commented Mar 18, 2022 at 18:17
  • $\begingroup$ so,if grc_iq_data is not time domain data,how can I run fft(grc_iq_data to get frequency domain data? $\endgroup$
    – kittygirl
    Commented Mar 18, 2022 at 18:27
  • $\begingroup$ The FFT block can do forward or reverse. Reverse is the Inverse FFT. Since the operations are symmetric they put it in a single block. To be clear: these blocks are not really converting from one domain to another. They are interpreting domain agnostic data to a particular domain, just like the GUI Sinks do when they are displaying the data as various domains. As for if you can take the output of Forward FFT and feed it into a Reverse FFT -- this is something I have not tried. Some data conversion just to get the vectors right might be required, but as long as the data is there it should work. $\endgroup$
    – user21417
    Commented Mar 18, 2022 at 18:30
  • $\begingroup$ In short, the data leaving or entering a block is just data. It is arranged as vectors or streams of n-bit floats or complex or whatever. And there may be "lossy" conversions that can be made. But the data itself is not really in a "domain". You can treat the output of the FFT block as time or freq domain data for sure. But it's really just a vector of data that can be fed to a block that knows what to do with data arranged in that manner. (or not, it's up to you to make sure the block is given what it needs and the right properties are set to get the result you want.) $\endgroup$
    – user21417
    Commented Mar 18, 2022 at 18:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .