Lately, I tried to read some signals with LimeSDR, but had some uncertainties about Bandwidth. When I use the setBandwidth function in code and set it to a value not equal to half sampling frequency is not really working.
My question is the following: if Bandwidth is not provided, will it always take fs/2 and if provided, is it usually works with a given value? Also, it will be great to know what exactly does setting BW do inside Lime.
I have LimeSDR USB.
Use the source Luke, use the source!
setBandwidth is to be found:
void SoapyLMS7::setBandwidth(const int direction, const size_t channel, const double bw) <=> https://github.com/myriadrf/LimeSuite/blob/master/SoapyLMS7/Settings.cpp#L543
Which calls setBBLPF which is to to be found:
int SoapyLMS7::setBBLPF(bool direction, size_t channel, double bw) <=> https://github.com/myriadrf/LimeSuite/blob/master/SoapyLMS7/Settings.cpp#L522
Which calls SetLPF which is to to be found:
int LMS7_Device::SetLPF(bool tx,unsigned chan, bool en, double bandwidth) <=> https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_device.cpp#L742
Which calls GetLPFRange to find out the valid values for bandwidth,
if your bandwidth is too low, then the minimum is selected.
if your bandwidth is too high, then the maximum valid bandwidth is selected
Once a valid bandwidth is found then TuneRxFilter is called to set it
LMS7_Device::Range LMS7_Device::GetLPFRange(bool tx, unsigned chan) const <=> https://github.com/myriadrf/LimeSuite/blob/master/src/API/lms7_device.cpp#L788
For TX min bandwidth is: 5e6 Hz
For RX min bandwidth is: 1.4001e6 Hz
int LMS7002M::TuneRxFilter(float_type rx_lpf_freq_RF) <=> https://github.com/myriadrf/LimeSuite/blob/master/src/lms7002m/LMS7002M_filtersCalibration.cpp#L77
This talks to the MCU and asks it to set the bandwidth:
Afterwards it reads the SPI registers from the LMS7002M, the ones that would have been updated by the actions of the MCU. So that the cached SPI resisters in the computers memory are synced with the state inside the the SDR hardware.
void MCU_BD::SetParameter(MCU_Parameter param, float value) <=> https://github.com/myriadrf/LimeSuite/blob/master/src/lms7002m_mcu/MCU_BD.cpp#L1039
The MCU talks over SPI to the LMS7002M chip and configures registers to do with bandwidth inside the chip, a document describing the SPI registers*** can be found:
LMS7002Mr2-SPIRegs-2-2r0.pdf @ https://github.com/myriadrf/LMS7002M-docs
There are a fixed number of bandwidths for the analogue lowpass filters inside the LMS7002M chip. See plots in sections 10.3,10.4,10.5,10.6 of the datasheet https://wiki.myriadrf.org/LimeMicro:LMS7002M_Datasheet#TX_and_RX_low-pass_filters - at a guess hidden in the maths the filter size that is the nearest match to your required bandwidth will be selected
*** I always feel like that document is missing some registers.
Thank you so much! This was exactly what I was looking for:)
this is one of my questions of LimeSDR mini RF receive front end?
for a buy - or not question i would expect the answer to be found in a spec or datasheet document per device model!
however, dived into the referenced source of LimeSuite/MCU_BD.cpp at master · myriadrf/LimeSuite · GitHub
thanks @mzs for the links.
i don’t see any bandwidth values for analog filters sitting between antenna and the ADC !?
and “if(param==MCU_REF_CLK || param == MCU_BW)” lets me assume, that just some digital clock is modified … !?
i need more explanation on this. are there any analog filters in front of the ADC?
“if(param==MCU_REF_CLK || param == MCU_BW)” this code purpose is only just to place a value into variable for other procedures to pickup.
perhaps what you’re looking for is: LimeSuite/lms7002m_filters.c at master · myriadrf/LimeSuite · GitHub
what I’m looking for would be a document similar to Playing with the Airspy R820T IF bandwidth | TLeconte.github.io
listing a bunch a bandwidth values - ideally with frequency response plots like in above reference.
a min/max range, as you point, is imho not realizable in analog hardware … that’s why I’m asking for an effective list of bandwidths.
however, I’ll check the source, you pointed me, when back at home.
I’m not asking for digitally calculated filter bandwidth, which are calculated with the adc converted samples.
well then maybe this will be usefull LMS7002M-docs/LMS7002M_Measurements-v1_05.pdf at master · myriadrf/LMS7002M-docs · GitHub there seems to be plenty of various analog measurements and frequency response charts
@ricardas : thanks, that is the right direction … and pointed me to that repository with at least one other relevant document. LimeSuite/lms7002m_filters.c at master · myriadrf/LimeSuite · GitHub looks to be the right place … but isn’t really readable without a human translator!
on a PC now: this is exactly what i also think … and LMS7002M-docs/LMS7002M_Measurements-v1_05.pdf at master · myriadrf/LMS7002M-docs · GitHub also doesn’t uncover.
from the source of LimeSuite/MCU_BD.cpp at master · myriadrf/LimeSuite · GitHub
one might assume, that the resolution for bandwidth is in 256 kHz steps … but with the register for the integer part of the bandwidth in MHz … and the seconds one for the fractional part, IMHO this is way too many!
thus, i doubt that any given bandwidth (in steps of 256 kHz) is accepted and applied … and assume, that there are only a limited number of applied values in the range from 0.75 MHz to 20 MHz.
would someone be so kind to document these and post them here?
to which hardware models would this apply? containing especially LimeSDR mini (2.0)?