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. JVM垃圾回收(四)- GC算法:实现(1)

    GC算法:实现 上面我们介绍了GC算法中的核心概念,接下来我们看一下JVM里的具体实现.首先必须了解的一个重要的事实是:对于大部分的JVM来说,两种不同的GC算法是必须的,一个是清理Young Gen ...

  2. 弹筐里同一个按钮判断是从哪里点击过来的form

    点击弹框按钮 <form action="javascript:;" method="post">         <button type= ...

  3. mysql 查询正在执行的进程-亲试ok

    命令:show processlist 每一列的含义和用途: 第一列 id,不用说了吧,一个标识,你要kill一个语句的时候很有用. 第二列 user列,显示单前用户,如果不是root,这个命令就只显 ...

  4. .NET 控件的认识。

    四单元的题目里面,涉及了很多之前没有用过的控件的使用,前12道题都不是很难,所以很快做完了 ,但是后面的因为timer控件找不到,有些操作无法实现,所以就没做,但是也是认真的看了的. 等什么时候把ti ...

  5. java打jar包小总结

    一 命令行方法 编译java 在bin目录下,也就是class所在目录下命令行输入如下命令进行归档处理 jar -cvf mylib.jar *.class 现在你可以看见一个已经生成的jar包了 此 ...

  6. 正向代理 vs 反向代理

    正向代理: 内网客户端访问外网服务器的中介 反向代理: 外网客户端访问内网服务器的中介 正向代理: 代理访问外部资源 正向代理的用途: 1. 访问原来无法访问的资源 , 如googl 2. 可以做缓存 ...

  7. 本地搭建Apache Tomcat服务器

    首先说下Apache和Tomcat的区别: 相同点:1.两者都是apache组织开发的 2.两者都有HTTP服务的功能 3.两者都是免费的 不同点:Apache是web服务器,专门提供HTTP服务的, ...

  8. 01-Devops核心要点及Kubernetes架构概述

    Brog 自动装箱,自动修复,水平扩展,服务发现和负载均衡,自动发布和回滚 密钥和配置管理,存储编排,批量处理执行

  9. mybatis-generator 代码自动生成工具包

    怎么用mybatis-gennerator插件自动生成mybatis所需要的dao.bean.mapper xml文件.请看↓ 1.在D盘新建一个文件夹,命名:generator(或者其他盘其他名字也 ...

  10. python学习------面向对象的程序设计

    一 面向对象的程序设计的由来 1940年以前:面向机器 最早的程序设计都是采用机器语言来编写的,直接使用二进制码来表示机器能够识别和执行的指令和数 据.简单来说,就是直接编写 和 的序列来代表程序语言 ...