BladeRF xa5 - Creating an all Frequency Power Spectrum

120 views
Skip to first unread message

Dale Ranta

unread,
Jul 31, 2022, 11:31:49 AM7/31/22
to SdrGlut Users
This video shows how to create a Power Spectrum for the entire 6 GHZ range of the BladeRF with a 10 kHz bins. The small bin size lets you see individual channels. Scans with much larger bin sizes are a joke and contain little useful information. sdrReceive did the frequency scan and mysticPlot displayed the results.

BladeRF xa5 - Creating an all Frequency Power Spectrum
https://youtu.be/Z2Fa7qzTfFQ


ALEX

unread,
Jun 12, 2023, 9:19:25 AM6/12/23
to SdrGlut Users
I have recorded .csv by sdrReceive.x. How can I visualize that .csv with mysticPlot? When I open file it shows only text representation.

воскресенье, 31 июля 2022 г. в 18:31:49 UTC+3, Dale Ranta:

Dale Ranta

unread,
Jun 12, 2023, 12:15:08 PM6/12/23
to SdrGlut Users
SdrReceive creates two files out.csv for use with heatmap.py and out.s2d for use with mysticPlot.
Just start up mysticPlot and open the  out.s2d file. out.s3d has exactly the same information as out.csv.

ALEX

