Software defined radio

◆ complex_band_pass_2()

static std::vector<> gr::filter::firdes::complex_band_pass_2 ( double  gain,
double  sampling_freq,
double  low_cutoff_freq,
double  high_cutoff_freq,
double  transition_width,
double  attenuation_dB,
  window = ,
double  beta =  
)
static

Use «window method» to design a complex band-pass FIR filter. The normalized width of the transition band and the required stop band attenuation is what sets the number of taps required. Narrow –> more taps More attenuation –> more taps. Window type determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
low_cutoff_freq center of transition band (Hz)
high_cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz)
attenuation_dB out of band attenuation
window one of
beta parameter for Kaiser window

Applications[edit]

I have a receiver with an audio sink, and keep getting aUaUaU errors?edit

aUaU

If your flow graph looks like this:

Radio Hardware -> Demodulator -> Audio Sink

…and you see those errors, it’s most likely a «2-clock-problem». The issue is, you have 2 pieces of hardware with a clock, and there’s no way to perfectly align them. There are many failure modes here, but a very obvious one is this: Imagine the radio clock is ever so slightly slower than advertised, and the audio clock is faster. Then, invariably, at some point, there will be not enough data to feed into the audio sink and it will underrun. Also, remember that GNU Radio shuffles data in chunks, so there may be enough data, but not in the precise moment when the audio sink needs it.

A simple workaround is to set the Audio Sink parameter «Ok to Block» to «No».

◆ set_alignment()

void gr::block::set_alignment ( int  multiple )

Constrains buffers to work on a set item alignment (for SIMD)

set_alignment_multiple causes the scheduler to ensure that the noutput_items argument passed to forecast and general_work will be an integer multiple of

Parameters
multiple The default value is 1.

This control is similar to the output_multiple setting, except that if the number of items passed to the block is less than the output_multiple, this value is ignored and the block can produce like normal. The d_unaligned value is set to the number of items the block is off by. In the next call to general_work, the noutput_items is set to d_unaligned or less until d_unaligned==0. The buffers are now aligned again and the aligned calls can be performed again.

Covid-19: зачем мы сидим на карантине, и ответы на другие вопросы

Привет Хабр.
Изначально я не планировал публиковать здесь статью про коронавирус, аналитики на хабре уже более чем достаточно. Однако, читая разные местечковые форумы и соцсети, я с удивлением обнаружил сколько достаточно вредных мифов гуляет в сети, и что обычные люди, не специалисты, в это увы, верят. В итоге, после 10го ответа очередному юзеру на очередное сообщение «коронавирус не хуже гриппа», возникла идея создать FAQ на который можно просто давать ссылку, где бы понятным простым языком развенчивались наиболее популярные мифы.
КДПВ не будет, картинка с вирусом уже наверно и так всем надоела.
Статья рассчитана на широкую аудиторию, те кто всё это уже знают, могут не тратить свое время, вряд ли они найдут что-то новое. Я знаю, что многим не нравятся статьи формата «для чайников», но готов рискнуть. Тех кому интересно, приглашаю под кат. Как хабрабонус, в конце будет Python-код для желающих поэкспериментировать с графиками самостоятельно.

Прием

Чтобы передать сигнал, сначала нужно его принять и сохранить как образец. Запускаем GNU Radio Companion и собираем из блоков схему.

Прием в GNU Radio

GNU Radio ориентирована на поточную обработку данных, в ней можно создавать из блоков схему, которая будет выполнять операции. В данном случае мы имеем только два блока: Source (источник) и Sink (приемник, буквально «слив»). Я использую SDR USRP, поэтому в качестве источника — USRP Source. В твоем случае устройство может быть другим — ищи в документации к твоему SDR. В качестве приемника используется FFT Sink — блок визуализации данных, который позволит нам увидеть наличие сигнала. Он не обязателен для записи, но без него будет непонятно, принимаем мы сигнал или нет.

