JuliaTelecom / SoapySDR.jl

Julia Wrappers for SoapySDR
https://juliatelecom.github.io/SoapySDR.jl/dev/
Other
14 stars 3 forks source link

Setting Rx- & Tx-SamplingRate individually #49

Closed TheoBr24 closed 2 years ago

TheoBr24 commented 2 years ago

On Windows 10, Julia 1.6.3 Hardware: Adalm-Pluto SDR

When I set "sample_rate" to different values for the Tx and Rx Channel, then the value of both becomes the value of the sampling_rate which was changed last.

I run my AdalmPluto in a loopback-configuration, so the property "fullduplex" for both channels is true.

Is this just a limitation of the Hardware or Software, or is there some way to set the sampling rates to individual values? Or could the fullduplex-mode force the channels to the same sampling rate?

I'm not that experienced with SDRs, sorry if the answer is obvious :) Thanks for any help.

              _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.3 (2021-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.6) pkg> status SoapySDR
      Status `C:\Users\Theo\.julia\environments\v1.6\Project.toml`
  [4fa426e6] SoapySDR v0.2.0

(@v1.6) pkg> status SoapyPlutoSDR_jll
      Status `C:\Users\Theo\.julia\environments\v1.6\Project.toml`
  [96b01697] SoapyPlutoSDR_jll v0.2.1+0

julia> using SoapySDR

julia> using SoapyPlutoSDR_jll

julia> device = open(Devices()[1])
SoapySDR ADALM-PLUTO device
  driver: PlutoSDR
  number of TX channels:1
  number of RX channels:1
  sensors: SoapySDR.SensorComponent[xadc_temp0,xadc_voltage0,xadc_voltage1,xadc_voltage2,xadc_voltage3,xadc_voltage4,xadc_voltage5,xadc_voltage6,xadc_voltage7,xadc_voltage8,adm1177_current0,adm1177_voltage0,ad9361-phy_temp0,ad9361-phy_voltage2,]
  time_source:
  time_sources:SoapySDR.TimeSource[]
  frontendmapping_rx:
  frontendmapping_tx:

julia> tx_chan = device.tx[1]
TX Channel #1 on ADALM-PLUTO
  antenna: A
  antennas: SoapySDR.Antenna[A,]
  bandwidth [ 200..200 kHz, 1..1 MHz, 2..2 MHz, 3..3 MHz, 4..4 MHz, 5..5 MHz, 6..6 MHz, 7..7 MHz, 8..8 MHz, 9..9 MHz, 10..10 MHz ]: 1.0 MHz
  frequency [ 70 MHz .. 6 GHz ]: 1.0 GHz
    RF [ 70 MHz .. 6 GHz ]: 1.0 GHz
  gain_mode (AGC=true/false/missing): missing
  gain: 30.0 dB
  gain_elements: SoapySDR.GainElement[PGA,]
  fullduplex: true
  stream_formats: DataType[Complex{Int8}, SoapySDR.ComplexInt{12}, Complex{Int16}, ComplexF32]
  native_stream_format: Complex{Int16}
  sample_rate [ 65.1..65.1 kHz, 1..1 MHz, 2..2 MHz, 3..3 MHz, 4..4 MHz, 5..5 MHz, 6..6 MHz, 7..7 MHz, 8..8 MHz, 9..9 MHz, 10..10 MHz ]: 999.999 kHz
  dc_offset_mode (true/false/missing): missing
  dc_offset (if has dc_offset_mode): missing
  iq_balance_mode (true/false/missing): missing
  iq_balance: missing
  frequency_correction: missing ppm

julia> rx_chan = device.rx[1]
RX Channel #1 on ADALM-PLUTO
  antenna: A_BALANCED
  antennas: SoapySDR.Antenna[A_BALANCED,]
  bandwidth [ 200..200 kHz, 1..1 MHz, 2..2 MHz, 3..3 MHz, 4..4 MHz, 5..5 MHz, 6..6 MHz, 7..7 MHz, 8..8 MHz, 9..9 MHz, 10..10 MHz ]: 1.0 MHz
  frequency [ 70 MHz .. 6 GHz ]: 1.0 GHz
    RF [ 70 MHz .. 6 GHz ]: 1.0 GHz
  gain_mode (AGC=true/false/missing): false
  gain: 73.0 dB
  gain_elements: SoapySDR.GainElement[PGA,]
  fullduplex: true
  stream_formats: DataType[Complex{Int8}, SoapySDR.ComplexInt{12}, Complex{Int16}, ComplexF32]
  native_stream_format: Complex{Int16}
  sample_rate [ 65.1..65.1 kHz, 1..1 MHz, 2..2 MHz, 3..3 MHz, 4..4 MHz, 5..5 MHz, 6..6 MHz, 7..7 MHz, 8..8 MHz, 9..9 MHz, 10..10 MHz ]: 999.999 kHz
  dc_offset_mode (true/false/missing): missing
  dc_offset (if has dc_offset_mode): missing
  iq_balance_mode (true/false/missing): missing
  iq_balance: missing
  frequency_correction: missing ppm

julia>

julia> tx_chan.sample_rate = 2u"MHz"
2 MHz

julia> tx_chan.sample_rate
1.999999e6 Hz

julia>

julia> rx_chan.sample_rate = 1u"MHz"
1 MHz

julia> rx_chan.sample_rate
999999.0 Hz

julia>

julia> tx_chan.sample_rate
999999.0 Hz

julia> rx_chan.sample_rate
999999.0 Hz

julia>

julia> rx_chan.fullduplex
true

julia> tx_chan.fullduplex
true
sjkelly commented 2 years ago

Is this just a limitation of the Hardware or Software, or is there some way to set the sampling rates to individual values? Or could the fullduplex-mode force the channels to the same sampling rate?

In general, asymmetric sample rates are not supported by transceiver IC hardware since the data interface is usually on a shared clock.

I do think this should be more explicit though that the sample rates are generally symmetric on RX/TX.