#include "getfile.h" #include #include #include #include extern qint16 id[4*60*96000]; void getfile(QString fname, bool xpol, int dbDgrd) { int npts=2*52*96000; if(xpol) npts=2*npts; // Degrade S/N by dbDgrd dB -- for tests only!! float dgrd=0.0; if(dbDgrd<0) dgrd = 23.0*sqrt(pow(10.0,-0.1*(double)dbDgrd) - 1.0); float fac=23.0/sqrt(dgrd*dgrd + 23.0*23.0); memset(id,0,2*npts); char name[80]; strcpy(name,fname.toLatin1()); FILE* fp=fopen(name,"rb"); if(fp != NULL) { fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); fread(id,2,npts,fp); int j=0; if(dbDgrd<0) { for(int i=0; i0) { datcom_.nutc=100*fname.mid(i0-4,2).toInt() + fname.mid(i0-2,2).toInt(); } } } void savetf2(QString fname, bool xpol) { int npts=2*52*96000; if(xpol) npts=2*npts; qint16* buf=(qint16*)malloc(2*npts); char name[80]; strcpy(name,fname.toLatin1()); FILE* fp=fopen(name,"wb"); if(fp != NULL) { fwrite(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); int j=0; for(int i=0; i= 1.0 || rsq == 0.0); fac = sqrt(-2.0*log(rsq)/rsq); gset = v1*fac; iset++; return v2*fac; }