Signal Source: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
[[Category:Block Docs]] | [[Category:Block Docs]] | ||
Signal generator | Signal generator: generates a variety of waveforms. | ||
Supports an output of type complex, float, int, and short | Supports an output of type complex, float, int, and short | ||
== Parameters == | |||
<b>(''R''):</b> <span class="plainlinks">[https://wiki.gnuradio.org/index.php/GNURadioCompanion#Variable_Controls ''Run-time adjustable'']</span> | |||
Example Flowgraph | ; Sample Rate (''R'') | ||
: default: samp_rate | |||
; Waveform (''R'') | |||
: options: [Constant, Sine, Cosine, Square, Triangle, Saw Tooth] | |||
: For selection with a variable, the following values should be used: | |||
constant = 100 | |||
sine = 101 | |||
cosine = 102 | |||
square = 103 | |||
triangle = 104 | |||
sawtooth = 105 | |||
; Frequency (''R'') | |||
: frequency of the waveform (default: 1000) | |||
; Amplitude (''R'') | |||
: amplitude of the output (default: 1) | |||
; Offset (''R'') | |||
: offset from zero (default: 0) | |||
; Initial Phase (Radians) (''R'') | |||
: default: 0 | |||
== Messages == | |||
The 'freq' message port has been <code>deprecated in 3.9</code> in favor of the 'cmd' message port. | |||
The 'cmd' message port accepts message [https://wiki.gnuradio.org/index.php/Polymorphic_Types_(PMTs)#Pairs pairs]. | |||
* 'freq' . float value | |||
* 'ampl' . float value | |||
* 'phase' . float value | |||
* 'offset' . float value | |||
== Example Flowgraph == | |||
This flowgraph is for version 3.9+. | |||
[[File:Signal-source-ex.png]] | [[File:Signal-source-ex.png]] | ||
== Example Output == | |||
Types of Waveforms: | Types of Waveforms: | ||
Line 36: | Line 71: | ||
[[File:Signal-source-sawtooth.png|600px]] | [[File:Signal-source-sawtooth.png|600px]] | ||
== Source Files == | |||
; C++ files | |||
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/lib/sig_source_impl.cc] | |||
; Header files | |||
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/lib/sig_source_impl.h] | |||
; Public header files | |||
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/include/gnuradio/analog/sig_source.h Base] | |||
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/include/gnuradio/analog/sig_source_waveform.h Waveforms] | |||
; Block definition | |||
: [https://github.com/gnuradio/gnuradio/blob/master/gr-analog/grc/analog_sig_source_x.block.yml] |
Revision as of 09:14, 8 September 2021
Signal generator: generates a variety of waveforms.
Supports an output of type complex, float, int, and short
Parameters
(R): Run-time adjustable
- Sample Rate (R)
- default: samp_rate
- Waveform (R)
- options: [Constant, Sine, Cosine, Square, Triangle, Saw Tooth]
- For selection with a variable, the following values should be used:
constant = 100 sine = 101 cosine = 102 square = 103 triangle = 104 sawtooth = 105
- Frequency (R)
- frequency of the waveform (default: 1000)
- Amplitude (R)
- amplitude of the output (default: 1)
- Offset (R)
- offset from zero (default: 0)
- Initial Phase (Radians) (R)
- default: 0
Messages
The 'freq' message port has been deprecated in 3.9
in favor of the 'cmd' message port.
The 'cmd' message port accepts message pairs.
- 'freq' . float value
- 'ampl' . float value
- 'phase' . float value
- 'offset' . float value
Example Flowgraph
This flowgraph is for version 3.9+.
Example Output
Types of Waveforms:
Cosine (complex):
Constant:
Square:
Triangle:
Sawtooth:
Source Files
- C++ files
- [1]
- Header files
- [2]
- Block definition
- [3]