Usage of Variable block and Variable slider block in GNURadio

Usage of Variable block
This section illustrates the usage of the variable block.
To do this, firstly open the GRC window. On the main window, there is an option block. This block sets some general parameters for the flow graph. The other block i.e. present is the variable block. It is used to set the sample rate. By default it sets the value of sample rate is 32k.The value can be changed by double click on the variable block. Then close the properties window.
The flow graph of the usage of variable block is shown as:
* Open the sources category and double click on the Signal Source. The Signal Source block will appear in the main window. Double click on the block and the properties window will open. Adjust the settings as:
center
Here, the output type is float. The output type can be changed according to the requirements. The sinusoidal waveform has chosen. The parameter of the frequency is set to 'f1'.
* In this flow graph, the variable block is used. Insert the Variable block from the blocks category. To use the variable simply write the block id into the parameter of another block. Here in the graph, the first variable block id sets to 'f1' and the value sets to 650.To uses this variable write the id:'f1' into the frequency of the first Signal Source block. It sets the value of frequency: 650.
* Take another Signal Source block in the same way as discussed above. Adjust the settings as:
center
The output type is float. The cosine waveform has choosen.The parameter of the frequency is set to 'f2'.
* Now, insert another Variable block and sets its id property to 'f2' and value: 600.To uses this variable, simply write its id: 'f2' into the frequency of the second one. It sets its value as 600.
* A warning in the message window has noticed that the flow graph may not have flow control. Add a Throttle block from the Misc blocks into the flow graph to avoid CPU congestion. Then modify its properties and set its type to float.
* Open the Graphical sinks category and double click on scope sink. The scope sink will appear in the main window. Double click on the block and change its Type to float.
The output of the flow graph is shown as:
Usage of Variable Slider Block
This section illustrates the usage of Variable Slider Block
To do this open the GRC window and creates the flow graph as:
* Open the sources category and double click on the Signal Source. The Signal Source block will appear in the main window. Double click on the block and the properties window will open. Adjust the settings as shown in figure below:
center
* Now take the Signal Source block and modifies the properties of the block as shown below:
center
* Insert a Variable Slider block (from the Variables Category) and modify its properties as shown below:
center
The id of this slider block is written into the parameter of the first Signal Source block. It sets the frequency value to 150.To use the Variable slider block the frequency can be changed during the execution of the graph. The ranges vary between 100 to 1000.
* Now add another Variable Slider block for the other Signal Source blocks and modifies its properties as shown below:
center
The id of this slider block is written into the parameter of the second Signal Source block. It sets the frequency value to 200.The frequency can be changed during the execution of the flow graph and it ranges varies between 100 to 1000.
* Add a Throttle block from the Misc blocks into the flow graph to avoid CPU congestion. Then modify its properties and set its type to float.
* Open the Graphical sinks category and double click on scope sink. The scope sink will appear in the main window. Modify the properties of the scope sink and change its Type to float.
The output of this graph is shown as:
 
< Prev   Next >