unread,
Jun 12, 2023, 12:44:04 PM6/12/23
to SdrGlut Users
In my case SdrReceive creates only 1 file and it`s content is csv. I have tried not specifying output file and specifying two files but without any success.
понедельник, 12 июня 2023 г. в 19:15:08 UTC+3, Dale Ranta:

Dale Ranta

unread,
Jun 12, 2023, 3:30:10 PM6/12/23
to SdrGlut Users
I ran the example -

sdrReceive.x -sweep 96.5M:106.5M:10k  -file out.csv


and It generated a  out.csv and a out.s2d.


I let it run for a few minutes before stopping.


What system are you running it on ?


ALEX

unread,
Jun 12, 2023, 3:46:29 PM6/12/23
to SdrGlut Users
I run Windows 10. I have tried few minutes capture but still only one .csv file is generated. Also I use -mute flag, because RtAudio does not find any device (might be connected with this problem?)

понедельник, 12 июня 2023 г. в 22:30:10 UTC+3, Dale Ranta:

Dale Ranta

unread,
Jun 12, 2023, 4:15:31 PM6/12/23
to SdrGlut Users
I create a junk folder on the Desktop. I CD into  the junk folder on the Desktop.
I then clicked on the program sdrReceiveWindows and dragged it to the Developer Window giving -

"C:\...\SdrGlut-Install\bin\sdrReceiveWindows.exe"  -sweep 96.5M:106.5M:10k"  -file out.csv

Running from the Desktop folder worked for me - getting both files. It did not work in the folder where 
sdrReceiveWindows.exe was.

Dale Ranta

unread,
Jun 12, 2023, 4:22:06 PM6/12/23
to SdrGlut Users
Post the output from sdrReceiveWindows - it may have some clues.

ALEX

unread,
Jun 12, 2023, 4:34:01 PM6/12/23
to SdrGlut Users
Command:
sdrreceivewindows -sweep 87M:107M:30K -file out.csv -mute -samplerate 10e6

Output:
←[1m←[33m[WARNING] SoapyVOLKConverters: no VOLK config file found. Run volk_profile for best performance.←[0m
[INFO] [UHD] Win32; Microsoft Visual C++ version 14.2; Boost_107500; UHD_4.0.0.HEAD-0-g90ce6062
Number of Devices Found: 1
SDR device =  0  driver = bladerf
SDR device =  0  label = BladeRF #0

device =  0 selected
backend = libusb device = 0x01:0x0D driver = bladerf instance = 0 label = BladeRF #0

[INFO] bladerf_open_with_devinfo()
[INFO @ host/libraries/libbladeRF/src/helpers/version.c:106] FPGA version (v0.15.0) is newer than entries in libbladeRF's compatibility table. Please update libbladeRF if problems arise.
[INFO] setSampleRate(Rx, 0, 4.000000 MHz), actual = 4.000000 MHz
[INFO] setSampleRate(Tx, 0, 4.000000 MHz), actual = 4.000000 MHz
driver = bladeRF
hardware = bladerf2
fpga_size = 49 fpga_version = 0.15.0 fw_version = 2.4.0-git-a3d5c55f

Rx antennas:
RX

Setting Info:
key loopback value none read none type 3 min 0 max 0 step 0
key reset value false read false type 0 min 0 max 0 step 0
key erase_stored_fpga value false read false type 0 min 0 max 0 step 0
key flash_firmware value  read  type 3 min 0 max 0 step 0
key flash_fpga value  read  type 3 min 0 max 0 step 0
key jump_to_bootloader value false read false type 0 min 0 max 0 step 0
key load_fpga value  read  type 3 min 0 max 0 step 0

RX RF Gain range min -15 max 60
RX FrequencyRange min 7e+07 max 6e+09
RX Bandwidth MHZ  0.20  56.00
RX SampleRates MHZ  0.520834  4.360834  8.200834  12.040834  15.360000  23.040000  30.720000  30.720000  46.080000  61.440000
RX Gains:
         0 full range max 71 min -4

TX RF Gain range min -23.75 max 66
TX FrequencyRange min 4.7e+07 max 6e+09
TX Bandwidth MHZ  0.20  56.00
TX SampleRates MHZ  0.520834  4.360834  8.200834  12.040834  15.360000  23.040000  30.720000  30.720000  46.080000  61.440000
TX Gains:
         0 dsa range max 0 min -89.75

[INFO] setSampleRate(Rx, 0, 10.000000 MHz), actual = 10.000000 MHz
rx->samplerate 10000000
getGainMode: 0
hasFrequencyCorrection: 0

RtApiDummy: This class provides no functionality.

SoapySDR Library
Lib Version: v0.8.1-PothosSDR-2021.07.25-vc16-x64
API Version: v0.8.0
ABI Version: v0.8
SOAPY_SDR_ROOT
Install root:  D:\PothosSDR
Search path:  D:\PothosSDR/lib/SoapySDR/modules0.8
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/airspyhfSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/airspySupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/bladeRFSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/HackRFSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/IrisSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/LMS7Support.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/miriSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/netSDRSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/osmosdrSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/RedPitaya.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/remoteSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/rtlsdrSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/uhdSupport.dll
Module found: D:\PothosSDR/lib/SoapySDR/modules0.8/volkConverters.dll

sweepLower 87 MHZ sweepUpper 107 MHZ sweepSize 30000 crop 0
[INFO] setSampleRate(Rx, 0, 10.000000 MHz), actual = 10.000000 MHz
steps 1000 counts 1001
sweep Steps 1001 lower 8.7e+07 upper 1.17e+08
rate 10000000.000000 rx->size 500000
0ret=-4, flags=4, timeNs=201653300 b0 0.055664 b1 0.352539 witch 0
0ret=-4, flags=4, timeNs=226058800 b0 0.149902 b1 -0.030273 witch 1
0ret=-4, flags=4, timeNs=226414300 b0 0.052734 b1 0.073730 witch 2
0ret=-4, flags=4, timeNs=226646900 b0 0.097168 b1 -0.041504 witch 3
sweep 0
fc 92 fmins 87 fmaxs 97
fc 102 fmins 97 fmaxs 107
frequency 96.99 fc 1.02e+08 index -4 -0.001
skip - ff 97.005 fc 102 samplerate 10000000 n1 -1 n2 8
frequency 107.01 fc 1.02e+08 index 4099 1.001
skip - ff 106.995 fc 102 samplerate 10000000 n1 4086 n2 -1
fc 112 fmins 107 fmaxs 117

sweep 1
fc 92 fmins 87 fmaxs 97
fc 102 fmins 97 fmaxs 107
frequency 96.99 fc 1.02e+08 index -4 -0.001
skip - ff 97.005 fc 102 samplerate 10000000 n1 -1 n2 8
frequency 107.01 fc 1.02e+08 index 4099 1.001
skip - ff 106.995 fc 102 samplerate 10000000 n1 4086 n2 -1
fc 112 fmins 107 fmaxs 117

sweep 2
fc 92 fmins 87 fmaxs 97
fc 102 fmins 97 fmaxs 107
0ret=-4, flags=4, timeNs=5324528400 b0 0.084473 b1 0.117676 witch 105
Skip Bad Read Data
frequency 96.99 fc 1.02e+08 index -4 -0.001
skip - ff 97.005 fc 102 samplerate 10000000 n1 -1 n2 8
frequency 107.01 fc 1.02e+08 index 4099 1.001
skip - ff 106.995 fc 102 samplerate 10000000 n1 4086 n2 -1
fc 112 fmins 107 fmaxs 117

sweep 3
fc 92 fmins 87 fmaxs 97
fc 102 fmins 97 fmaxs 107
frequency 96.99 fc 1.02e+08 index -4 -0.001
skip - ff 97.005 fc 102 samplerate 10000000 n1 -1 n2 8
frequency 107.01 fc 1.02e+08 index 4099 1.001
skip - ff 106.995 fc 102 samplerate 10000000 n1 4086 n2 -1
fc 112 fmins 107 fmaxs 117
понедельник, 12 июня 2023 г. в 23:22:06 UTC+3, Dale Ranta:

Dale Ranta

unread,
Jun 12, 2023, 8:04:22 PM6/12/23
to SdrGlut Users
You were right, on Windows 10 the -mute kills the out.s2d file. On MacOS it has no effect.
 Post the output with the "-mute" removed - you should not need that anyway - 
that should print information about the sound on your machine.

ALEX

unread,
Jun 13, 2023, 2:14:18 AM6/13/23
to SdrGlut Users
Output:
[repetitive limes omitted]

RtApiDummy: This class provides no functionality.

No audio devices found!

I have used https://github.com/thestk/rtaudio for compilation
вторник, 13 июня 2023 г. в 03:04:22 UTC+3, Dale Ranta:

ALEX

unread,
Jun 13, 2023, 8:13:34 AM6/13/23
to SdrGlut Users
I reinstall RtAudio and get other output:

Audio device Count 12 default output device 133 audiodevice -1

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 0 : output  channels = 15 Device Name =  sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 1 : output  channels = 15 Device Name = └0‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 2 : output  channels = 15 Device Name = ►1‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 3 : output  channels = 15 Device Name = ╨/‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 4 : output  channels = 15 Device Name =  sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 5 : output  channels = 15 Device Name =  0‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 6 : output  channels = 15 Device Name = ►6‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 7 : output  channels = 15 Device Name = а2‼└♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 8 : output  channels = 15 Device Name = А{ └♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 9 : output  channels = 15 Device Name = └Б └♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 10 : output  channels = 15 Device Name = 0А └♫☻ sampleRates =

RtApi::getDeviceInfo: deviceId argument not found.

audio device = 11 : output  channels = 15 Device Name = ╨{ └♫☻ sampleRates =

Still only one .csv is produced
вторник, 13 июня 2023 г. в 09:14:18 UTC+3, ALEX:

Dale Ranta

unread,
Jun 13, 2023, 10:11:31 AM6/13/23
to SdrGlut Users
The output indicates that you have 12 audio channels - that it is possible if you have some fancy sound card, but it errors trying to get the information.

you can try using the various channel by running sdrReceive with the option 

sdrreceivewindows -sweep 87M:107M:30K -file out.csv -audiodevice 0 -samplerate 10e6

sdrreceivewindows -sweep 87M:107M:30K -file out.csv -audiodevice 1 -samplerate 10e6

sdrreceivewindows -sweep 87M:107M:30K -file out.csv -audiodevice 2 -samplerate 10e6

...



Does the sound on your machine work at all ?

It is best to go the the original source of Rtaudio and see if that works -



If that does not work, I will have to go in and change the source code. The  "-mute" works Ok on MacOS - it is very strange that it does not work on Widows 10.

Dale Ranta

unread,
Jun 13, 2023, 12:55:40 PM6/13/23
to SdrGlut Users
I found something that may be causing your problem.

If you hit  control-c more than once, the program does an error exit and does not write the csv file.
You should see the message -

checkall all Ok.

as the last thing the program prints.

ALEX

unread,
Jun 13, 2023, 1:51:51 PM6/13/23
to SdrGlut Users
Yes, the problem is caused by Control-c pressing, but the problem remains when I press Control-c only once. I have added following line before while(!threadexit) loop (~780 line in cReceive.cpp):

signal(SIGINT, sigintHandler);

--------------------------
void sigintHandler(int signal) {
threadexit = 1;
}

Those changes fixed problem and now .s2d file is created successfully. But I can`t guarantee that those fix will work properly on other OSes. 
вторник, 13 июня 2023 г. в 19:55:40 UTC+3, Dale Ranta:

Dale Ranta

unread,
Jun 13, 2023, 5:04:13 PM6/13/23
to SdrGlut Users
That is like the code that is in "main.c" are you saying that that does not work for you.
If you hit control-c once, and wait until it conpletes the sweep pass, it should exit.

Dale Ranta

unread,
Jun 13, 2023, 8:15:22 PM6/13/23
to SdrGlut Users
It looks like you have a fairly old version of sdrReceive - you may want to get the latest version from the wed site.

Reply all
Reply to author
Forward
0 new messages