If you are familiar with matlab, maybe you can try my matlab scanner.
It is easy to change frequency range, RBW, etc, and get spectrum picture.
Please google:
" rtl sdr matlab scanner"
Good luck!
393775602 <393775602(a)qq.com> wrote:
>Hi,
>
> i am doing a project to get a certain fequencyspectrum . And thanks to the wonderful tool rtl_power, i can get some dbm data over a very wide area of the frequency specturm.
>
> and i read the source code in order to change it to get a certain frequency specturm.Sadly, i know little about digital signal processiong and getting a hard time solving it.
>
> does anyone know how to get a certain fequencyspectrum using rtl_power or some other tool.
>
>
>
> sincerely
>
> Chen Zujie
>
After playing around with the E4000 tuner gain settings, I will
summarize my results.
LNA Gain Enhancement
--------------------
LNA Gain Enhancement is working in automatic mode but not in manual mode.
To enable LNA enhancement, write 0x05 to register AGC11. This can be
left unchanged even when enabling manual gain mode.
Required updates for tuner_e4k.c:
Function e4k_enable_manual_gain():
Remove or comment the line that disables LNA Enhancement for auto mode
e4k_reg_set_mask(e4k, E4K_REG_AGC11, 0x7, 0);
Function e4k_init():
Pull line out of null condition to enable LNA Enhancement
e4k_reg_set_mask(e4k, E4K_REG_AGC11, 0x7, E4K_AGC11_LNA_GAIN_ENH |
(2 << 1));
Automatic Mode
--------------
The mixer control register AGC7 defines a threshold value. When
automatic mixer control is enabled and the LNA gain index reaches the
threshold value, the high mixer gain of 12 dB will be used. Upon reset,
the AGC7 register is cleared and the threshold value is never set by the
RTLSDR library. This results in always using the high mixer gain
(threshold value 0 corresponds to the lowest LNA gain).
The datasheet recommends writing 0x15 to AGC7. This corresponds to a
threshold of 15 dB (0x15 >> 1 = 0x0A LNA gain index). A value of 0x1D
would set the threshold to max. LNA gain.
NOTE:
When LNA Enhancement is enabled, setting the threshold to max. gain is
not useful. There will be a strong gain increasement step from 25 + 4 =
29 dB to 25 + 5 + 12 = 42 dB.
Required updates for tuner_e4k.c:
Function e4k_init():
Replace the line
e4k_reg_set_mask(e4k, E4K_REG_AGC7, E4K_AGC7_MIX_GAIN_AUTO, 0);
with this
e4k_reg_write(e4k, E4K_REG_AGC7, 0x14);
The above modification will set the threshold value and disable auto
mixer gain control. e4k_enable_manual_gain() is called later and will
modify only bit 0 of AGC7.
Manual Mode
-----------
In manual mode LNA enhancement is not used. So the list of gains must be
changed because the last two values assume that it is used.
The actually used gains are based on Table 6 and the register map of the
E4000 data sheet. The gain table contains those values plus the mixer
gain of 12 db for the last value and 4 db for all others. But the LNA
gain of 30 dB specified in the data sheet is only valid when LNA gain
enhancement is enabled.
Cite from data sheet section 1.16 LNA Gain enhancement referring
register AGC7:
"The LNA gain numbers quoted throughout this document assume that this
register is programmed to the recommended value."
Even when LNA Enhancement would work with manual mode, the second to
last value is wrong because LNA enhancement requires that the mixer gain
is at 12 dB.
Required updates for librtlsdr.c:
Change int e4k_gains[] from
const int e4k_gains[] = {
-10, 15, 40, 65, 90, 115, 140, 165, 190, 215, 240, 290, 340, 420
};
to
const int e4k_gains[] = {
-50 + 40, -25 + 40, 0 + 40, 25 + 40, 50 + 40, 75 + 40,
100 + 40, 125 + 40, 150 + 40, 175 + 40, 200 + 40, 250 + 40,
200 + 120, // 320, optional additional entry
250 + 120
};
Change top of e4000_set_gain() function from
int e4000_set_gain(void *dev, int gain) {
rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
int mixgain = (gain > 340) ? 12 : 4;
if(e4k_set_lna_gain(&devt->e4k_s, min(300, gain - mixgain * 10)) ==
-EINVAL)
to
int e4000_set_gain(void *dev, int gain) {
rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
int mixgain = (0 == (gain - 120) % 25) ? 12 : 4;
if(e4k_set_lna_gain(&devt->e4k_s, gain - mixgain * 10) == -EINVAL)
The above extraction of the mixer gain from the combined LNA and mixer
gain can be used for all possible valid LNA/mixer gain combinations.
Required updates for tuner_e4k.c:
Change last value of static const int32_t lnagain[] from 300 to 250
Optionally change second to last value from 250 to 249 to force
selection of the highest possible LNA gain index.
The 2-dim array may be also replaced by a smaller 1-dim array
when updating also e4k_set_lna_gain():
static const int32_t lna_gain[16] = {
-50, -25, -50, -25, 0, 25, 50, 75,
100, 125, 150, 175, 200, 249, 250, 250
};
int e4k_set_lna_gain(struct e4k_state *e4k, int32_t gain)
{
uint32_t i;
for(i = 0; i < ARRAY_SIZE(lnagain); ++i) {
if(lnagain[i] == gain) {
e4k_reg_set_mask(e4k, E4K_REG_GAIN1, 0xf, i);
return gain;
}
}
return -EINVAL;
}
Detecting Signal Strength
-------------------------
The signal strength can be calculated by determining the relative
strength of a signal (e.g. using a FFT) and subtracting the total gain.
To get the total gain in automatic mode, read the registers 0x14 to 0x17
(E4K_REG_GAIN1 to E4K_REG_GAIN4) and calculate the gains. Note again
that the max. LNA gain of 30 dB is only valid when LNA enhancement is
enabled and the mixer gain is at 12 dB. Otherwise, the max. LNA gain is
25 dB.
For signals in the range of -50 to -10 dBm, the RSSI indicator can be
also read from register 0x1C (E4K_REG_AGC3) in automatic mode to
calculate the input power in dBm:
double InputPower = 10 * log10(RSSI)) - 28.5 - LNA_Gain;
The above calculation can be used when the RSSI value is in the range
from 5 to 24. Higher RSSI values occur with strong signals at min. LNA
gain and give too low results due to clipped signals.
Jochen Arndt
Hello everyone,
For your informaqtion. My "SVEON 27" start working just adding it to
librtlsdr.c:
{ 0x1b80, 0xd3af, "SVEON STV27 DVB-T USB & FM" },
Aparently it has a F00013 tuner. It is reported by lsusb as:
Bus 002 Device 004: ID 1b80:d3af Afatech
Cheers
Nacho Mas
Hi,
i am studying the rtl-sdr code recently and get it start and receive some data,
and i want to analysis the data by myself, does anyone have a RTL2832U datasheet.
can anyone send me one? or tell me where i can download it or buy it!
Thanks all the same
Chen Zujie
Guys,
As you know, our sample rate is not good enough to decode UAT's FSK in
a conventional way, so I thought to try something else: use 2 samples
per bit to detect the frequency shift. This is obviously unreliable,
but I hoped to see something at least. But it didn't work: seems like
decoding noise.
The code is here:
https://github.com/zaitcev/ruat
Anyone is willing to critique? Where did I go wrong?
Thanks,
-- Pete
The rtl_fm program uses approx 1.8 MByte for it's stack. Mostly used
for 'stuct fm_state'. The default stack-size for a Windows program is
4kB (it can dynamically grow). I've compiled using MSVC v16 and option
'-GS'. Ref: http://support.microsoft.com/kb/100775
Adding '-stack:2000000' to the link stage works fine here. Or alloca() or malloc()
could be used? Or 'fm' could be made static?
--gv
Hi,
i have just transmited the rtl-sdr code into android using NDK,and i start the rtl-sdr and set the fequecny,samp_rate and so on.
Finally i get the output from rtl and write it into a txt file.
Then the problem came, i open the txt and find it a mess, does the output decode in utf-8 or something else,can anyone give me
a look to see what output is like
Thanks a lot
chenzujie
Hi,
As a "side product" of this thread: "How to get IQ samples from multiple
rtl-sdr dongles in a synchronized manner",A scanning tool is released for
identifying all available/detectable GSM broadcasting carrier around you
quickly.
You can find it here:
http://www.mathworks.com/matlabcentral/fileexchange/45152-rtl-sdr-multi-don…
or
https://github.com/JiaoXianjun/multi-rtl-sdr-calibration
By using 3 dongles, we can identify all available/detectable GSM
broadcasting carrier in the whole PGSM band downlink 935~960MHz in 30s (my
intel i7 12-core station) instead of 80s (only one dongles).
The original purpose of project multi-rtl-sdr-calibration is that
calibrating multiple dongles by the common GSM source.
So the first thing need to do is that finding out where is the strongest
GSM signal in the air.
This script (multi_rtl_sdr_gsm_FCCH_scanner.m) can identify GSM downlink
broadcasting carrier by detecting successive multiple FCCH bursts of all
possible carrier in a band you specify, such as PGSM downlink 935~960MHz.
I learn knowledge of GSM frame structure from here:
http://www.sharetechnote.com/html/FrameStructure_GSM.html
After the script is run, quality metrics of detected FCCH channel per
frequency will be displayed: SNR and number of detected FCCH burst (num of
hits).
Note: for speedup detection algorithm, a large decimation ratio is used,
thus shown SNR may be lower than actual SNR. But it is enough to help us
idendify which frequency is best.
README is also pasted here:
Multiple rtl-sdr(rtl_tcp) dongles based GSM FCCH scanner. (
putaoshu(a)gmail.com; putaoshu(a)msn.com)
multi_rtl_sdr_gsm_FCCH_scanner.m
Have multiple dongles run concurrently to speedup detecting FCCH(Frequency
correction channel) burst in wide GSM band by scanning different sub-band
with different dongle.
This is a sub script of project:
https://github.com/JiaoXianjun/multi-rtl-sdr-calibration
------------Purpose------------
The original purpose of project multi-rtl-sdr-calibration is that
calibrating multiple dongles by the common GSM source.
So the first thing need to do is that finding out where is the strongest
GSM signal in the air.
This script can identify GSM downlink broadcasting carrier by detecting
successive multiple FCCH burst.
I learn knowledge of GSM frame structure from here:
http://www.sharetechnote.com/html/FrameStructure_GSM.html
After the script is run, quality metrics of detected FCCH channel will be
displayed: SNR and number of detected FCCH burst (num of hits).
Note: for speedup detection algorithm, a large decimation ratio is used,
thus shown SNR may be lower than actual SNR. But it is enough to help us
idendify which frequency is best.
-------------Usage-------------
1. Assume that you have installed rtl-sdr
(http://sdr.osmocom.org/trac/wiki/rtl-sdr) and have those native utilities
run correctly already.
For example, you have multiple dongles, please run multiple rtl_tcp in
multiple shell respectively as:
rtl_tcp -p 1234 -d 0
rtl_tcp -p 1235 -d 1
rtl_tcp -p 1236 -d 2
...
2. Then run multi_rtl_sdr_gsm_FCCH_scanner.m in MATLAB.
ATTENTION! In some computer, each time before you run script, maybe you
need to terminate multiple rtl_tcp and re-launch them again.
ATTENTION! Please reduce number of inspected points by reducing frequency
range, if your computer hasn't enough memory installed. Because all sigals
are stored firstly before processing.
Change following parameters in the script as you need:
num_dongle = 1; % number of dongles you installed
start_freq = 935e6;
end_freq = 960e6;
freq_step = 0.2e6; % GSM channel spacing
gain = 0;
...
Some key parameters:
% how long signal we try to find multiple FCCH bursts in
num_frame = 64; % roughly speaking, there are 1 FCCH burst per 10 frames,
but 50 frames plus 1 idle frame construct one multiframe
FCCH_coarse_position.m
th = 10; % Peak to average threshold of detecting FCCH in moving averaging
SNR(estimated by FFT) stream.
max_offset = 5; % +/- range of predicted next postion of FCCH burst.
------------Algorithm------------
Because FCCH actually is a period of CW signal, we can use FFT to see if
there is sharp peak in frequency domain.
For the first FCCH detection, a continuous moving FFT is performed. After
the first FCCH is hit, the following FCCH will be only detected at
predicted position (+/- small range) according to GSM frame structure.
At least 3 successive FCCH need to be detected for we to ensure one
donwlink broadcasting carrier is there. See details in
FCCH_coarse_position.m.
Dear all,
with the permission of the original poster, I hereby forward a message
from Omri regarding his use of rtl-sdr to sniff and decode NRF24L01+ and
Bluetooth LE packets.
I have no involvement in the project, I'm just passing on the mail,
thats' all ;)
Regards,
--
- Harald Welte <laforge(a)gnumonks.org> http://laforge.gnumonks.org/
============================================================================
"Privacy in residential applications is a desirable marketing option."
(ETSI EN 300 175-7 Ch. A6)