Forum: GNU Radio Problem with FFT of simple signal

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Emil M. (Guest)
on 2009-01-30 18:04
(Received via mailing list)
Im learning about gnuradio for my final thesis (quite common i see) and
wanted to show a simple FFT of a simple signal (or noise) but the only
i get the GUI working for is audio input from the microphone. Running it
with a generated signal causes the program to freeze.
Here is my code: (ive commented out the non working parts)

#!/usr/bin/env python

from gnuradio import gr,gru
from gnuradio import audio
from gnuradio.wxgui import stdgui2, fftsink2
import wx
import sys

class app_top_block(stdgui2.std_top_block):
    def __init__(self,frame,panel,vbox,argv):
        stdgui2.std_top_block.__init__(self, frame, panel, vbox, argv)
        self.frame = frame
        self.panel = panel
        self.vbox = vbox

        #self.soundsrc =
#NOTE:Doesnt Work
        self.soundsrc = audio.source(sample_rate,"")    #Works
        #self.soundsrc = gr.noise_source_f(gr.GR_UNIFORM,0.1)    #Doesnt

        self.scope = fftsink2.fft_sink_f(panel, fft_size=1024,
sample_rate=sample_rate, fft_rate=30,ref_scale=1.0, ref_level=0,
        vbox.Add(, 10, wx.EXPAND)

if __name__ == "__main__":
    app = stdgui2.stdapp(app_top_block,"Tone FFT",nstatus=1)
Firas A. (Guest)
on 2009-01-30 19:13
(Received via mailing list)

> On Fri, 1/30/09, Emil M. <removed_email_address@domain.invalid> wrote:
> Running it with a generated signal causes the program to freeze.

This is normal since there is no sampling rate control in your code and
your CPU will be eaten. To overcome this problem use gr.throttle API in
you code.

Best Regards,

This topic is locked and can not be replied to.