RF Analyzer for Android 安卓平台连接HackRF的App
Over the last week I've been working on a new project, trying to build a spectrum analyzer for Android that works with my hackrf_android library. Now I finally reached the point were it is stable enough to be useful and I created the GitHub repository today:
https://github.com/demantz/RFAnalyzer
It is still very basic and I have a lot of ideas to extend its functionality, but I thought it's better to have testers involved as early as possible. Eventually it should evolve in something similar to GQRX, supporting different modes and devices. But that will take some time!
The new version of RF Analyzer (1.07) has now support for AM/FM demodulation! It is now also available on Google Play:
See the readme on GitHub for a more detailed description!

RF Analyzer running on a Nexus 5
In this blog I'm going to show what you can do with the app and in the end I explain how it is working internally for those who like to play with the source code. I also tried to document the code as good as possible, but it is always easier if the basic flow of the program is explained before looking at it.
What you can do with it
Right now there aren't many fancy features. The app will present you with a simple UI showing the frequency spectrum including a waterfall plot. Here is a list of what you can do right now with version 1.00:
- Browse the spectrum by scrolling horizontally
- Zoom in and out, both horizontally and vertically
- Adjust the sample rate and center frequency to match the current view of the screen by double tapping
- Auto scale the vertical axis
- Jump directly to a frequency
- Adjust the gain settings of the HackRF
- Select a pre-recorded file as source instead of a real HackRF
- Change the FFT size
- Setting the frame rate either to a fixed value or to automatic control
- Activate logging and showing the log file

FFT at 20 Msps showing FLEX pagers at 931 MHz
Use common gestures to zoom and scroll both vertically and horizontally. Note that the vertical axis of the FFT plot also affects the colors of the waterfall plot:

Zoomed in (both vertical and horizontal) view
If you scroll outside the current range of the FFT or if you zoom so that the resolution of the FFT is too low you can simply double tap the screen. RF Analyzer will re-tune the HackRF to the frequency currently centered on the screen and also ajust the sample rate so that the FFT covers exactly the frequency range that is currently visible:

The resolution of the FFT is too low when zoomed in too closely. And we scrolled to far right that we can see the end of the FFT on the right site

After double tapping the HackRF is tuned to 931,61 MHz (note the DC offset peak!) and the sample rate is now adjusted to about 2.5 Msps so that we see the full FFT resolution again
You can also use the autoscale button in the action bar to adjust the vertical scale so that it ranges from the minimum to the maximum of the currently visible values of the FFT:

If you want to jump to a certain frequency, use the 'set frequency' button and it will prompt you to enter a new frequency:

The gain settings of the HackRF (both VGA and LNA gain) can be accessed through the 'set gain' button in the overflow menu:

