Adding Signals
Modules:
- add_cc()
- add_ff()
- add_ii()
- add_ss()
for complex, float, integer and short.
Example usage:
adder19 = add_ff()
instantiates a floating point adder.
Example:
sampling_freq = 8e6
fg = gr.flow_graph ()
src0 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 1e6, 1, 0)
src1 = gr.sig_source_f (sampling_freq, gr.GR_SIN_WAVE, 800e3, .9, 0)
adder = gr.add_ff ()
dst = gr.file_sink (gr.sizeof_float, "test_output")
fg.connect ( src0, (adder, 0) )
fg.connect ( src1, (adder, 1) )
fg.connect ( adder, dst )
This creates two signals at 8Mhz sampling rate, one is 1Mhz and the other
is 800Khz, then adds the two and writes the result to a file called
"test_output". Note the use of two different ports, 0 and 1 for the adder
inputs. The resultant signal is: