[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] Questions on toy problems
From: |
Achilleas Anastasopoulos |
Subject: |
[Discuss-gnuradio] Questions on toy problems |
Date: |
Wed, 22 Dec 2004 18:04:42 -0500 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) |
Hi everybody,
I finally got my gnuradio software working (with a Fedore 2 core)
and now I have started playing with some simple examples.
I do not have a real card yet, so I mostly desgin signal processing
blocks and connect them together to experiment with the software
and do some audio stuff...
Below are a couple of questions that I have not been able to resolve.
Thanks
Achilleas
1) What is the difference between building a graph containing, say,
a transmitter and a receiver block (connected together) and then
running the whole graph,
versus
writting two separate programs, one for Tx and one for Rx and
connecting them through a unix pipe, eg, tx | rx.
I thought I saw somewhere in the documentation that this is doable too.
Is there an advantage of one versus the other method?
2) How can I ensure that a signal generator does not run forever, but
only for a specified time and/or number of samples?
And finally,
3) I am trying to build a toy application where I open 2
fft windows to watch tow differnt signals in the same graph.
I tried 2 versions and neither works as expected. Any
suggestions? (I am a really newby to python...)
Version A
=====================================
#!/usr/bin/env python
from gnuradio import gr
from gnuradio.wxgui import stdgui
from gnuradio.wxgui import fftsink
import wx
class test_app_flow_graph (stdgui.gui_flow_graph):
def __init__(self, frame, panel, vbox, argv):
stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
input_rate = 8.00e3
f1 = 1.00e3
f2 = 1.00e3
src1 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, f1, 10e3)
src2 = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, f2, 10e3)
block1, fft_win1 = fftsink.make_fft_sink_c (self, panel,
"FFT1", 128,
input_rate)
block2, fft_win2 = fftsink.make_fft_sink_c (self, panel,
"FFT2", 128,
input_rate)
self.connect (src1, block1)
self.connect (src2, block2)
vbox.Add (fft_win1, 1, wx.EXPAND)
vbox.Add (fft_win2, 1, wx.EXPAND)
def main ():
app = stdgui.stdapp (test_app_flow_graph, "FFT Sink Test App")
app.MainLoop ()
if __name__ == '__main__':
main ()
========================================
Version B
=====================================
#!/usr/bin/env python
from gnuradio import gr
from gnuradio.wxgui import stdgui
from gnuradio.wxgui import fftsink
import wx
class test_app_flow_graph (stdgui.gui_flow_graph):
def __init__(self, frame, panel, vbox, argv):
stdgui.gui_flow_graph.__init__ (self, frame, panel, vbox, argv)
input_rate = 8.00e3
f = 1.00e3
src = gr.sig_source_c (input_rate, gr.GR_SIN_WAVE, f, 10e3)
block, fft_win = fftsink.make_fft_sink_c (self, panel, "FFT1", 128,
input_rate)
self.connect (src, block)
vbox.Add (fft_win, 1, wx.EXPAND)
def main ():
app1 = stdgui.stdapp (test_app_flow_graph, "FFT1 Sink Test App")
app2 = stdgui.stdapp (test_app_flow_graph, "FFT2 Sink Test App")
app1.MainLoop ()
app2.MainLoop ()
if __name__ == '__main__':
main ()
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Discuss-gnuradio] Questions on toy problems,
Achilleas Anastasopoulos <=