Pushbutton IQ Recorder with descriptive filenames
Application
When doing field work, capturing Raw I/Q for post processing is a helpful way to get the best signal quality of a capture while spending minimal time in a non-lab environment.
Changing filenames manually for every capture can be laborious and subject to user error. Furthermore, starting and stopping a flowgraph can be tricky if we are tuning the SDR frontend parameters to find optimal level/frequency/sample rate. If a non-descriptive filename is used such as capture_file.cfile
it does nothing to describe the situation to the user during the analysis stage as it doesn't include any information about the RF samples we've captured. This is critical to the post-analysis process.
- What was the sample rate?
- Center Frequency? SDR Frontend Gain?
- When was it recorded?
- What were we even trying to capture?
These are all questions we ask after the fact, especially if a lot of time has gone by since we did the recordings.
Introduction
Goals
Create a File Sink with Dynamic Information in the Filename
- timestamp
- radio parameters
- User Input Note for clarity
Only Record the file on an User Input
- Define User Input as Momentary Switch in GUI
- Set Conditional Statement in File Sink Block
Content
The flowgraph for this tutorial is shown below along with the GRC file needed if you would like to test it out.
Create a File Sink with Dynamic Information in the Filename
In the following example we will: Use some Pythonic methods to leverage the Runtime Callbacks in our flowgraph which will allow the filenames to change dynamically based on timestamp and radio parameters.
This portion of the flowgraph:
- one
- two
- three
Timestamps
SDR Frontend Information
This section of the flowgraph is shown here:
The parameters for the File Sink are shown here:
User Input Note to Describe the Capture
This part of the flowgraph is shown here:
[[File:]]
Example:
Only Trigger Recording on User Input
Using python conditional statement, we can send the I/Q samples to /dev/null
until the record button is pressed (and held). When the record button is pressed, the I/Q samples will begin streaming to a file with a timestamp and radio parameters of the flowgraph's state at the time the button was pressed. When released it will send the samples back to /dev/null
/dev/Null or Filename with Python Conditional Statement
Here is a brief demo of the flowgraph in action: