# A Python RF spectrum analyser
![Screenshot](screenShot_web.png)
* Takes digitised IQ samples from some source to give a live spectrum and spectrogram.
* All samples are used for the FFT. Providing detection of short bursting signals.
* Has a plugin architecture for sources and analysis of spectrums.
* Can snapshot IQ samples to file upon an event, currently a manual trigger.
* Has a web based UI that can be used to take measurements on the spectrum.
This was an exercise in writing some python which expanded into providing a web based UI.
The fft computations are done by libraries in Python, so not the fastest.
If you have an rtlsdr working with any of the other tools then this analyser should work as well
once the python rtlsdr support is installed in your environment.
Performance depends on your machine and how the supporting fft libraries were compiled.
I have certainly kept up with streams of data at over 3Msps.
All the input sources are provided by python modules with the different SDR platforms are supported by
corresponding Python libraries gleaned from Pypi.
## Input modules:
* audio - useful for testing
* file - wav and raw binary supported, all files must be in snapshot directory
* pluto (IP) - Analog devices pluto SDR on IP, 70Mhz to 6GHz but wide open
* rtlsdr - Direct connection via USB
* rtltcp - rtl over tcp
* socket - any stream of IQ samples
There is soapy support for sdrplay, but i have failed to get this working again after an initial success.
## Input data IQ types:
* 8bit offset binary
* 8bit 2's complement
* 16bit 2's complement little endian (x86)
* 16bit 2's complement big endian
* 32bit ieee float little endian
* 32bit ieee float big endian
## Problems
* Converting input data to complex float32 numpy arrays. This takes a lot of time, which would be a lot
simpler in C/C++.
* Soapy support is not really tested anymore (sdrplay support relies on soapy).
* if the programme exceptions immediately, check the dependencies are met.
## Tested with the following:
Windows: audio, file, pluto (IP), rtlsdr, rtltcp, socket
Linux : audio, file, pluto (IP), rtlsdr, rtltcp, socket
soapy(audio, rtlsdr, sdrplay)
On windows make sure to use the correct rlibrtlsdr.dll for your python 32bit/64bit
Since, once, getting soapy to work under Linux i have failed to replicate
this ever again - pity it was my only interface to an sdrplay device
## Examples
Some examples for running from command line
python ./SpectrumAnalyser.py - Then goto http://127.0.0.1:8080 and configure the source
python ./SpectrumAnalyser.py -h - help
python ./SpectrumAnalyser.py -i? - list input sources that are available
Some default input selections, normally select trhough web interface:
python ./SpectrumAnalyser.py -ipluto:192.168.2.1 -c433.92e6 -s600e3 - pluto at 433MHz and 600ksps
python ./SpectrumAnalyser.py -ipluto:192.168.2.1 -c433.92e6 -s1e6
--plugin analysis:peak:threshold:12
--plugin report:mqtt:broker:192.168.0.101 - detect and log signals
python ./SpectrumAnalyser.py -ifile:test.wav -c433.92e6 - a test wav file
python ./SpectrumAnalyser.py -iaudio:1 -s48e3 -iaudio:1 - audio input
python ./SpectrumAnalyser.py -irtlsdr:kk -c433.92e6 -s1e6 - rtlsdr
SOAPY may not work:
python ./src/SpectrumAnalyser.py -isoapy:audio -s48000 -c0 - soapy input
python ./src/SpectrumAnalyser.py -isoapy:sdrplay -s2e6 c433.92e6
## Dependencies
The following python modules should be installed. Optional ones provide specific capabilities.
Required:
numpy
websockets
Testing:
pytest
Optional:
scipy - another FFT library
pyfftw - another FFT library, faster above 8k size
pyadi-iio - pluto device
iio - pluto device
pyrtlsdr - rtlsdr devices
sounddevice - audio devices
soapysdr - soapy support
paho-mqtt - mqtt functionality (client)
```
pip3 install -r src/requirements.txt
```
没有合适的资源?快使用搜索试试~ 我知道了~
pyspectrum:具有Web UI的Python sdr频谱分析仪
共66个文件
py:39个
png:11个
js:5个
需积分: 50 22 下载量 49 浏览量
2021-04-02
05:23:59
上传
评论
收藏 2.15MB ZIP 举报
温馨提示
Python RF频谱分析仪 从某些来源获取数字化的IQ样本,以提供实时频谱和频谱图。 所有样本都用于FFT。 提供短突发信号的检测。 具有用于信号源和频谱分析的插件架构。 可以快照IQ样本以在事件(当前为手动触发)时归档。 具有基于Web的UI,可用于在频谱上进行测量。 这是编写一些Python的练习,该Python扩展为提供基于Web的UI。 fft计算是由Python中的库完成的,因此不是最快的。 如果您有使用其他工具的rtlsdr,则在您的环境中安装了python rtlsdr支持后,此分析器也应能正常工作。 性能取决于您的计算机以及支持的fft库的编译方式。 我当然跟上了超过3Msps的数据流。 所有输入源均由python模块提供,具有不同的SDR平台,并由Pypi收集的相应Python库支持。 输入模块: 音频-对测试有用 文件-支持WAV和原始二进制文件,
资源推荐
资源详情
资源评论
收起资源包目录
pyspectrum-main2.zip (66个子文件)
pyspectrum-main2
.gitignore 384B
src
snapshots
empty 54B
requirements.txt 1KB
requirements.pluto.txt 1KB
tools
testAudio.py 1KB
test_mqtt_client.py 719B
requirements.rtlsdr.txt 1KB
dataSources
DataSource_null.py 2KB
DataSource_pluto.py 11KB
DataSource_audio.py 8KB
DataSource_file.py 7KB
DataSource_rtltcp.py 16KB
DataSource_soapy.py 7KB
DataSource_rtlsdr.py 13KB
DataSource_socket.py 7KB
DataSource.py 11KB
DataSourceFactory.py 4KB
dataSink
DataSink_file.py 8KB
dataProcessing
Spectrum.py 8KB
ProcessSamples.py 3KB
SpectrumAnalyser.py 29KB
misc
sdrStuff.py 8KB
SnapVariables.py 1KB
snapStuff.py 5KB
commandLine.py 7KB
SpectrumPicture.py 2KB
timeSpectral.py 2KB
Ewma.py 722B
PluginManager.py 2KB
wave_b.py 19KB
PicGenerator.py 3KB
global_vars.py 73B
FileOpen.py 7KB
SdrVariables.py 2KB
webUI
testServer.py 2KB
WebServer.py 5KB
WebSocketServer.py 8KB
webroot
icons
favicon-32x32.png 809B
play.png 171B
favicon-16x16.png 383B
android-chrome-192x192.png 6KB
led-green.png 2KB
led-yellow.png 2KB
apple-touch-icon.png 6KB
led-red.png 2KB
bin.png 2KB
android-chrome-512x512.png 16KB
main.js 38KB
colourmap.js 31KB
template.css 2KB
sdrState.js 11KB
site.webmanifest 263B
index.html 21KB
favicon.ico 15KB
snapState.js 6KB
spectrum.js 56KB
plugins
plugin_stdout.py 3KB
plugin_peak_detect.py 3KB
plugin_mqtt.py 4KB
LICENSE 1KB
README.md 4KB
tests
test_socket.py 4KB
test_file_input.py 2KB
test_spectrum.py 616B
test_ewma.py 241B
screenShot_web.png 2.09MB
共 66 条
- 1
资源评论
少女壮士
- 粉丝: 26
- 资源: 4660
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功