В свойствах приемника я также указал частоту, на которой мы хотим принимать, — 434 МГц. Частоту дискретизации (sample rate) я установил равной 128 000, этого достаточно для записи сигнала. Запускаем проект в GNU Radio, подносим пульт поближе к антенне, нажимаем на нем любую кнопку, и, если все было сделано правильно, мы увидим хорошо заметный всплеск сигнала на спектре.

Спектр сигнала в GNU Radio

Если сигнал виден нормально, мы можем его записать. Добавляем блок File Sink.

Схема в GNU Radio с блоком записи

GNU Radio для Windows требует абсолютные пути файлов, иначе ничего не работает. В Linux такой проблемы нет.

Запускаем программу, нажимаем кнопку на пульте, закрываем программу. В указанной нами папке должен появиться файл размером примерно 5 Мбайт, содержащий наш сигнал. Его можно открыть в любом аудиоредакторе, например в Cool Edit, если выбрать тип файла «стерео» (в SDR пишутся два канала, называемых I и Q) и тип данных . Мы же откроем его с помощью Python и библиотеки для научных расчетов NumPy.

Записанный файл не имеет заголовка , а содержит непосредственно данные , так что частоту дискретизации и тип данных необходимо указать вручную. Также с помощью входной одномерный массив преобразуется в двумерный: запись у нас содержит два канала. Для удобства отображения я вывожу только один канал.

Запускаем программу и видим наш сигнал.

Сигнал в Matplotlib

Чтобы избежать искажения, уровень записи не должен быть слишком высоким и упираться в 1.0. При этом он не должен и быть слишком низким, иначе качество передаваемого сигнала будет плохим. Уровень сигнала между 0.5 и 1.0 — оптимальный. В моем случае было достаточно держать пульт при записи в нескольких сантиметрах от антенны.

Если ты не видишь ничего, а вместо этого выдается ошибка отсутствия библиотеки NumPy или Matplotlib, то нужно их установить:

  • в Windows: ;
  • в Linux: ;
  • в последних версиях macOS: .

Вариант 1. Присоединись к сообществу «Xakep.ru», чтобы читать все материалы на сайте

Членство в сообществе в течение указанного срока откроет тебе доступ ко ВСЕМ материалам «Хакера», увеличит личную накопительную скидку и позволит накапливать профессиональный рейтинг Xakep Score!
Подробнее

Вариант 2. Открой один материал

Заинтересовала статья, но нет возможности стать членом клуба «Xakep.ru»? Тогда этот вариант для тебя!
Обрати внимание: этот способ подходит только для статей, опубликованных более двух месяцев назад.

Я уже участник «Xakep.ru»

◆ band_reject()

static std::vector<float> gr::filter::firdes::band_reject ( double  gain,
double  sampling_freq,
double  low_cutoff_freq,
double  high_cutoff_freq,
double  transition_width,
  window = ,
double  beta =  
)
static

Use «window method» to design a band-reject FIR filter. The normalized width of the transition band is what sets the number of taps required. Narrow –> more taps. Window type determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
low_cutoff_freq center of transition band (Hz)
high_cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz)
window one of
beta parameter for Kaiser window

Step 1: What’s RTL-SDR?

If you are interested only in how to make GRC project go to step 5. RTL-SDR is the cheapest method to get into the world of SDR (Software Defined Radio) — method of receiving (RTL-SDR have no capability to transmit) and processing radio transmission using your PC. Using it you can receive everything that is transmitted between about 20~2000 MHz depending on second chip on the device. In brief it can hear i.e.: — ordinary FM radio stations — police radio transmissions — plane and ship tracking informations — small radio devices like car keys — probably GPS satellites (as of now there is no confirmed method to do this) — International Space Station and other space equipment that transmits below 2 GHz — every other device that you know transmits on these frequencies

◆ band_reject_2()

static std::vector<float> gr::filter::firdes::band_reject_2 ( double  gain,
double  sampling_freq,
double  low_cutoff_freq,
double  high_cutoff_freq,
double  transition_width,
double  attenuation_dB,
  window = ,
double  beta =  
)
static

