Problems with scopesink

Hi everyone!
I am new to gnuradio (I’ m working with it for my thesis) and I have
some
problems with gr.sig_source_c + scopesink.
I would like to plot the generated complex source (real and imaginary
part)
in scopesink2.scope_sink_f but it doesn’t work if I don’t add a second
sink
(audio.sink) which I don’t really need.


src0 = gr.sig_source_c (sampling_freq, gr.GR_SIN_WAVE, frequency, ampl)
dst = audio.sink(sampling_freq)

class demo_graph(stdgui2.std_top_block):

def __init__(self, frame, panel, vbox, argv):
    stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
    real = gr.complex_to_real()
    compl = gr.complex_to_imag()
    scope = scopesink2.scope_sink_f(panel,"Input -> USRP",

sampling_freq, num_inputs=2 )
vbox.Add(scope.win,1,wx.EXPAND)
self.connect(src0, real)
self.connect(src0, compl)
self.connect(real, (scope,0))
self.connect(compl, (scope,1))
self.connect(real, (dst,0))

This is the working code but if I comment the last line the scopesink
seems
“freezed” and I can’ t even close it.
What’s wrong with my code?
Can I use scope_sink_c instead of scope_sink_f? How?

Thanks in advance
Chiara

This is the working code but if I comment the last line the scopesink seems
“freezed” and I can’ t even close it.

Chiara,

The audio sink effectively throttles your data streams to the
“sampling_freq”. When you remove the audio sink, the computer has no
limitation on the rate at which it streams data from block to block…
the CPU usage jumps to 100% and the gui struggles to respond to user
input (hence the freezing).

Place a “gr.throttle(gr.sizeof_gr_complex, sampling_rate)” block right
after the “gr.sig_source_c” to artificially throttle the data stream.

What’s wrong with my code?
Can I use scope_sink_c instead of scope_sink_f? How?

Change the scope to:

scope = scopesink2.scope_sink_c(panel,“Input -> USRP”, sampling_freq,
num_inputs=1)
self.connect(src0, scope)

-Josh

Thanks!
Now everything works
Chiara

2008/5/14 Josh B. [email protected]: