Subversion Repositories svnkaklik

Rev

Rev 515 | Blame | Compare with Previous | Last modification | View Log | Download

#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: untitled
# Author: unknown
# Description: gnuradio flow graph
# Generated: Sat Feb 21 13:28:44 2009
##################################################

from gnuradio import audio
from gnuradio import gr
from gnuradio.wxgui import fftsink2
from grc_gnuradio import wxgui as grc_wxgui
import wx

class frequency_response(grc_wxgui.top_block_gui):

        def __init__(self):
                grc_wxgui.top_block_gui.__init__(
                        self,
                        title="GRC - Executing: untitled",
                        icon="/usr/local/share/icons/hicolor/32x32/apps/gnuradio-grc.png",
                )

                ##################################################
                # Variables
                ##################################################
                self.samp_rate = samp_rate = 32000

                ##################################################
                # Blocks
                ##################################################
                self.audio_sink_0 = audio.sink(48000, "hw:1,0", True)
                self.audio_source_0 = audio.source(48000, "hw:1,0", True)
                self.gr_noise_source_x_0 = gr.noise_source_f(gr.GR_UNIFORM, 1, 100)
                self.wxgui_fftsink2_0 = fftsink2.fft_sink_f(
                        self.GetWin(),
                        baseband_freq=0,
                        y_per_div=10,
                        y_divs=8,
                        ref_level=50,
                        sample_rate=96000,
                        fft_size=2048,
                        fft_rate=25,
                        average=True,
                        avg_alpha=None,
                        title="FFT Plot",
                        peak_hold=False,
                )
                self.Add(self.wxgui_fftsink2_0.win)

                ##################################################
                # Connections
                ##################################################
                self.connect((self.gr_noise_source_x_0, 0), (self.audio_sink_0, 0))
                self.connect((self.audio_source_0, 0), (self.wxgui_fftsink2_0, 0))
                self.connect((self.gr_noise_source_x_0, 0), (self.audio_sink_0, 1))

        def set_samp_rate(self, samp_rate):
                self.samp_rate = samp_rate

if __name__ == '__main__':
        if gr.enable_realtime_scheduling() != gr.RT_OK:
                print "Error: failed to enable realtime scheduling."
        tb = frequency_response()
        tb.Run()