Use «window method» to design a band-reject FIR filter. The normalized width of the transition band and the required stop band attenuation is what sets the number of taps required. Narrow –> more taps More attenuation –> more taps. Window type determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
low_cutoff_freq center of transition band (Hz)
high_cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz).
attenuation_dB out of band attenuation
window one of
beta parameter for Kaiser window

◆ high_pass()

static std::vector<float> gr::filter::firdes::high_pass ( double  gain,
double  sampling_freq,
double  cutoff_freq,
double  transition_width,
  window = ,
double  beta =  
)
static

Use «window method» to design a high-pass FIR filter. The normalized width of the transition band is what sets the number of taps required. Narrow –> more taps. The window determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz)
window one of
beta parameter for Kaiser window

◆ high_pass_2()

static std::vector<float> gr::filter::firdes::high_pass_2 ( double  gain,
double  sampling_freq,
double  cutoff_freq,
double  transition_width,
double  attenuation_dB,
  window = ,
double  beta =  
)
static

Use «window method» to design a high-pass FIR filter. The normalized width of the transition band and the required stop band attenuation is what sets the number of taps required. Narrow –> more taps More attenuation –> more taps. The window determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz).
attenuation_dB out of band attenuation
window one of
beta parameter for Kaiser window

Софт и API для работы с RTL2832

rtl_sdr

Rtl_sdr – драйвер, обеспечивающий «нецелевое» использование данных с TV-тюнеров на базе rtl2832. В Windows вам придется заменить драйвер тюнера по умолчанию на WinUSB с помощью программы Zadig.

Rtlsdr.dll требуют все SDR-программы, и зачастую эта DLL уже идет в поставке софта, использующего RTL2832.

Rtl_sdr также можно использовать и через консольную утилиту, чтобы протестировать тюнер или слить кусок эфира в файл:

При дальнейшей обработке нужно помнить, что в файле байты I- и Q-потоков идут поочередно.

SDRSharp

SDRSharp — одна из популярных и простых в использовании программ под Windows для работы с RTL2832 (и некоторыми другими SDR). При старте нужно выбрать RTL2832, нажав на кнопку Front-end. Вводить частоту руками нужно в поле Center.

Слева вверху — выбор типа демодулирования. FM используется для обычного FM-вещания и аудио в аналоговом телевидении, AM — в радиостанциях на низких частотах и переговоров самолетов, NFM — в рации.

Прием переговоров по рации на частоте 446 МГц в SDRSharp

Многие внешние декодеры цифровых передач работают через «аналоговый» интерфейс — то есть ты запускаешь SDRSharp, устанавливаешь программу Virtual Audio Cable (программа платная), настраиваешь SDRSharp, чтобы он декодированный звук выводил в VAC, и в системных настройках Windows указываешь VAC как устройство записи по умолчанию. В результате внешняя программа-декодер будет получать звук от SDRSharp.

Таким образом подключаются декодеры P25 раций (милиция), данных с метеоспутников, пейджеров, навигационных сообщений самолетов (ADS-B) и многого другого (об этом ниже). Такой необычный способ подключения сложился исторически — раньше к компьютеру подключали аналоговые приемники. Со временем декодеры дописывают, чтобы они напрямую работали с RTL-SDR.

GNU Radio

GNU Radio — настоящий зубр SDR. Это программный пакет, предназначенный для обработки данных, полученных от SDR-приемника, в реальном времени. Являющаяся стандартом де-факто для всех более-менее профессиональных забав в области радио, программа построена на модульной основе с учетом парадигмы ООП. Это настоящий радиоконструктор, в котором роль элементов отведена функциональным блокам: фильтрам, модуляторам/демодуляторам и несметному множеству других примитивов обработки сигналов. Таким образом, имеется возможность составить из них практически любой тракт обработки. Делается это в прямом смысле слова в несколько кликов мышкой в наглядном графическом редакторе, имя которому gnuradio-companion. Более того, gnuradio-companion написан на Python и позволяет генерировать схемы на Python. Но у такой гибкости есть и обратная сторона — освоить GNU Radio за десять минут невозможно.

