LeanSDR:Lightweight, portable software-defined radio

git clone http://github.com/pabr/leansdr.git
cd leansdr/src/apps

LeanSDR在使用过程中需要使用X11图形框架,首次在OSX编译LeanSDR会有报错:

g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leandvb.cc -lX11 -o leandvb  ||  \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leandvb.cc -o leandvb
In file included from leandvb.cc::
../leansdr/gui.h::: fatal error: 'X11/X.h' file not found
#include <X11/X.h>
^
error generated.
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leansdrscan.cc -lX11 -o leansdrscan || \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leansdrscan.cc -o leansdrscan
leansdrscan.cc::: warning: comparison of unsigned expression < is always false [-Wtautological-compare]
if ( nr < ) fatal("read");
~~ ^ ~
warning generated.
ld: library not found for -lX11
clang: error: linker command failed with exit code (use -v to see invocation)
leansdrscan.cc::: warning: comparison of unsigned expression < is always false [-Wtautological-compare]
if ( nr < ) fatal("read");
~~ ^ ~
warning generated.
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leansdrcat.cc -lX11 -o leansdrcat || \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leansdrcat.cc -o leansdrcat
ld: library not found for -lX11
clang: error: linker command failed with exit code (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leantsgen.cc -lX11 -o leantsgen || \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leantsgen.cc -o leantsgen
ld: library not found for -lX11
clang: error: linker command failed with exit code (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leanchansim.cc -lX11 -o leanchansim || \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leanchansim.cc -o leanchansim
ld: library not found for -lX11
clang: error: linker command failed with exit code (use -v to see invocation)
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable -DGUI leandvbtx.cc -lX11 -o leandvbtx || \
g++ -O3 -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable leandvbtx.cc -o leandvbtx
ld: library not found for -lX11
clang: error: linker command failed with exit code (use -v to see invocation)

查找X11目录

sudo find / -name "X.h"
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/X.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h
find: /dev/fd/cn0xroot: No such file or directory
find: /dev/fd/cn0xroot: No such file or directory
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h
/opt/local/include/X11/X.h
/opt/local/share/doc/boost/libs/coroutine/example/cpp03/asymmetric/X.h
/opt/metasploit-framework/embedded/include/X11/X.h
/opt/X11/include/X11/X.h
/System/Library/Frameworks/Tk.framework/Versions/8.4/Headers/X11/X.h
/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11/X.h

解决方案:修改Makefile

APPS = leandvb leansdrscan
APPS += leansdrcat leantsgen leanchansim leandvbtx all: $(APPS) clean:
rm -f $(APPS) DEPS = ../leansdr/*.h CXXFLAGS = -O3 -I.. -I/opt/X11/include -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable %: %.cc $(DEPS)
g++ $(CXXFLAGS) -DGUI $< -lX11 -L/opt/X11/lib -o $@ || \
g++ $(CXXFLAGS) $< -o $@ EMBED_FLAGS= -I.. -Wall -Wno-sign-compare -Wno-array-bounds -Wno-unused-variable \
-Ofast -mfpu=neon -funsafe-math-optimizations -fsingle-precision-constant leandvb.embedded: leandvb.cc $(DEPS)
g++ $(CXXFLAGS) $(EMBED_FLAGS) $< -static -o $@ || \
g++ $(CXXFLAGS) $(EMBED_FLAGS) $< -o $@
make

Usage

leandvb --help
Usage: leandvb [options] < IQ > TS
Demodulate DVB-S I/Q on stdin, output MPEG packets on stdout Input options:
--u8 Input format is -bit unsigned (rtl_sdr, default)
--f32 Input format is -bit float (gqrx)
-f HZ Input sample rate (default: 2.4e6)
--loop Repeat (stdin must be a file)
--inbuf N Additional input buffering (samples) Preprocessing options:
--anf N Number of birdies to remove (default: )
--derotate HZ For use with --fd-pp, otherwise use --tune
--resample Resample baseband (CPU-intensive)
--resample-rej K Aliasing rejection (default: )
--decim N Decimate baseband (causes aliasing)
--cnr Measure CNR (requires samplerate>*symbolrate)
--fd-pp NUM Dump preprocessed IQ data to file descriptor DVB-S options:
--sr HZ Symbol rate (default: 2e6)
--tune HZ Bias frequency for demodulation
--drift Track frequency drift beyond safe limits
--standard S DVB-S (default), DVB-S2 (not implemented)
--const C QPSK (default), BPSK .. 32APSK (DVB-S2 only)
--cr N/D Code rate / (default) .. / .. /
--fastlock Synchronize more aggressively (CPU-intensive)
--sampler nearest, linear, rrc
--rrc-steps N RRC interpolation factor
--rrc-rej K RRC filter rejection (defaut:)
--roll-off A RRC roll-off (default: 0.35)
--viterbi Use Viterbi (CPU-intensive)
--hard-metric Use Hamming distances with Viterbi Compatibility options:
--hdlc Expect HDLC frames instead of MPEG packets
--packetized Output -bit length prefix (default: as stream) General options:
--buf-factor Buffer size factor (default:)
--hq Maximize sensitivity
(Enables all CPU-intensive features)
--hs Maximize throughput (QPSK CR1/ only)
(Disables all preprocessing) UI options:
-h Display this help message and exit
-v Output debugging info at startup and exit
-d Output debugging info during operation
--fd-info NUM Output demodulator status to file descriptor
--fd-const NUM Output constellation and symbols to file descr
--gui Show constellation and spectrum (X11)
--duration S Width of timeline plot (default: )
--linger Keep GUI running after EOF Testing options:
--awgn STDDEV Add white gaussian noise (slow)
eanchansim --help
Usage: leanchansim [options] < IQ.in > IQ.out
Simulate an imperfect communication channel. Input options:
--iu8 Interpret stdin as complex unsigned char
--if32 Interpret stdin as complex float
-f Hz Specify sample rate
--loop Repeat (stdin must be a file) Gain options:
--scale FACTOR Multiply by constant Drift options:
--lo HZ Specify nominal LO frequency
--ppm PPM Specify LO accuracy
--drift-period S Drift +-ppm every S seconds
--drift-rate R Drift with maximum rate R (Hz/s)
--drift2-amp HZ Add secondary drift (range in Hz)
--drift2-freq HZ Add secondary drift (rate in Hz) Noise options:
--awgn STDDEV Add white gaussian noise (dB) Output options:
--ou8 Output as complex unsigned char
--of32 Output as complex float
leandvbtx --help
Usage: leandvbtx [options] < TS > IQ
Modulate MPEG packets into a DVB-S baseband signal
Output float complex samples Options: -f INTERP[/DECIM] Samples per symbols (default: )
--roll-off R RRC roll-off (defalt: 0.35)
--power P Output power (dB)
--agc Better regulation of output power
-v Verbose output
leansdrcat --help
Usage: leansdrcat [options]
Forward from stdin to stdout at constant rate. Options:
--block Pause when stdout is busy (default: '#' on stderr)
--nonblock Silently ignore when stdout is busy
--cbr R Set rate in bits per second
--cbr8 R Set rate in bytes per second
--cbr16 R Set rate in -bit words per second
--cbr32 R Set rate in -bit words per second
--cbr64 R Set rate in -bit words per second
-h Display this help message and exit
leansdrscan --help
Usage: leansdrscan [options] [program settings]
Run , cycling through combinations of settings.
Example: 'leansdrscan -v cat -n,-e' will feed stdin through 'cat -n' and 'cat -e' alternatively. Options:
-h Print this message
-v Verbose
--timeout N Next settings if no output within N seconds
--rewind Rewind input (stdin must be a file)
--probesize N Forward only N bytes (with --rewind)
leantsgen --help
Usage: leantsgen [-c PACKETCOUNT]
Output numbered MPEG TS packets on stdout.

Example

rtl_sdr -g  -f 315e6 -s  /tmp/test.ts
leandvb --gui -v -d -f 1000e3 --sr 500e3 --cr / --derotate - --anf < /tmp/test.ts > mpeg.ts

https://www.rtl-sdr.com/transmitting-dvb-s-with-a-plutosdr-and-receiving-it-with-an-rtl-sdr/

http://www.pabr.org/radio/leandvb/leandvb.en.html

Mac OSX 编译 LeanSDR的更多相关文章

  1. Windows、Linux、Mac OSX编译jni动态库

    在不同平台下默认调用不同名字的动态库,在Windows平台调用name.dll,在Linux平台调用libname.so,在OSX下调用libname.jnilib.不同平台下的编译的方法也有些区别. ...

  2. Mac OSX编译安装php5.6

    安装好OSX 10.13以后默认自带的php7.1.7,跟现有环境不兼容,所以准备编译安装php5.6,自带的php7不建议卸载,重新安装一份php5.6 1.安装php的一些依赖,推荐使用brew安 ...

  3. Mac OSX编译安装php7.1.8

    laravel中用到ldap认证包,要求php7.0以上版本,而且安装Mews\Captcha包的时候 验证码无法显示 报错如下: Call to undefined function Interve ...

  4. mac osx 上面部署Django项目 apache+mysql+mod_wsgi

    1.安装Xcode command line tools 首先,编译mysql和Homebrew需要用到Xcode command line tools,所以首先安装command line tool ...

  5. 2016-1-1最新版本的linphone-android在mac上编译通过,同时建立了IDEA工程

    虽然参考了这个文章<MAC OS编译Android版Linphone SDK和APP>,https://www.lidaren.com/archives/1592 ,但是在实际的编译过程中 ...

  6. Mac Pro 编译安装 PHP 5.6.21 及 问题汇总

    [系统环境] 操作系统:OS X 10.11.5 Xcode:7.3.1 [注意] 编译之前,需要安装 xcode.Homebrew 套件! Mac Pro 安装 Homebrew 软件包管理工具 1 ...

  7. 在Mac OSX 10.10 上安装opencv

    http://blog.csdn.net/wdkirchhoff/article/details/41910553 在Mac OSX上如果想使用OpenCV,可以通过自己手动编译源码的方式,但比较繁琐 ...

  8. [图文详解] Sublime Text在Windows/Ubuntu/Mac OSX中配置使用CTags

    很开发者都在找Sublime Text中函数转跳的功能,这个是软件自身没有的功能,要靠CTags这个插件配合CTags的可执行程序的实现的.按照我的理解是CTags扫描索引你的项目文件,然后subli ...

  9. 如何在Mac OSX上安装xgboost

    听说xgboost效果很不错,于是准备学习下,但是发现大多数资料都是在讲如何在windows或linux下安装xgboost,而且照着官方文档也没有正确的安装好多线程的xgboost.最后还是从the ...

随机推荐

  1. spring boot2 kafka

    一.软件版本 1.linux:centos6 2.zookeeper:zookeeper-3.4.1 3.kafka:kafka_2.12-2.2.0 4.jdk:1.8 5.instelliJ Id ...

  2. xaf 如何添加logo信息

    https://documentation.devexpress.com/eXpressAppFramework/113156/Task-Based-Help/Miscellaneous-UI-Cus ...

  3. Petrozavodsk Winter Camp, Day 8, 2014, Fine Brochures

    1的个数-块的个数+多减的个数+flag 多减的只会在一个循环末尾出现 #include <bits/stdc++.h> using namespace std; #define rep( ...

  4. selenium chromedriver geckodriver iedriverserver下载

    chromedriver与chrome的的对应版整理: chromedriver版本 chrome版本 v2.9 v31-v34 v2.10 v33-v36 v2.11 v36-v40 v2.12 v ...

  5. windows/linux VPS云服务器限制IP访问,限制别人的IP访问网站方法

    服务器VPS云服务器如何限制IP访问,限制别人的IP访问网站的方法 windows主机IIS限制IP访问方法:首先打开IIS点击“网站”,右键属性,(如果仅给单个网站设置,请选择下边的站点,点右键“属 ...

  6. C语言博客作业04——数组

    1.本章学习总结 1.1思维导图 1.2本章学习体会及代码量 1.2.1学习体会 这几周学习了数组,数组分为三大块:一维数组.二维数组和字符数组.数组相对于之前普通变量的好处就是可以储存数值,方便数据 ...

  7. RSA加密、解密、签名、验签的原理及方法

    一.RSA加密简介 RSA加密是一种非对称加密.可以在不直接传递密钥的情况下,完成解密.这能够确保信息的安全性,避免了直接传递密钥所造成的被破解的风险.是由一对密钥来进行加解密的过程,分别称为公钥和私 ...

  8. 笔记《JavaScript 权威指南》(第6版) 分条知识点概要3—表达式和运算符

    [表达式和运算符]原始表达式,初始化表达式(对象和数组的),函数定义表达式,属性访问表达式,调用表达式,对象创建表达式,运算符概述,算术表达式,关系表达式,逻辑表达式,赋值表达式,表达式计算,其他运算 ...

  9. 启用hyper-v后无法卸载vmware

    机器上启用了hyper-v,想卸载vmware,报错了: Error: This product may not be installed on a computer that has Microso ...

  10. Linux Shell函数定义与调用

    一.Shell函数定义格式 shell函数定义格式,各部分说明如下: [ function ]等中括号括起来部分----表示可选(即可有可无) your_function_name部分----为函数名 ...