GNU Radiuo 数据处理模块

简介:

Signal Sources

Sinusoidal and constant sources

Block:gr.sig_source_X.

gr.sig_source_c [f, i, s]( double sampling_freq,

                                         gr_waveform_t waveform,

                                         double frequency,

                                         double amplitude,

                                         gr_complex [float, integer, short] offset )

X为数据类型。X=c (complex)/f (float)/i (4 byte integer) /s (2 byte short integer)。
offset与信号类型相同,可省。

waveform=gr.GR_CONST_WAVE
                    gr.GR_COS_WAVE
                    gr.GR_SIN_WAVE

gr_waveform_t类型在gr_sig_source_waveform.h中定义。

Noise sources

Block: gr.noise_source_X.

gr.noise_source_c [f, i, s] ( gr_noise_type_t type,
                                                float amplitude,
                                                long seed )

X为信号源数据类型。X=c (complex)/f (float)/i (4 byte integer) /s (2 byte short integer)。

type表示噪声的类型。type=GR_UNIFORM——产生[-amplitude,amplitude]的均匀分布。

                                                 GR_GAUSSIAN——均值0,方差0的高斯噪声。
                                                 GR_LAPLACIAN
                                                 GR_IMPULSE
gr_noise_type_t在gr_noise_type.h中定义。
type=GR_UNIFORM时产生[-amplitude,amplitude]的均匀分布。
Null sources
Block: gr.null_source.

gr.null_source ( size_t sizeof_stream_item )
sizeof_stream_item=gr_complex, float, integer等等。

Vector sources
Block: gr.vector_source_X.

gr.vector_source_c [f, i, s, b] ( const std::vector< gr_complex > & data,
                                                     bool repeat = false )

(gr_complex 处也可以是 float, integer, short, unsigned char)

X为信号源数据类型。可以为 c (complex), f (float),
i (4 byte integer), s (2 byte short integer), or b (1 byte unsigned char)

矢量源从一个向量获得数据, repeat表示向量的数据是否重复发送。

例如:src_data = (-3, 4, -5.5, 2, 3)
            src = gr.vector_source_f (src_data)
File sources
Block: gr.file_source

gr.file_source ( size_t itemsize,

                            const char *filename,
                            bool repeat )
itemsize决定数据流的数据类型。如:gr_complex,float, unsigned char
repeat决定文件中数据是否重复发送。

例如:src = gr.file_source (gr.sizeof_char, "/home/dshen/payload.dat", TRUE)
Audio source
Block: gr.audio_source
gr.audio_source (int sampling_rate)
从线性输入读取数据,sampling_rate表示信源的数据率,为每秒内的点数。
USRP source
Block: usrp.source_c [s]

usrp.source_c (s) (int which_board,
                                  unsigned int decim_rate,
                                  int nchan = 1,
                                  int mux = -1,
                                  int mode = 0 )
c (complex),或s (short)表示从USRP接收的数据类型,c (complex)更常使用。
which_board表示用哪一个USRP,当只有一个USRP,为0.
decim_rate为DDC的抽取率。
nchan 表示信道数,为 1, 2 or 4。

mux设置输入MUX,决定哪个ADC连接哪个DDC,‘-1’表示使用默认。
mode设置 FPGA 模式, 很少用。
通常,只设置前两个参数。

例如:usrp_decim = 250
            src = usrp.source_c (0, usrp_decim)




















                          











































 
目录
相关文章
|
29天前
|
监控 Linux API
实时监控文件系统:探索Python Watchdog库的神奇之处!
实时监控文件系统:探索Python Watchdog库的神奇之处!
|
22天前
|
存储 Unix Shell
【简化Cmake编译过程 】编写通用的bash脚本:简化和构建cmake高效自动化任务
【简化Cmake编译过程 】编写通用的bash脚本:简化和构建cmake高效自动化任务
41 0
|
11月前
|
编解码 Linux uml
ALSA 驱动抽象:ASoc 理解与分析
最近一直在研究 ALSA 驱动,停了一段时间,突然发现Asla 驱动不是一天两天能讲清楚的。
268 0
|
算法 索引
Boost库学习笔记(二)算法模块-C++11标准
Boost库学习笔记(二)算法模块-C++11标准
207 0
|
存储 监控 NoSQL
Python rrdtool 模块数据处理详解
Python rrdtool 模块数据处理详解
Python rrdtool 模块数据处理详解
|
传感器 运维 Unix
【Python 】常用运维模块psutil模块
本篇内容介绍了“怎么用Python实现查询CPU和内存”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让我带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成! 运维最头痛的事情莫过于分配的资源少于需求,会遇到 CPU 负载高、队列堵塞、任务运行时间长、超时以及潜在的崩溃隐患等问题。而分配的资源太多,则造成不必要的资源和财力浪费。
|
机器学习/深度学习 C语言 C++
Python开发基础总结(五)模块+日志+自省
Python开发基础总结(五)模块+日志+自省
|
JavaScript Serverless Linux
移植Python量化交易TA-Lib库到函数计算
TA-Lib全称“技术分析库”,即技术分析库,是Python金融量化的高级库,涵盖了150种多种股票,期货交易软件中常用的技术分析指标,如MACD,RSI,KDJ,动量指标,布林带等等。
535 0
移植Python量化交易TA-Lib库到函数计算
|
Serverless Linux iOS开发
移植 Python 量化交易 TA-Lib 库到函数计算
移植 Python 量化交易 TA-Lib 库到函数计算