Signal Source: Difference between revisions

From GNU Radio
Jump to navigation Jump to search
Line 9: Line 9:
; Sample Rate (''R'')
; Sample Rate (''R'')
: Default value: samp_rate
: Default value: samp_rate
: Sample rate (fs) is the average number of samples obtained in one secondIts units are samples per second or hertz e.g. 48,000 sample rate is 48 kHz.
: Sample rate (fs) is the average number of samples obtained in one second. Its units are samples per second or hertz e.g. 48,000 sample rate is 48 kHz.


; Waveform (''R'')
; Waveform (''R'')
: options: [Constant, Sine, Cosine, Square, Triangle, Saw Tooth]
: options: [Constant, Sine, Cosine, Square, Triangle, Saw Tooth]
: For selection with a variable, the following values should be used:
: For selection with a variable, the following values should be used:
    constant = 100
  * Constant = 100
    sine = 101
  * Sine = 101
    cosine = 102
  * Cosine = 102
    square = 103
  * Square = 103
    triangle = 104
  * Triangle = 104
    sawtooth = 105
  * Sawtooth = 105


; Frequency (''R'')
; Frequency (''R'')
: frequency of the waveform (default: 1000)
: Frequency of the waveform (default: 1000)


; Amplitude (''R'')
; Amplitude (''R'')
: amplitude of the output (default: 1)
: Amplitude of the output (default: 1)


; Offset (''R'')
; Offset (''R'')
: offset from zero (default: 0)
: Offset from zero (default: 0)


; Initial Phase (Radians) (''R'')
; Initial Phase (Radians) (''R'')
: default: 0
: Default: 0


== Messages ==
== Messages ==

Revision as of 04:43, 29 December 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 value: samp_rate
Sample rate (fs) is the average number of samples obtained in one second. Its units are samples per second or hertz e.g. 48,000 sample rate is 48 kHz.
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+.

Signal-source-ex.png

Example Output

Types of Waveforms:

Cosine (complex):

Signal-source-cosine.png

Constant:

Signal-source-constant.png

Square:

Signal-source-square.png

Triangle:

Signal-source-triangle.png

Sawtooth:

Signal-source-sawtooth.png

Source Files

C++ files
[1]
Header files
[2]
Public header files
Base
Waveforms
Block definition
[3]