-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b6f620
commit 238d3f1
Showing
20 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM BCCH demodulator | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function BCCH_demod(s, pos_info, training_sequence, oversampling_ratio) | ||
carrier_ppm = -1; | ||
normal_training_sequence_idx = -1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
% function CW_check.m | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% check if there are discontinuous samples in a segment of CW signal | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Find out coarse sample index of beginning of GSM FCCH | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function position = FCCH_coarse_position(s, decimation_ratio) | ||
disp(' '); | ||
position = -1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM FCCH detector/verification | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function FCCH_demod(s, pos_info, oversampling_ratio, carrier_freq) | ||
disp(' '); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM FCCH fine synchronization | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function [FCCH_pos, r, sampling_ppm, carrier_ppm] = FCCH_fine_correction(s, base_position, oversampling_ratio, carrier_freq) | ||
disp(' '); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Estimate sampling rate error and carrier frequency error and compansate them according to GSM SCH detection. | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function [pos_info, r, sampling_ppm] = SCH_corr_rate_correction(s, FCCH_pos, sch_training_sequence, oversampling_ratio) | ||
disp(' '); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM SCH demodulator | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function SCH_demod(s, pos_info, training_sequence, oversampling_ratio) | ||
disp(' '); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Estimate carrier frequency error and compansate it. | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function [r, carrier_ppm] = carrier_correct_post_SCH(s, pos_info, oversampling_ratio, carrier_freq) | ||
disp(' '); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM single rate channel filter which works on 4X oversampling rate | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function r = chn_filter_4x(s) | ||
persistent coef; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% GSM decimation channel filter which works on 8X oversampling input and generates 4X oversampling output | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function r = chn_filter_8x_4x(s) | ||
persistent coef; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Generate GSM SCH channel training sequences according to GSM spec | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function s = gsm_SCH_training_sequence_gen(oversampling_ratio) | ||
filename = ['gsm_SCH_training_sequence_' num2str(oversampling_ratio) 'x.mat']; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Generate 8 normal training sequences according to GSM spec | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function s = gsm_normal_training_sequence_gen(oversampling_ratio) | ||
filename = ['gsm_normal_training_sequence_' num2str(oversampling_ratio) 'x.mat']; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Find out FCCH location by moving FFT, peak averaging, Peak-to-Average-Ratio monitoring. | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function [hit_flag, hit_idx, hit_avg_snr, hit_snr] = move_fft_snr_runtime_avg(s, mv_len, fft_len, th) | ||
hit_flag = false; | ||
hit_idx = -1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% convert original uint8 data captured by rtl_sdr to double complex data. | ||
% all variable are assumed to be column vector | ||
|
||
function b = raw2iq(a) | ||
c = a(1:2:end,:) + 1i.*a(2:2:end,:); | ||
% c = a(2:2:end,:) + 1i.*a(1:2:end,:); % swap | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% parameter setting via tcp to rtl_tcp | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function tcp_obj = set_freq_tcp(tcp_obj, freq) | ||
fwrite(tcp_obj, 1, 'uint8'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% parameter setting via tcp to rtl_tcp | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
|
||
function tcp_obj = set_gain_tcp(tcp_obj, gain) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% parameter setting via tcp to rtl_tcp | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function tcp_obj = set_rate_tcp(tcp_obj, rate) | ||
fwrite(tcp_obj, 2, 'uint8'); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Find out FCCH location by moving FFT, peak averaging, Peak-to-Average-Ratio monitoring around a specific location. | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function [hit_flag, hit_idx, hit_snr] = specific_fft_snr_fix_avg(s, target_set, fft_len, th, avg_snr) | ||
hit_flag = false; | ||
hit_idx = -1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% A test script to study GMSK demodulation | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
% function test_diff_GMSK_mod_demod | ||
clear all; | ||
close all; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
% Jiao Xianjun ([email protected]; [email protected]) | ||
% Calculated total PPM according to several cascaded PPM | ||
% A script of project: https://github.com/JiaoXianjun/multi-rtl-sdr-calibration | ||
|
||
function ppm_out = total_ppm_calculation(ppm_in) | ||
|
||
if ppm_in == inf | ||
|