Function
Function
_MasterTS,typeofTT)
%
[index_GPStoTS,delta_index]=GPSTimetoTimeStamp3(time_tag,index_gps,index_Maste
rTS,typeofTT)
% This is phase 1 of the synchronication process develop for CAFFE.
% Return:
% index_GPStoTS si a index, with the same dimension of MasterTS so that in
% the same position of the TimeStamp there is the index of the
% corresponding GPSTime parameter.
% delta_index is the maximun interval measures between a MasterTS the
correspo
% correspondig GPSTime parameter
n_TS=length(index_MasterTS);
index_GPStoTS=zeros(n_TS,1);
delta_index=0;
for k=1:length(typeofTT)
index_MasterTSthistag=find((time_tag(index_MasterTS)==typeofTT(k)));
index_gpsthistag=find((time_tag(index_gps)==typeofTT(k)));
N_MTS=length(index_MasterTSthistag);
for i=1:N_MTS
[dummy,index_min]=min(abs(index_MasterTS(index_MasterTSthistag(i))-
index_gps(index_gpsthistag)));
index_GPStoTS(index_MasterTSthistag(i))=index_gpsthistag(index_min);
delta_index=max(dummy,delta_index);
end
end
return
[index_nowtoTS]=cff_MasterTStoGPS(time_tag,index_gpsnumberweek,index_MasterTS,
typeofTT);
[index_towtoTS]=cff_MasterTStoGPS(time_tag,index_gpstimeofweek,index_MasterTS,
typeofTT);
[index_nsctoTS]=cff_MasterTStoGPS(time_tag,index_gpsnanosec,index_MasterTS,typ
eofTT);
1
13
25
37
49
61
73
85
97
109
121
133
145
157
169
192
204
216
228
240
252
264
276
288
300
312
324
336
348
360
372
384
396
408
420
432
444
456
468
480
492
504
516
528
540
552
564
576
588
600
612
624
636
648
660
672
684
696
708
720
732
744
756
768
780
792
804
816
828
840
852
864
876
888
900
912
924
936
948
960
972
984
996
1008
1020
1032
1044
1056
1068
1080
1092
1104
1116
1128
1140
1152
1164
1176
1188
1200
1212
1224
1236
1248
1260
1272
1284
1296
1308
1320
1332
1344
1356
1368
1380
1392
1404
1416
1428
1440
1452
1464
1476
1488
2255
2267
2279
2291
2303
2315
2327
2339
2351
2363
2375
2387
2399
2411
2423
2435
2447
2459
2471
2483
2495
2507
2519
2531
2543
2555
2567
2579
2591
2603
2615
2627
2639
2651
2998
3010
3022
3034
3046
3058
3070
3082
3094
3106
3118
3130
3142
3154
3166
3178
3190
3202
3214
3226
3238
3250
3262
3274
3286
3298
3310
3322
3334
3346
3358
3370
3382
3394
3406
3418
3430
3442
3454
3466
3478
3490
3502
3514
3526
3538
3550
3562
3574
3586
3598
3610
3622
3634
3646
3658
3670
3682
3694
3706
3718
3730
3742
3754
3766
3778
3790
3802
3814
3826
3838
3850
3862
3874
3886
3898
3910
3922
3934
3946
3958
3970
3982
3994
4006
4018
4030
4042
4054
4066
4078
4090
4102
4114
4126
4138
4150
4162
4174
4186
4198
4210
4222
4234
4246
4258
4270
4282
4294
4306
4318
4330
4342
4354
4366
4378
4390
4402
4414
4426
4438
4450
4462
4474
4486
4498
4510
4522
4534
4546
4558
4570
4582
4594
4606
4618
4630
4642
4654
4666
4678
4690
4702
4714
4726
4738
4750
4762
4774
4786
4798
4810
4822
4834
4846
4858
4870
4882
4894
4906
4918
4930
4942
5457
5469
5481
5493
5505
5517
5529
5541
5553
5565
5577
5589
5601
5613
5625
5637
5649
5661
5673
5685
5697
5709
5721
5733
5745
5757
5769
5781
5793
5805
5817
5829
5841
5853
5865
5877
5889
5901
5913
5925
5937
5949
5961
5973
5985
5997
6009
6021
6033
6045
6057
6069
6081
6093
6105
6117
6129
6141
6153
6165
6177
6189
6201
6213
6225
6237
6249
6261
6273
6285
6297
6309
6321
6333
6345
6357
6369
6381
6393
6405
6417
6429
6441
6453
6465
6477
6489
6501
6513
6525
6537
6549
6561
6573
6585
6597
6609
6621
6633
6645
6800
6812
6824
6836
6848
6860
6872
6884
6896
6908
6920
6932
6944
6956
6968
6980
6992
7004
7016
7028
7040
7052
7064
7076
7088
7100
7112
7124
7136
7148
7160
7172
7184
7196
7208
7220
7232
7244
7256
7268
7280
7292
7304
7316
7328
7340
7352
7364
7376
7388
7400
7412
7424
7436
7448
7460
7472
7484
7496
7508
7520
7532
7544
7556
7568
7580
7592
7604
7616
7628
7640
7652
7664
7676
7688
7700
7712
7724
7736
7748
7760
7772
7784
7796
7808
7832
7844
7856
7904
7916
8059
8071
8083
8095
8107
8119
8131
8143
8155
8167
8179
8191
8203
8215
8227
8239
8251
8263
8275
8287
8299
8311
8323
8335
8347
8359
8371
8383
8395
8407
8419
8431
8443
8455
8467
8479
8491
8503
8515
8527
8539
8551
8563
8575
8587
8599
8611
8623
8635
8647
8659
8671
8683
8695
8707
8719
8731
8743
8755
8767
8779
8791
8803
8815
8827
8839
8851
8863
8875
8887
8899
8911
8923
8935
8947
8959
8971
8983
8995
9007
9019
9031
9043
9055
9067
9079
9234
9246
9258
9270
9282
9294
9306