Search code examples
gnuradiognuradio-companion

How to slow down a file source in GNU Radio?


I'm attempting to unpack bytes from an input file in GNU Radio Companion into a binary bitstream. My problem is that the Unpack K Bits block works at the same sample rate as the file source. So by the time the first bit of byte 1 is clocked out, byte 2 has already been loaded. How do I either slow down the file source or speed up the Unpack K Bits block? Is there a way I can tell GNU Radio Companion to repeat each byte from the file source 8 times?

Note that "after pack" is displaying 4 times as much data as "before pack".

flow graph

time domain graphs


Solution

  • Manos' answer is very good, but I want to add to this:

    This is a common misunderstanding for people that just got in touch with doing digital signal processing down at the sample layer:

    GNU Radio doesn't have a notion of sampling rate itself. The term sampling rate is only used by certain blocks to e.g. calculate the period of a sine (in the case of the signal source: Period = f_signal/f_sample), or to calculate times or frequencies that are written on display axes (like in your case).

    "Slowing down" means "making the computer process samples slower", but doesn't change the signal.

    All you need to do is match what you want the displaying sink to show as time units with what you configure it to do.