◆ set_min_output_buffer() [2/2]

void gr::block::set_min_output_buffer ( int  port,
long  min_output_buffer 
)

Request limit on min buffer size on output port .

This is an advanced feature. Calling this can affect some fundamental assumptions about the system behavior and performance.

The actual buffer size is determined by a number of other factors from the block and system. This function only provides a requested minimum. The buffers will always be a multiple of the system page size, which may be larger than the value asked for here.

Parameters
port the output port the request applies to.
min_output_buffer the requested minimum output size in items.

Common command keys

The following command keys are understood by both UHD Source and Sink:

Command name Value Type Description
int Specifies a channel. If this is not given, either all channels are chosen, or channel 0, depending on the action. A value of -1 forces ‘all channels’, where possible.
double Sets the Tx or Rx gain (in dB). Defaults to all channels.
double Sets the Tx or Rx frequency. Defaults to all channels. If specified without , it will set the LO offset to zero.
double Sets an LO offset. Defaults to all channels. Note this does not affect the effective center frequency.
tune_request Like freq, but sets a full tune request (i.e. center frequency and DSP offset). Defaults to all channels.
double For fully manual tuning: Set the LO frequency (RF frequency). Conflicts with , , and .
double For fully manual tuning: Set the DSP frequency (CORDIC frequency). Conflicts with , , and .
string Used for timed transceiver tuning to ensure tuning order is maintained. Values other than ‘TX’ or ‘RX’ will be ignored.
double See usrp_block::set_samp_rate(). Always affects all channels.
double See usrp_block::set_bandwidth(). Defaults to all channels.
timestamp Sets a command time. See usrp_block::set_command_time(). A value of PMT_NIL will clear the command time.
int Specify mboard index, where applicable.
string See usrp_block::set_antenna(). Defaults to all channels.

Special types:

  • tune_request: Like a uhd::tune_request_t, but always uses POLICY_AUTO. This is a pair, composed of (target_frequency, lo_offset)
  • timestamp: A pair composed of (long full_secs, double frac_secs). Similar to uhd::time_spec_t

Note: Not all commands are affected by . See the UHD manual for details on timed commands.

Installation Options[edit]

GNU Radio is designed to be flexible. It has a number of modules, capabilities, and options that can be enabled or disabled to suit the needs of the user, and the user can add custom blocks or modules to the system.

To support this flexibility, it comes with a set of files and scripts to be used with GNU software build tools (sh, make, autoconf, automake, etc.). These tools use Linux-like commands and filenames that are not normally available on Windows systems.

Fortunately, we are not the first to face this problem, and several solutions exist. These are presented in order of increasing difficulty:

Building on Windows with Native Toolsedit

  1. Build all dependencies from source (including python itself)
  2. Download a prebuilt custom dependency package and then build only GNURadio and a few OOT modules on top.

The binary installers described above are built with these scripts. They ensure that all dependencies are built with the same toolchain against the same runtime libraries, and handle the patches and configuration «tweaks» needed to build them on Windows.
If option 1 is desired, note that to build scipy, the non-free Intel Fortran compiler is required, gfortran cannot build objects that can link with MSVC C objects. If you do not have said compiler, the scripts will download pre-compiled wheels instead.

MinGW/MSYSedit

Because there is no Linux API emulation, GNU Radio built with MinGW should be used with standard Windows versions of Python and the third-party libraries.MinGW does not provide as much support as Cygwin for installing third-party libraries, but in many cases precompiled binaries are available.

For detailed installation instructions using MinGW and MSYS see Installing GNU Radio with MinGW.

Cygwinedit

Because the Linux API uses its own C runtime library, it is best to use Cygwin versions of Python and the third-party libraries when building GNU Radio with Cygwin.

For detailed installation instructions using Cygwin see Installing GNU Radio with Cygwin.

Chocolateyedit

To install, open an Administrative command line session and run:

choco source add -name gnuradio -source C:\<path-to>\chocolatey-packages

Create the numpy package:

cd <path-to>\chocolatey-package\numpy
cpack

