95 Commits

Author SHA1 Message Date
Michael Ossmann
9856452215 hackrf_sweep: eliminate -n option (num_samples)
The firmware has the capability to dwell on each frequency for a
configurable duration in sweep mode, but the hackrf_sweep host tool did
not behave correctly when asked to use a non-default dwell time. The
option has never worked properly, and it is not a feature anyone seems
to want.
2021-11-14 11:41:56 -07:00
Michael Ossmann
2775279fd0 hackrf_sweep: eliminate time stamp adjustment
We previously attempted to adjust the output time stamp according to the
sample rate and placement of the samples within the USB transfer data,
but the end result was a fixed time offset with respect to the time of
USB transfer completion. We are using only those samples closest to the
end of the transfer, so it makes sense to simply use the time the USB
transfer ends and not try to correct that fixed offset.

It may be possible in the future to have a more accurate time stamp
generated in firmware, but I don't think it is worth complicating the
host code with minor time adjustments until and unless firmware-based
time stamps become available.
2021-11-14 11:20:31 -07:00
Michael Ossmann
10b7d67ea5 Merge pull request #874 from metayan/sweeprate
hackrf_sweep: Calculate and show sweep rate for subsecond sweeps
2021-04-23 17:35:31 -06:00
Yan
7c14f876a0 hackrf_sweep: initialise sweep_rate
Thanks to dmaltsiniotis for spotting this.
2021-04-10 13:47:33 +02:00
Yan
90acbcff07 hackrf_sweep: Calculate and show sweep rate for subsecond sweeps 2021-04-08 22:46:42 +02:00
Demetri Maltsiniotis
e664321cc6 Adding call to _setmode for Windows only to specify binary stdout output piping. 2021-04-07 15:11:44 -05:00
Yan
ab4498f8ac hackrf_sweep: exit early from rx_callback if do_exit set
Sometimes, if a small frequency interval is scanned, the callback is
triggered even though we already have the number of sweeps we want, and
sweep_count gets increased, showing the wrong "Total sweeps".
2021-03-20 10:07:51 +01:00
Yan
4c46fc74b3 hackrf_sweep: speed up ending by removing unnecessary code
hackrf_stop_rx() is handled in hackrf_close(), so there seems to be no need
to call it separately.  Furthermore, if hackrf_stop() is called separately,
it causes hackrf_close() to take more than half a second longer.
2021-03-19 16:31:37 +01:00
Yan
2ef7995763 hackrf_sweep: flush output earlier
Gives listener access to complete data faster.
Otherwise the data might be delayed until the whole closing procedure is done.
2021-03-19 16:29:21 +01:00
Mike Walters
5361b3a7f4 hackrf_sweep: switch main loop timing back to 1Hz
fixes #850
fixes #851
2021-03-18 19:48:53 +00:00
Michael Ossmann
2ca991e1df Flush output streams. Do not fclose stdout/stdin. 2021-01-27 12:12:45 -07:00
Michael Ossmann
a6fa7876cb Give descriptive names to streams.
They were previously given the confusing name of fd even though they are
not file descriptors.
2021-01-27 11:59:29 -07:00
Michael Ossmann
8fead43cf2 Merge pull request #748 from ggatis/patch-1
Update hackrf_sweep.c
2021-01-27 11:38:45 -07:00
ggatis
38f6d4c828 Update hackrf_sweep.c
change if ( fd != NULL ) to if ( ( fd != NULL ) && ( fd != stdout ) )
before fclose( fd );
2020-06-16 13:55:50 +03:00
Michael Ossmann
c0aed2edb7 firmware: clean up transceiver modes 2020-02-11 16:59:59 +00:00
GravesJake
c47f2b1162 Add cross-platform support for sleeping for milliseconds 2018-11-07 11:35:04 -07:00
GravesJake
39062a7a7b Remove usleep (incompatible with Windows) 2018-11-07 11:24:13 -07:00
GravesJake
982770b25b Add limited sweep mode 2018-11-07 10:49:49 -07:00
Dominic Spill
e384a2d2b7 Explicitly cast variables to silence Windows build warnings 2018-03-27 14:11:51 -06:00
Dominic Spill
9f0a46d818 Calculate using doubles and cast to float at the last moment 2018-03-27 10:38:03 -06:00
Dominic Spill
a1f9361f78 Wrong localtime argument type in hackrf_sweep causes crash on win 10
Thanks jaredd
2017-12-02 20:37:37 -07:00
Morten Shearman Kirkegaard
161d8f77f4 Fixed bug in rx_callback(), where time_stamp.tv_usec was sent through modulo before time_stamp.tv_sec was updated. 2017-08-22 17:17:45 +02:00
Dominic Spill
97d3e65866 Fix misleading typo in bandwidth filter comment 2017-08-17 17:20:27 -06:00
Michael Ossmann
c7956b49b1 hackrf_sweep: report sweep rate instead of data rate 2017-02-21 12:43:59 -07:00
Michael Ossmann
9baac39962 hackrf_sweep: suppress ifft output unless requested 2017-02-21 12:19:00 -07:00
Michael Ossmann
886ba6acfb hackrf_sweep: corrected output file descriptors in binary and ifft modes for compatibility with output file option 2017-02-20 21:43:12 -07:00
Michael Ossmann
f34cc960ff hackrf_sweep: Added experimental Inverse FFT binary output mode.
In this mode, FFT output bins from multiple hops are stitched together into a
single set of bins per sweep.  Each sweep is then processed with an inverse FFT
to simulate a time domain signal at a sample rate equal to the sweep bandwidth.
This wideband time domain signal is sent to the output as complex floats and
can be piped to or viewed with tools such as fosphor or inspectrum.  The output
signal is discontinuous, so the time axis (e.g. in inspectrum) will be
incorrect.
2017-02-20 21:07:00 -07:00
Michael Ossmann
13e4dea446 hackrf_sweep: avoid starting RX too early 2017-02-19 11:10:30 -07:00
Michael Ossmann
378b65a598 added cast to fix tv_usec formatting on various platforms 2017-02-17 00:28:32 -07:00
Michael Ossmann
fd579445df improved accuracy of hackrf_sweep timestamps 2017-02-16 23:22:07 -07:00
Michael Ossmann
bc49bdc344 update timestamp once per sweep 2017-02-16 17:34:38 -07:00
Michael Ossmann
d794ac0e20 output timestamps in microseconds 2017-02-16 14:47:53 -07:00
Michael Ossmann
79f95abdb3 correct discrepancy between number of samples and number of bytes in blocks of samples
related to #346
2017-02-16 12:46:17 -07:00
Michael Ossmann
6aacfa2cc9 corrected maximum permitted number of FFT bins
Fixes #346
2017-02-16 12:06:52 -07:00
Michael Ossmann
d7a799d6f2 report actual bin width with indicated precision instead of to the nearest Hz 2017-02-15 16:36:25 -07:00
Michael Ossmann
7cd8e5f7eb hackrf_sweep output file support 2017-02-15 16:20:35 -07:00
Michael Ossmann
ae367880bf _USE_MATH_DEFINES only on Windows 2017-02-15 15:03:54 -07:00
mrbubble62
e4106f5aca Cleaned up 2017-02-15 01:01:09 -05:00
mrbubble62
63435f5616 hackrf_sweep on Windows
added precompiled fftw-3.3.5
2017-02-14 01:43:14 -05:00
Michael Ossmann
c57066ebf8 hackrf_sweep: removed bin width from binary output because a more precise result can be computed from the number of bins in a record 2017-02-10 16:37:52 -07:00
Michael Ossmann
55e3a2087d hackrf_sweep: fftwf_free 2017-02-09 23:52:07 -07:00
Michael Ossmann
06e24e876f added fields to hackrf_sweep binary output 2017-02-09 18:12:29 -07:00
Michael Ossmann
e7647f62f3 fixed bug in frequency reported to binary output of hackrf_sweep 2017-02-08 17:24:05 -07:00
Michael Ossmann
03d93c1369 added one shot mode to hackrf_sweep 2017-02-08 10:46:08 -07:00
Michael Ossmann
c9c70f7adb hackrf_sweep: don't skip more input than necessary when waiting for valid data 2017-02-08 00:42:13 -07:00
Michael Ossmann
5e6e70659b hackrf_sweep: suppress processing and output until the first expected frequency is seen 2017-02-08 00:37:42 -07:00
Michael Ossmann
5ab315a73a code cleanup 2017-02-07 21:11:50 -07:00
Michael Ossmann
c68aedef31 added output description to hackrf_sweep help 2017-02-07 20:25:21 -07:00
Michael Ossmann
05759ce1c8 fft bin selection in hackrf_sweep binary output, similar to text output 2017-02-07 18:02:52 -07:00
Michael Ossmann
813f540e94 fixed FFT bin reordering bug in hackrf_sweep 2017-02-07 17:48:24 -07:00