-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSelectSatellite.m
70 lines (65 loc) · 2.58 KB
/
SelectSatellite.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
function selected_bits = SelectSatellite( SV_number )
% ----------------------------------------------------------------------- %
% SelectSatellite() - This function outputs two integer values %
% that refeers to the bit position of register G2. The bits selected %
% will be passed to registered that contol MUXes to select the specific %
% position. For example, to select Satelite Vehicle 9 pass the SV_number %
% 9 and expect the tap_bits to be 3 and 10. %
% %
% Input: SV_number: The satellite vehicle to select %
% %
% Output: selected_bits: The two integers for the positon of the %
% selected bits %
% ----------------------------------------------------------------------- %
% Created by Kurt Pedrosa -- Feb 20th 2017 %
% ----------------------------------------------------------------------- %
% Check to insure that the SV_number is between 1-37 ( number of possible
% PRN signals)
if (SV_number <= 37) && (SV_number > 0)
% Define the possible selected patterns
tap_bits = [ 2 6;
3 7;
4 8;
5 9;
1 9;
2 10;
1 8;
2 9;
3 10;
2 3;
3 4;
5 6;
6 7;
7 8;
8 9;
9 10;
1 4;
2 5;
3 6;
4 7;
5 8;
6 9;
1 3;
4 6;
5 7;
6 8;
7 9;
8 10;
1 6;
2 7;
3 8;
4 9;
5 10;
4 10;
1 7;
2 8;
4 10];
selected_bits = tap_bits( SV_number, :);
fprintf('Satellite Selected was %i.\n', SV_number );
fprintf('The bits for Satellite %i are %i, %i.\n', SV_number, selected_bits(1,1), selected_bits(1,2));
% print a empty line for spacing
fprintf('\n');
else
error('Selected SV number is out of range.')
end
end