Create the gnuradio package:

cd <path-to>\chocolatey-package\gnuradio
cpack

Now install the gnuradio package:

choco install gnuradio

Follow the command prompts.

◆ set_max_output_buffer() [2/2]

void gr::block::set_max_output_buffer ( int  port,
long  max_output_buffer 
)

Request limit on max buffer size on output port .

This is an advanced feature. Calling this can affect some fundamental assumptions about the system behavior and performance.

The actual buffer size is determined by a number of other factors from the block and system. This function only provides a requested maximum. The buffers will always be a multiple of the system page size, which may be larger than the value asked for here.

Parameters
port the output port the request applies to.
max_output_buffer the requested maximum output size in items.

◆ low_pass()

static std::vector<float> gr::filter::firdes::low_pass ( double  gain,
double  sampling_freq,
double  cutoff_freq,
double  transition_width,
  window = ,
double  beta =  
)
static

Use «window method» to design a low-pass FIR filter. The normalized width of the transition band is what sets the number of taps required. Narrow –> more taps. Window type determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz)
window one of
beta parameter for Kaiser window

◆ get_tags_in_range() [2/2]

void gr::block::get_tags_in_range ( std::vector< tag_t > &  v,
unsigned int  which_input,
uint64_t  abs_start,
uint64_t  abs_end,
const &  key 
)
protected

Given a [start,end), returns a vector of all tags in the range with a given key.

Range of counts is from start to end-1.

Tags are tuples of: (item count, source id, key, value)

Parameters
v a vector reference to return tags into
which_input an integer of which input stream to pull from
abs_start a uint64 count of the start of the range of interest
abs_end a uint64 count of the end of the range of interest
key a PMT symbol key to filter only tags of this key

Что такое SDR

Кому может понадобиться такая радиола? Радиолюбителям, которые здорово эволюционировали! Двадцать лет назад увлеченный человек покупал сложный приёмник и часами сидел в наушниках, вращая частоты в поисках интересных сигналов. В современном мире радиоэфир переполнен информацией, но вся она цифровая. Слушать в наушниках пакеты Wi-Fi не представляет никакого интереса. Сегодня радиолюбитель находит в эфире интересные цифровые радиостанции, а потом подбирает софт, который разбирает протокол передачи и преобразует информацию. К примеру, можно принимать данные телеметрии гражданской авиации – на основе такого рода информации от множества радиолюбителей по всему миру сайт flightradar публикует данные о воздушных судах.

Вы можете прямо сейчас своими глазами увидеть работу Software Defined Radio. Университет Твенте содержит увлекательный проект онлайн SDR-приёмника, который принимает сразу кусок спектра шириной в 29MHz, после чего радиолюбители могут параллельно прослушивать различные несущие этого диапазона. Каталог подобных радиопроектов собран на сайте

Большую роль в популярности любительского SDR играет небольшая стоимость минимального комплекта оборудования. Обнаружились недорогие TV-тюнеры, реализованные на Software-Defined Radio, и в интернете немедленно появились инструкции о том, как использовать такие тюнеры, чтобы прослушивать с их помощью не только телевизионный сигнал. Специализированный комплект на китайском рынке стоит всего 35$ правда, он приходит разобранным (в необходимости предварительно спаять и заключается его шарм) и поддерживает диапазон только 100KHz-1.7GHz. Конечно, аппетит приходит во время еды, и очень скоро радиолюбитель начинает смотреть в сторону оборудования, которое может принимать широкие частотные диапазоны на высокой скорости. Давайте рассмотрим, какие серьёзные приборы сейчас наиболее популярны.

Название Диапазон Макс. ширина канала ADC Sample Rate Цена
hackRF One 1MHz — 6GHz 20MHz 20MSPS $299
bladeRF x40 300MHz — 3.8GHz 28MHz 38.4MSPS $420
USRP B205mini-i 70 MHz — 6 GHz 56MHz 61.44MSPS $750
LimeSDR (coming soon) 100 kHz — 3.8 GHz 61.44MHz 61.44MSPS $299
RTL-SDR (receive only) 22 MHz — 3.8 GHz (24 – 1766 MHz для R820T2) 3.2MHz 3.2MSPS $10
Per Vices Crimson 0 MHz — 6 GHz 1200MHz 370MSPS $6500

