REAL pos = 0.5, // 0 <= pos <= 1, left->right
theta = (1.0 - pos) * M_PI / 2.0;
rx[k].azim = Cmplx(cos(theta), sin(theta));
- fprintf(stderr, "azim %f %f\n", rx[k].azim.re, rx[k].azim.im);
}
rx[k].tick = 0;
}
}
- //
- // mix in sidetone here?
- //
-
// final scaling
if (rx[k].scl.post.flag)
if (!rx[k].bin.flag)
for (i = 0; i < n; i++)
CXBdata(rx[k].buf.o, i) = Cscl(rx[k].azim, CXBreal(rx[k].buf.o, i));
-
-#if 0
- if (!rx[k].bin.flag)
- for (i = 0; i < n; i++)
- CXBimag(rx[k].buf.o, i) = CXBreal(rx[k].buf.o, i);
-#endif
}
/* demod processing */
CXBdata(tx.buf.i, i) = Cmplx(CXBreal(tx.buf.i, i) * tx.scl.pre.val, 0.0);
}
- //
- // mix in CW tone here?
- //
-
correctIQ(tx.buf.i, tx.iqfix);
if (tx.spr.flag) SpeechProcessor(tx.spr.gen);
//============================================================
+PRIVATE void
+re_window(COMPLEX *vec, int len) {
+ int i;
+ REAL *win = newvec_REAL(len, "re_window win vec");
+ COMPLEX *ztmp = newvec_COMPLEX(len, "re_window z buf");
+
+ fftw_plan ptmp = fftw_create_plan(len, FFTW_BACKWARD, uni.wisdom.bits);
+ fftw_one(ptmp, (fftw_complex *) vec, (fftw_complex *) ztmp);
+ fftw_destroy_plan(ptmp);
+
+ (void) makewindow(BLACKMANHARRIS_WINDOW, len, win);
+
+ for (i = 0; i < len; i++)
+ ztmp[i] = Cscl(ztmp[i], win[i]);
+
+ ptmp = fftw_create_plan(len, FFTW_FORWARD, uni.wisdom.bits);
+ fftw_one(ptmp, (fftw_complex *) ztmp, (fftw_complex *) vec);
+ fftw_destroy_plan(ptmp);
+
+ delvec_COMPLEX(ztmp);
+ delvec_REAL(win);
+
+ normalize_vec_COMPLEX(vec, len);
+}
+
+//============================================================
+
PRIVATE int
f2x(REAL f) {
REAL fix = tx.filt.ovsv->fftlen * f / uni.samplerate;
apply_txeq_band(lof, dB, hif);
lof = hif;
}
+ re_window(rx[RL].filt.ovsv->zfvec, rx[RL].filt.ovsv->fftlen);
return 0;
}
}
apply_rxeq_band(lof, dB, hif);
lof = hif;
}
+ re_window(rx[RL].filt.ovsv->zfvec, rx[RL].filt.ovsv->fftlen);
return 0;
}
}