File: hackrf_tools.rst

package info (click to toggle)
hackrf 2024.02.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 36,692 kB
  • sloc: ansic: 56,310; xml: 3,424; perl: 2,730; python: 1,427; makefile: 598; asm: 514; vhdl: 319; sh: 179; awk: 20
file content (139 lines) | stat: -rw-r--r-- 3,601 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
============
HackRF Tools
============

Great Scott Gadgets provides some commandline tools for interacting with HackRF. 
    * **hackrf_info** Read device information from HackRF such as serial number and firmware version.

    * **hackrf_transfer** Send and receive signals using HackRF. Input/output files are 8-bit signed quadrature samples.

    * **hackrf_sweep**, a command-line spectrum analyzer.

    * **hackrf_clock** Read and write clock input and output configuration.

    * **hackrf_operacake** Configure Opera Cake antenna switch connected to HackRF.

    * **hackrf_spiflash** A tool to write new firmware to HackRF. See: :ref:`Updating Firmware <updating_firmware>`.

    * **hackrf_debug** Read and write registers and other low-level configuration for debugging.



hackrf_sweep
~~~~~~~~~~~~

Usage
^^^^^

.. code-block:: sh 

    [-h] # this help
    [-d serial_number] # Serial number of desired HackRF
    [-a amp_enable] # RX RF amplifier 1=Enable, 0=Disable
    [-f freq_min:freq_max] # minimum and maximum frequencies in MHz
    [-p antenna_enable] # Antenna port power, 1=Enable, 0=Disable
    [-l gain_db] # RX LNA (IF) gain, 0-40dB, 8dB steps
    [-g gain_db] # RX VGA (baseband) gain, 0-62dB, 2dB steps
    [-w bin_width] # FFT bin width (frequency resolution) in Hz, 2445-5000000
    [-1] # one shot mode
    [-N num_sweeps] # Number of sweeps to perform
    [-B] # binary output
    [-I] # binary inverse FFT output
    -r filename # output file



Output fields
^^^^^^^^^^^^^

``date, time, hz_low, hz_high, hz_bin_width, num_samples, dB, dB, ...``

Running ``hackrf_sweep -f 2400:2490`` gives the following example results:

.. list-table :: 
  :header-rows: 1
  :widths: 1 1 1 1 1 1 1 1 1 1 1

  * - Date  
    - Time  
    - Hz Low    
    - Hz High   
    - Hz bin width  
    - Num Samples   
    - dB    
    - dB    
    - dB    
    - dB    
    - dB
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2400000000    
    - 2405000000    
    - 1000000.00    
    - 20    
    - -64.72    
    - -63.36    
    - -60.91    
    - -61.74    
    - -58.58
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2410000000    
    - 2415000000    
    - 1000000.00    
    - 20    
    - -69.22    
    - -60.67    
    - -59.50    
    - -61.81    
    - -58.16
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2405000000    
    - 2410000000    
    - 1000000.00    
    - 20    
    - -61.19    
    - -70.14    
    - -60.10    
    - -57.91    
    - -61.97
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2415000000    
    - 2420000000    
    - 1000000.00    
    - 20    
    - -72.93    
    - -79.14    
    - -68.79    
    - -70.71    
    - -82.78
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2420000000    
    - 2425000000    
    - 1000000.00    
    - 20    
    - -67.57    
    - -61.61    
    - -57.29    
    - -61.90    
    - -70.19
  * - 2019-01-03    
    - 11:57:34.967805   
    - 2430000000    
    - 2435000000    
    - 1000000.00    
    - 20    
    - -56.04    
    - -59.58    
    - -66.24    
    - -66.02    
    - -62.12

Each sweep across the entire specified frequency range is given a single time stamp.

The fifth column tells you the width in Hz (1 MHz in this case) of each frequency bin, which you can set with ``-w``. The sixth column is the number of samples analyzed to produce that row of data.

Each of the remaining columns shows the power detected in each of several frequency bins. In this case there are five bins, the first from 2400 to 2401 MHz, the second from 2401 to 2402 MHz, and so forth.