В двух словах: начинать знакомство с SDR можно с дешёвых вариантов типа RTL-SDR. Когда аппетит исследователя превысит небольшие возможности устройства, придётся искать замену подороже. Устройства типа Per Vices Crimson используются очень серьёзными специалистами, чьи компьютеры достаточно производительны для обработки таких потоков информации. LimeSDR на данный момент только-только закончил сбор средств на Kickstarter. Выглядит очень заманчиво: частота семплирования максимальна для USB3.0, а ширина канала достаточна для поднятия шести 10MHz сот LTE.

Однако, ещё недавно выбор не был так велик, и если не устраивал hackRF за $300, то следующим вариантом был USRP сразу за $750, и никакого компромисса. В связи с этим, шестнадцатилетний Лукас Лао Бейер решил самостоятельно разработать SDR-плату и недавно опубликовал отчёт о своём проекте. Сказать, что мы были поражены – ничего не сказать, лучше просто промолчать.

◆ band_pass()

static std::vector<float> gr::filter::firdes::band_pass ( double  gain,
double  sampling_freq,
double  low_cutoff_freq,
double  high_cutoff_freq,
double  transition_width,
  window = ,
double  beta =  
)
static

Use «window method» to design a band-pass FIR filter. The normalized width of the transition band is what sets the number of taps required. Narrow –> more taps. The window determines maximum attenuation and passband ripple.

Parameters
gain overall gain of filter (typically 1.0)
sampling_freq sampling freq (Hz)
low_cutoff_freq center of transition band (Hz)
high_cutoff_freq center of transition band (Hz)
transition_width width of transition band (Hz).
window one of
beta parameter for Kaiser window

Using vector sinks and sources[edit]

If you’re running a typical simulation which repeats the exact same experiment many times, thereby slightly changing some parameter (e.g. SNR), this might be one of the rare cases when using Vector Sources and Sinks might be sensible (the other case being unit tests, which are essentially very similar).

In the above example, this is what you could do:

  1. Replace the random source with a vector source
  2. Replace the scope sinks with vector sinks
  3. Write a loop which restarts the flow graph for several different values of BER on the BSC
  4. For every loop iteration, put in a large number of bits in the vector source, run the flow graph and calculate the average of the elements in the vector sink. This would be your average BER at the receiver for a given BER on the channel.

One example of this is source:gr-digital/examples/berawgn.py, which creates the following result:

Common cmake flags[edit]

  • This enables (or disables for =OFF) the GNU Radio component named XXX. You might not need all of them, and this way, you can compile quicker.
  • Install your stuff to XXX.
  • This causes gcc to add debug symbols to all binaries. Useful for debugging (otherwise, it decreases efficiency!)
  • This selects the Python version and executable to be used during build time and will determine which Python libraries will be used for building the Python bindings.

Using PyBOMBSedit

PyBOMBS is good at building GNU Radio, UHD, and various Out of Tree (OOT) modules from source and then installing into a specified user directory rather than in the system files. PyBOMBS detects the user’s Operating System and loads all of the prerequisites in the first stage of the build.

OK, it’s installed, what now?edit

If the installation worked without any trouble, you’re ready to use GNU Radio! If you have no idea how to do that, the best place to start is with the Tutorials.

Example Flowgraph[edit]

The example flowgraph below is taken from Guided_Tutorial_Hardware_Considerations. It shows how the message ports can be connected so that changing the frequency from within the QT GUI Sink (by double clicking on the X-axis) is propagated to the USRP. Even though it is hidden by the GUI Sink block, there is a connection from the output message port (freq) on the left to the input message port (freq) on the right. Variables are used to set the sample rate, RF gain, and initial tuning.

