论坛风格切换切换到宽版
  • 2667阅读
  • 4回复

大家在google中输入gnuradio [复制链接]

上一主题 下一主题
离线jxj
 
发帖
153
只看楼主 倒序阅读 0楼 发表于: 2006-11-25
投入无线通信这个专业也算n年了。

其实一直在想,就像盖茨和乔布斯把计算机解放到人们手中,就像gnu
把操作系统软件解放到人们手中,下一个解放到人们手中的应该是自由
通信的权利,因为数字化的通信技术发展到现在,有了计算机和软件
基本上就能处理通信中的大多数问题了,而计算机和软件到现在已经基
本上free了。

当然,我一直以来也只是yy而已,有时候也会yy的比较具体,也一时
兴起的去搜索过大量的a/d,d/a,dsp,fpga,ddc,duc等片子,构想自己的
软件无线电平台,而后剩下的一切就只是coding。可实际上,这些年来
投入精力最大的还是在那一纸文凭和一个户口本上,题外btw的问一下:
我们何时才能真的做自己喜欢的事情,抑或真的有勇气做自己喜欢的事情。

也不断的在网络上注意过有没有想法类似的组织。openhardware主要关
注的还是计算机硬件,一直没有关于无线硬件方面的东西。直到今天又
一时兴起搜索到了这个gnuradio!

关于gnuradio目前都做了什么工作,发展到了什么程度,大家自己去看吧。
我觉得这也许这是每个通信领域的工程师在业余时间可以为“自由”社区
作出professional贡献的机会,而不仅仅局限于那些学计算机和软件出身
的人。

不知道有生之年,能否看到“运营商”这个词从字典里消失,我们的通信
直接依赖于大量低成本的硬件和free的软件来“自组织”。
离线BG6AGB
发帖
915
只看该作者 1楼 发表于: 2006-11-25
a complete fm receiver

example 2 shows a somewhat simplified but complete broadcast fm receiver. it includes control of the rf front end and all required signal processing. this example uses an rf front end built from a cable modem tuner and a 20m sample/sec analog-to-digital converter.
  1. example 2. broadcast fm receiver
  2. #!/usr/bin/env python
  3. from gnuradio import gr
  4. from gnuradio import audio
  5. from gnuradio import mc4020
  6. import sys
  7. def high_speed_adc (fg, input_rate):
  8.   # return gr.file_source (gr.sizeof_short, "dummy.dat", false)
  9.   return mc4020.source (input_rate, mc4020.mcc_ch3_en | mc4020.mcc_all_1v)
  10. #
  11. # return a gr.flow_graph
  12. #
  13. def build_graph (freq1, freq2):
  14.   input_rate = 20e6
  15.   cfir_decimation = 125
  16.   audio_decimation = 5
  17.   quad_rate = input_rate / cfir_decimation
  18.   audio_rate = quad_rate / audio_decimation
  19.   fg = gr.flow_graph ()
  20.  
  21.   # use high speed adc as input source
  22.   src = high_speed_adc (fg, input_rate)
  23.  
  24.   # compute fir filter taps for channel selection
  25.   channel_coeffs = \
  26.     gr.firdes.low_pass (1.0,       # gain
  27.                 input_rate,   # sampling rate
  28.                 250e3,     # low pass cutoff freq
  29.                 8*100e3,     # width of trans. band
  30.                 gr.firdes.win_hamming)
  31.   # input: short; output: complex
  32.   chan_filter1 = \
  33.     gr.freq_xlating_fir_filter_scf (cfir_decimation,
  34.                         channel_coeffs,
  35.                         freq1,     # 1st station freq
  36.                         input_rate)
  37.  
  38.   (head1, tail1) = build_pipeline (fg, quad_rate, audio_decimation)
  39.  
  40.   # sound card as final sink
  41.   audio_sink = audio.sink (int (audio_rate))
  42.   # now wire it all together
  43.   fg.connect (src, chan_filter1)
  44.   fg.connect (chan_filter1, head1)
  45.   fg.connect (tail1, (audio_sink, 0))
  46.   return fg
  47. def build_pipeline (fg, quad_rate, audio_decimation):
  48.   '''given a flow_graph, fg, construct a pipeline
  49.   for demodulating a broadcast fm signal. the
  50.   input is the downconverted complex baseband
  51.   signal. the output is the demodulated audio.
  52.   build_pipeline returns a two element tuple
  53.   containing the input and output endpoints.
  54.   '''
  55.   fm_demod_gain = 2200.0/32768.0
  56.   audio_rate = quad_rate / audio_decimation
  57.   volume = 1.0
  58.   # input: complex; output: float
  59.   fm_demod = gr.quadrature_demod_cf (volume*fm_demod_gain)
  60.   # compute fir filter taps for audio filter
  61.   width_of_transition_band = audio_rate / 32
  62.   audio_coeffs = gr.firdes.low_pass (1.0,         # gain
  63.                           quad_rate,     # sampling rate
  64.                           audio_rate/2 - width_of_transition_band,
  65.                           width_of_transition_band,
  66.                           gr.firdes.win_hamming)
  67.   # input: float; output: float
  68.   audio_filter = gr.fir_filter_fff (audio_decimation, audio_coeffs)
  69.   fg.connect (fm_demod, audio_filter)
  70.   return ((fm_demod, 0), (audio_filter, 0))
  71.  
  72. def main (args):
  73.   nargs = len (args)
  74.   if nargs == 1:
  75.     # get station frequency from command line
  76.     freq1 = float (args[0]) * 1e6
  77.   else:
  78.     sys.stderr.write ('usage: fm_demod freq\n')
  79.     sys.exit (1)
  80.   # connect to rf front end
  81.   rf_front_end = gr.microtune_4937_eval_board ()
  82.   if not rf_front_end.board_present_p ():
  83.     raise ioerror, 'rf front end not found'
  84.   # set front end gain
  85.   rf_front_end.set_agc (300)
  86.   # determine the front end's "intermediate frequency"
  87.   if_freq = rf_front_end.get_output_freq () # 5.75e6
  88.   # tell the front end to tune to freq1.
  89.   # i.e., freq1 is translated down to the if frequency
  90.   rf_front_end.set_rf_freq (freq1)
  91.   # build the flow graph
  92.   fg = build_graph (if_freq, none)
  93.  
  94.   fg.start ()     # fork thread(s) and return
  95.   raw_input ('press enter to quit: ')
  96.   fg.stop ()
  97. if __name__ == '__main__':
  98.   main (sys.argv[1:])

