File: t_corrperf.c

package info (click to toggle)
rtklib 2.4.3%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 41,796 kB
  • sloc: cpp: 51,592; ansic: 50,584; fortran: 987; makefile: 861; sh: 45
file content (43 lines) | stat: -rw-r--r-- 852 bytes parent folder | download | duplicates (3)
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
/* correlator performence test */
#include <stdio.h>
#include "sdr.h"

int main(int argc, char **argc)
{
	double f_s[]={38.192e6,16.368e6,8.184e6};
	double taums[]={1,2,4,8,16};
	double tau,ns,crate,coff,freq,phi0,ti;
	double I[3],Q[3];
	char *data;
	int i,j,k,dtype,sat,s,nc,nt,n;
	
	dtype=1;
	sat  =1;
	freq =9.548e6;
	crate=1023000;
	coff =1234.5;
	s    =20;
	
	for (i=0;i<4;i++) for (j=0;j<5;j++) {
		
		printf('sampling rate=%.3fMHz\n',f_s/1e6);
		
		tau  =taums[j]*1e-3;
		ns   =tau*f_s[i];
		if (dtype) nt=ns*2; else nt=ns;
		phi0 =0.1234;
		data=int8((rand(1,nt)-0.5)*4);
		ti   =1/f_s;
		n    =100000/taums;
		
		tic,
		for (k=0;k<n;k++) {
			correlator(data,dtype,ti,freq,phi0,sat,0,crate,coff,s,1,I,Q);
		}
		t=toc;
		
		printf("tau=%2.0fms: ns=%7d time=%5.3fms rate=%.1fMsps\n",...
	           taums,ns,t/n*1e3,n*ns/t/1e6);
	}
	return 0;
}