A significant drawback to the method above is that once a frequency is selected by double clicking, the frequency displayed in the GUI Range is no longer correct. To remedy this situation, messages can be used to change all of the run-time functions. Two approaches are presented here. The first is to use a QT GUI Message Edit Box. Not only can it generate commands, but it can display commands from other sources such as a QT GUI Sink. That way, the parameter (such as frequency) is always displayed correctly. The following flowgraph using this method not only sets the frequency, but also the RF gain.

Setting up the GQRX Experimental Branch for the PlutoSDR

First set up GNU Radio and gr-iio using the instructions from this Reddit thread.

Now install gr-osmosdr-gqrx with the iiodev branch.

git clone https://github.com/csete/gr-osmosdr-gqrx
cd gr-osmosdr-gqrx/
git checkout plutosdr
mkdir build
cd build/
cmake ../
make
sudo make install
sudo ldconfig

Install the GQRX prerequisites

sudo apt-get install git build-essential cmake qtbase5-dev qt5-default qtscript5-dev libssl-dev qttools5-dev qttools5-dev-tools qtmultimedia5-dev libqt5svg5-dev libqt5webkit5-dev libsdl2-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-jackd2-dev libxrandr-dev libqt5xmlpatterns5-dev libqt5xmlpatterns5 libqt5xmlpatterns5-private-dev pulseaudio

Install GQRX

git clone https://github.com/csete/gqrx.git gqrx.git
cd gqrx.git
mkdir build
cd build
cmake ..
make
sudo make install

Now GQRX should be ready to use the PlutoSDR. In the GQRX confiuguration screen select the device as Other or PlutoSDR and set the device string as “plutosdr=0”. Then you can set your sample rate and RF bandwidth, decimation etc. If you’ve done the frequency range hack then remember to select “No limits” in GQRX so that you can actually tune down further.

Note that in VMWare Lubuntu we were only able to get stable audio from the PlutoSDR and GQRX at a maximum of 3 MHz. Anywhere between 3 – 60 MHz bandwidth the PlutoSDR and GQRX spectrum and waterfall runs smoothly, but the audio is crackly. Might be a VMWare problem, or maybe something that can be fixed in later GQRX releases.

We also tested the PlutoSDR together with the SpyVerter upconverter for HF reception. It seemed to work well.

The images below show the PlutoSDR working in GQRX. The images of the 2.4 GHz and 1.8 GHz bands show that there is little to no attenuation at the edges of the 60 MHz bandwidth, so the upgrade from 20 MHz to 60 MHz is working well.

Detailed Description

The abstract base class for all ‘terminal’ processing blocks.

A signal processing flow is constructed by creating a tree of hierarchical blocks, which at any level may also contain terminal nodes that actually implement signal processing functions. This is the base class for all such leaf nodes.

Blocks have a set of input streams and output streams. The input_signature and output_signature define the number of input streams and output streams respectively, and the type of the data items in each stream.

Blocks report the number of items consumed on each input in , using or .

If the same number of items is produced on each output, the block returns that number from . Otherwise, the block calls for each output, then returns WORK_CALLED_PRODUCE. The input and output rates are not required to be related.

User derived blocks override two methods, forecast and general_work, to implement their signal processing behavior. forecast is called by the system scheduler to determine how many items are required on each input stream in order to produce a given number of output items.

general_work is called to perform the signal processing in the block. It reads the input items and writes the output items.

◆ get_tags_in_window() [1/2]

void gr::block::get_tags_in_window ( std::vector< tag_t > &  v,
unsigned int  which_input,
uint64_t  rel_start,
uint64_t  rel_end 
)
protected

Gets all tags within the relative window of the current call to work.

This opperates much like get_tags_in_range but allows us to work within the current window of items. Item range is therefore within the possible range of 0 to ninput_items.

Range of items counts from to within current window.

Tags are tuples of: (item count, source id, key, value)

Parameters
v a vector reference to return tags into
which_input an integer of which input stream to pull from
rel_start a uint64 count of the start of the range of interest
rel_end a uint64 count of the end of the range of interest

Referenced by .

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector