pull/8/head
Zilog80 2019-01-30 12:13:33 +01:00
rodzic aac3e421d3
commit 9df07b199b
2 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -365,13 +365,13 @@ int main(int argc, char *argv[]) {
case DEMOD:
z0 = 0;
gain = 2.0/PI;
gain = 1.0;
while ( read_csample(fp, &z) != EOF ) {
w = z * conj(z0);
switch ( phi ) { // phi'-Algo
case 1: fm = carg(w); break; // = atan2( cimag(w) , creal(w) );
case 2: fm = cimag(w) / (cabs(z0)*cabs(z0)); break;
} //fm3 = cimag(w); // FM: |z|=const
case 1: fm = carg(w)/PI; break; // = atan2( cimag(w) , creal(w) )/PI \in [-1,1];
case 2: fm = cimag(w) / (cabs(z0)*cabs(z0)); break; // for small angles ... gain?
} //fm3 = cimag(w); // FM: |z|=const
write_sample(fout, fm*gain);
z0 = z;
sample++;

Wyświetl plik

@ -258,15 +258,15 @@ int read_signed_sample(FILE *fp, double *s) { // int = i32_t
double x=0, x0=0;
double complex z, w;
static double complex z0;
double gain = 2.0/M_PI;
double gain = 1.0;
if (option_iq) {
if ( read_csample(fp, &z) == EOF ) return EOF;
double t = (double)(sample_count) / sample_rate;
z *= cexp(-t*2*M_PI*df*I);
w = z * conj(z0);
x = gain * carg(w); // d1
//x = cimag(w) / (cabs(z0)*cabs(z0)); // d2
x = gain * carg(w)/M_PI; // d1
//x = _gain * cimag(w) / (cabs(z0)*cabs(z0)); // for small angles ... d2
z0 = z;
iqbuf[sample_count % N_IQBUF] = z;
@ -368,7 +368,7 @@ int read_rawbit(FILE *fp, int *bit) {
if (option_iq >= 2) {
double h = 1.0; // modulation index, GFSK
double h = 1.0; // modulation index, GFSK; h(rs41)=0.8?
double complex z = 0;
double complex X1 = 0;
double complex X2 = 0;