In the settings activity you can:
- Select other source types (currently only HackRF or file source)
- Set the FFT size
- Set the screen orientation (auto / landscape / portrait)
- Turn autostart on and off (so that you don't have to hit the start button every time)
- Set the frame rate to auto or a fixed value (useful if you want a linear time axis in the waterfall plot)
- Deactivate vertical zoom and scrolling (so that you don't accidentally alter the vertical scale while scrolling through frequencies)
- Turn on logging and set the location of the log file.
- Show the log file

Settings Activity of RF Analyzer on a Nexus 7
Implementing the file source was helpful for debugging the application. It is also a way to test the app if you don't have an OTG cable or your phone/tablet doesn't output enough power for the HackRF. Selecting the file source type will allow you to use RF Analyzer with recorded samples from hackrf_transfer or Test_HackRF. I've uploaded a short capture of some FLEX pager signals for testing: FLEX Pager at 931MHz (2Msps)
How it works
For those who want to play with the sources of RF Analyzer (GPLv2) I want to quickly explain the internal structure of the app:

(Uncomplete) class diagram of RF Analyzer. Underlined classes are running in seperate threads. Gray elements are external modules.
To support different devices I defined a common interface that is implemented by all classes which represent sources of IQ samples. The Scheduler will continuously read samples from the source to prevent the receive buffers of the device to fill up. It forwards samples in packets of the size of the FFT to the AnalyzerProcessingLoop by inserting them in a queue. If the queue is full, the samples are thrown away in order to not block the input device. The AnalyzerProcessingLoop also runs in a separate thread and reads the sample packets from the queue, processes them with the help of the FFT class and then calls draw() on the AnalyzerSurface. This method draws the given FFT samples on a SurfaceView and also draws a new line of the waterfall plot as well as the horizontal and vertical axis.
For a more detailed impression of how the app works, have a look into the sources on GitHub. I tried my best to add helpful comments to understand the flow of the program.
If you have any questions, comments or any other input, don't hesitate to leave a comment or contact me directly on Twitter: @dennismantz
Have fun testing it! ;)
Here is the video were I demonstrate the old version of RF Analyzer:
原文地址:http://tech.mantz-it.com/2014/10/rf-analyzer-explore-frequency-spectrum.html
RF Analyzer for Android 安卓平台连接HackRF的App的更多相关文章
- Android使用蓝牙连接adb调试App
使用WiFi连接Android设备调试APP的教程非常多,可是项目中须要使用蓝牙进行通信.所以牵扯使用蓝牙调用adb. 1. 将电脑蓝牙与手机进行配对(控制面板->设备和打印机->加入 ...
- [STF手机设备管理平台]连接其它操作系统上的安卓设备实操介绍
一.背景 看到之前曾有人发贴,贴名[stf 连接各操作系统上安卓设备的操作方法分享],介绍了一下,虽然说方法和理论都有,但下述评论中还是有很多人不知如何操作,特别是不知道stf provider命令如 ...
- 【android】安卓手机连接电脑了,但是adb devices找不到设备及找到设备但无权限的问题
安卓手机连接电脑的时候,会遇到adb连接失败,adb devices为空,或者连接成功,但是显示unauthorized的情况.遇到这种情况,一般认为是手机驱动安装失败,会选择重新下载安装驱动,如果还 ...
- EasyCamera Android安卓移动视频监控单兵设备接入EasyDarwin开源流媒体云平台
前言 随着Android系统的不断更新和发展,现在越来越多的硬件产品选择用安卓系统作为运行环境,电视机,机顶盒.门禁.行车记录仪.车载系统.单兵设备等等,Android系统底层还是Linux,但对上层 ...
- 【android】安卓平台版本和API版本的对应关系
安卓平台版本和API版本对应关系
- 使用UE4公布安卓平台游戏
使用了几天的UE4 ,总算是将游戏在安卓平台执行起来了.当中遇到非常多问题,而且终于依旧有一些问题没能解决. 整体感觉是UE4这款引擎眼下还不够成熟.问题较多. 没有unity使用起来方便. 可是既然 ...
- 在Unity3D中实现安卓平台的本地通知推送
[前言] 对于手游来说,什么时候需要推送呢?玩过一些带体力限制的游戏就会发现,我的体力在恢复满后,手机会收到一个通知告诉我体力已完全恢复了.这类通知通常是由本地的客户端发起的,没有经过服务端. 在安卓 ...
- ionic3 打包安卓平台环境搭建报错解决方案总结
1.jvm虚拟机提供的运行空间小于项目所需的空间是报错.如图: 解决方法:在环境变量中配置jvm的运行内存大小,大于所需的内存即可. 其中:-Xmx512M可根据实际提示情况,进行更改,如1024M, ...
- Unity切换到安卓平台Shader丢失(opengl)
Unity安卓平台shader平台丢失 Unity的工程切换到Android平台后,运行游戏出现shader丢失 解决办法:在Unity桌面图标的快捷方式后添加 -force-gles20 示例:&q ...
随机推荐
- Swashbuckle for asp.net core 配置说明
0x00 安装 Swashbuckle 6.0 打开程序包管理器控制台,输入: Install-Package Swashbuckle -Pre 0x01 配置 Startup.cs public v ...
- mac攻略(四) -- brew使用
1.介绍 brew是一个mac新用户需要了解的必备命令,它是mac下的软件包管理软件,类似centos下的yum.ubuntu下的apt-get,免去了自己手动编译安装的不方便. 很多时候作为一个用户 ...
- Ubuntu 14.04下安装功能强大的屏幕截图软件 Shutter
[注释]试用了一下,果然很强大,牛逼 一款功能强大的屏幕截图软件——Shutter,Shutter最基本的就是截图功能了,在设计上可以自由选定区域,同时选定之 后依然可以通过上下左右四个地方来改变选区 ...
- python 反射调用
因为目前在写一个python的项目,用到了Python的反射机制,所以做一下笔记,把写项目过程中的感悟记下来. 先简单介绍下Demo用到的函数: sys.path 是python的模块的路径集,是一个 ...
- php : mysql数据库操作类演示
设计目标: 1,该类一实例化,就可以自动连接上mysql数据库: 2,该类可以单独去设定要使用的连接编码(set names XXX) 3,该类可以单独去设定要使用的数据库(use XXX): 4,可 ...
- 深入浅出设计模式——模板方法模式(Template Method Pattern)
模式动机 模板方法模式是基于继承的代码复用基本技术,模板方法模式的结构和用法也是面向对象设计的核心之一.在模板方法模式中,可以将相同的代码放在父类中,而将不同的方法实现放在不同的子类中.在模板方法模式 ...
- 从零开始CSS(一 2016/9/21)
1.基础语法 CSS 规则由两个主要的部分构成:选择器,以及一条或多条声明. selector {declaration1; declaration2; ... declarationN } 选择器通 ...
- Android ViewPager实现选项卡切换
ViewPager实现选项卡切换,效果图如下: 步骤一:这里使用兼容低版本的v4包进行布局,这里eclipse没有输入提示,所以要手动输入,文件名称“activity_main.xml” <Re ...
- 6个html5页面适配iphone6的技巧
iphone6及iphone6plus已经出来一段时间了.很多移动端网站,以前写死body为320px的,现在估计也忙着做适配了. 大屏幕手机其实一直有,只是以前大家没怎么重视,移动端的H5页面大部分 ...
- PHP 小方法之 仿百度蜘蛛采集
if(!function_exists('_GetContent')){ function _GetContent( $url ){ $ch = curl_init(); $ip = '220.181 ...