like the hello world example, we build a graph, connect the blocks together and start it. in this case, our source, mc4020.source, is an interface to the measurement computing pci-das 4020/12 high-speed adc. we follow it with gr.freq_xlating_fir_filter_scf, a finite impulse response (fir) filter that selects the fm station we're looking for and translates it to baseband (0hz, dc). with the 20m sample/sec converter and cable modem tuner, we're really grabbing something in the neighborhood of a 6 mhz chunk of the spectrum. this single chunk may contain ten or more fm stations, and gr.freq_xlating_fir_filter_scf allows us to select the one we want.

in this case, we select the one at the exact center of the if of the rf front end (5.75 mhz). the output of gr.freq_xlating_fir_filter_scf is a stream of complex samples at 160,000 samples/second. we feed the complex baseband signal into gr.quadrature_demod_cf, the block that does the actual fm demodulation.

gr.quadrature_demod_cf works by subtracting the angle of each adjacent complex sample, effectively differentiating the frequency. the output of gr.quadrature_demod_cf contains the left-plus-right fm mono audio signal, the stereo pilot tone at 19khz, the left-minus-right stereo information centered at 38khz and any other sub-carriers above that. for this simplified receiver, we finish off by low pass filtering and decimating the stream, keeping only the left-plus-right audio information, and send that to the sound card at 32,000 samples/sec.

for a more indepth look at how the fm receiver works, please see "listening to fm, step by step."
离线BG6AGB
发帖
915
只看该作者 2楼 发表于: 2006-11-25
hardware requirements

gnu radio is reasonably hardware-independent. today's commodity multi-gigahertz, super-scalar cpus with single-cycle floating-point units mean that serious digital signal processing is possible on the desktop. a 3 ghz pentium or athlon can evaluate 3 billion floating-point fir taps/s. we now can build, virtually all in software, communication systems unthinkable only a few years ago.

your computational requirements depend on what you're trying to do, but generally speaking, a 1 or 2 ghz machine with at least 256 mb of ram should suffice. you also need some way to connect the analog world to your computer. low-cost options include built-in sound cards and audiophile quality 96 khz, 24-bit, add-in cards. with either of these options, you are limited to processing relatively narrow band signals and need to use some kind of narrow-band rf front end.

another possible solution is an off-the-shelf, high-speed pci analog-to-digital board. these are available in the 20m sample/sec range, but they are expensive, about the cost of a complete pc. for these high-speed boards, cable modem tuners make reasonable rf front ends.

finding none of these alternatives completely satisfactory, we designed the universal software radio peripheral, or usrp for short.
离线BG9DC
发帖
433
只看该作者 3楼 发表于: 2006-11-25
这好比是说青菜萝卜照样可以填饱肚子,只有常吃鱼翅的人,才可以说,"那和粉丝差不多",玩玩而已.
离线jxj
发帖
153
只看该作者 4楼 发表于: 2006-11-25