text: #!/usr/bin/env python2
  # -*- coding: utf-8 -*-
  ##################################################
  # GNU Radio Python Flow Graph
  # Title: Complex multiplication
  # Author: Alexandros-Apostolos A. Boulogeorgos
  # Description: A simple example of multiplication of two sinusoids signals.
  # Generated: Mon Aug  5 17:05:49 2019
  ##################################################
  
  if __name__ == '__main__':
      import ctypes
      import sys
      if sys.platform.startswith('linux'):
          try:
              x11 = ctypes.cdll.LoadLibrary('libX11.so')
              x11.XInitThreads()
          except:
              print "Warning: failed to XInitThreads()"
  
  from gnuradio import analog
  from gnuradio import blocks
  from gnuradio import eng_notation
  from gnuradio import gr
  from gnuradio import wxgui
  from gnuradio.eng_option import eng_option
  from gnuradio.fft import window
  from gnuradio.filter import firdes
  from gnuradio.wxgui import fftsink2
  from grc_gnuradio import wxgui as grc_wxgui
  from optparse import OptionParser
  import wx
  
  
  class ssb_rx_step2(grc_wxgui.top_block_gui):
  
      def __init__(self):
          grc_wxgui.top_block_gui.__init__(self, title="Complex multiplication")
  
          ##################################################
          # Variables
          ##################################################
          self.samp_rate = samp_rate = 32000
          self.offset = offset = 0
          self.f2 = f2 = 1000
          self.f1 = f1 = 10000
          self.amp = amp = 1
  
          ##################################################
          # Blocks
          ##################################################
          self.wxgui_fftsink2_0 = fftsink2.fft_sink_c(
          	self.GetWin(),
          	baseband_freq=0,
          	y_per_div=10,
          	y_divs=10,
          	ref_level=0,
          	ref_scale=2.0,
          	sample_rate=samp_rate,
          	fft_size=1024,
          	fft_rate=15,
          	average=False,
          	avg_alpha=None,
          	title='FFT Plot',
          	peak_hold=False,
          )
          self.Add(self.wxgui_fftsink2_0.win)
          self.blocks_throttle_0 = blocks.throttle(gr.sizeof_gr_complex*1, samp_rate,True)
          self.blocks_multiply_xx_0 = blocks.multiply_vcc(1)
          self.analog_sig_source_x_0_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, f2, amp, offset)
          self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, f1, amp, offset)
  
          ##################################################
          # Connections
          ##################################################
          self.connect((self.analog_sig_source_x_0, 0), (self.blocks_multiply_xx_0, 0))    
          self.connect((self.analog_sig_source_x_0_0, 0), (self.blocks_multiply_xx_0, 1))    
          self.connect((self.blocks_multiply_xx_0, 0), (self.blocks_throttle_0, 0))    
          self.connect((self.blocks_throttle_0, 0), (self.wxgui_fftsink2_0, 0))    
  
      def get_samp_rate(self):
          return self.samp_rate
  
      def set_samp_rate(self, samp_rate):
          self.samp_rate = samp_rate
          self.wxgui_fftsink2_0.set_sample_rate(self.samp_rate)
          self.blocks_throttle_0.set_sample_rate(self.samp_rate)
          self.analog_sig_source_x_0_0.set_sampling_freq(self.samp_rate)
          self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
  
      def get_offset(self):
          return self.offset
  
      def set_offset(self, offset):
          self.offset = offset
          self.analog_sig_source_x_0_0.set_offset(self.offset)
          self.analog_sig_source_x_0.set_offset(self.offset)
  
      def get_f2(self):
          return self.f2
  
      def set_f2(self, f2):
          self.f2 = f2
          self.analog_sig_source_x_0_0.set_frequency(self.f2)
  
      def get_f1(self):
          return self.f1
  
      def set_f1(self, f1):
          self.f1 = f1
          self.analog_sig_source_x_0.set_frequency(self.f1)
  
      def get_amp(self):
          return self.amp
  
      def set_amp(self, amp):
          self.amp = amp
          self.analog_sig_source_x_0_0.set_amplitude(self.amp)
          self.analog_sig_source_x_0.set_amplitude(self.amp)
  
  
  def main(top_block_cls=ssb_rx_step2, options=None):
  
      tb = top_block_cls()
      tb.Start(True)
      tb.Wait()
  
  
  if __name__ == '__main__':
      main()
  