Increase decimation, remove filter
This commit is contained in:
parent
2068d3a01f
commit
71543c70da
90
src/main.c
90
src/main.c
|
@ -51,9 +51,9 @@ static uint32_t lo_phase[LO_NUM_PHASES][LO_PHASE_WORDS]
|
||||||
static const uint32_t *lo_cos_phases[LO_COS_PHASES]
|
static const uint32_t *lo_cos_phases[LO_COS_PHASES]
|
||||||
__attribute__((__aligned__(1 << LO_PHASE_BITS)));
|
__attribute__((__aligned__(1 << LO_PHASE_BITS)));
|
||||||
|
|
||||||
#define DECIMATE 4
|
#define DECIMATE 16
|
||||||
#define RX_STRIDE (2 * IQ_SAMPLES * DECIMATE)
|
#define RX_STRIDE (2 * IQ_SAMPLES * DECIMATE)
|
||||||
#define RX_BITS_DEPTH 13
|
#define RX_BITS_DEPTH 14
|
||||||
#define RX_WORDS (1 << (RX_BITS_DEPTH - 2))
|
#define RX_WORDS (1 << (RX_BITS_DEPTH - 2))
|
||||||
|
|
||||||
static_assert(RX_STRIDE * 4 <= RX_WORDS, "RX_STRIDE * 4 <= RX_WORDS");
|
static_assert(RX_STRIDE * 4 <= RX_WORDS, "RX_STRIDE * 4 <= RX_WORDS");
|
||||||
|
@ -434,47 +434,61 @@ struct IQ {
|
||||||
|
|
||||||
inline static struct IQ next_sample(const uint32_t *buf)
|
inline static struct IQ next_sample(const uint32_t *buf)
|
||||||
{
|
{
|
||||||
static int h[11];
|
int x15 = gain * (-2 * buf[0] - buf[1] - dc_level);
|
||||||
|
int x14 = gain * (-2 * buf[2] - buf[3] - dc_level);
|
||||||
int x3 = gain * (-2 * buf[0] - buf[1] - dc_level);
|
int x13 = gain * (-2 * buf[4] - buf[5] - dc_level);
|
||||||
int x2 = gain * (-2 * buf[2] - buf[3] - dc_level);
|
int x12 = gain * (-2 * buf[6] - buf[7] - dc_level);
|
||||||
int x1 = -(gain * (-2 * buf[4] - buf[5] - dc_level));
|
int x11 = gain * (-2 * buf[8] - buf[9] - dc_level);
|
||||||
int x0 = -(gain * (-2 * buf[6] - buf[7] - dc_level));
|
int x10 = gain * (-2 * buf[10] - buf[11] - dc_level);
|
||||||
|
int x09 = gain * (-2 * buf[12] - buf[13] - dc_level);
|
||||||
const int c[] = { 4, 2, -8, -9, 19, 55 };
|
int x08 = gain * (-2 * buf[14] - buf[15] - dc_level);
|
||||||
|
int x07 = gain * (-2 * buf[16] - buf[17] - dc_level);
|
||||||
|
int x06 = gain * (-2 * buf[18] - buf[19] - dc_level);
|
||||||
|
int x05 = gain * (-2 * buf[20] - buf[21] - dc_level);
|
||||||
|
int x04 = gain * (-2 * buf[22] - buf[23] - dc_level);
|
||||||
|
int x03 = gain * (-2 * buf[24] - buf[25] - dc_level);
|
||||||
|
int x02 = gain * (-2 * buf[26] - buf[27] - dc_level);
|
||||||
|
int x01 = gain * (-2 * buf[28] - buf[29] - dc_level);
|
||||||
|
int x00 = gain * (-2 * buf[30] - buf[31] - dc_level);
|
||||||
|
|
||||||
int I = 0, Q = 0;
|
int I = 0, Q = 0;
|
||||||
|
|
||||||
Q += (c[0]) * h[10];
|
I += 93 * x15;
|
||||||
I += (c[0] + c[1]) * h[9];
|
I += 71 * x14;
|
||||||
Q += (c[0] + c[1] + c[2]) * h[8];
|
I += 39 * x13;
|
||||||
I += (c[0] + c[1] + c[2] + c[3]) * h[7];
|
I += 0 * x12;
|
||||||
Q += (c[1] + c[2] + c[3] + c[4]) * h[6];
|
I += -39 * x11;
|
||||||
I += (c[2] + c[3] + c[4] + c[5]) * h[5];
|
I += -71 * x10;
|
||||||
Q += (c[3] + c[4] + c[5] + c[5]) * h[4];
|
I += -93 * x09;
|
||||||
I += (c[4] + c[5] + c[5] + c[4]) * h[3];
|
I += -101 * x08;
|
||||||
Q += (c[5] + c[5] + c[4] + c[3]) * h[2];
|
I += -93 * x07;
|
||||||
I += (c[5] + c[4] + c[3] + c[2]) * h[1];
|
I += -71 * x06;
|
||||||
Q += (c[4] + c[3] + c[2] + c[1]) * h[0];
|
I += -39 * x05;
|
||||||
I += (c[3] + c[2] + c[1] + c[0]) * x3;
|
I += 0 * x04;
|
||||||
Q += (c[2] + c[1] + c[0]) * x2;
|
I += 39 * x03;
|
||||||
I += (c[1] + c[0]) * x1;
|
I += 71 * x02;
|
||||||
Q += (c[0]) * x0;
|
I += 93 * x01;
|
||||||
|
I += 101 * x00;
|
||||||
|
|
||||||
I /= 128;
|
Q += 39 * x15;
|
||||||
Q /= 128;
|
Q += 71 * x14;
|
||||||
|
Q += 93 * x13;
|
||||||
|
Q += 101 * x12;
|
||||||
|
Q += 93 * x11;
|
||||||
|
Q += 71 * x10;
|
||||||
|
Q += 39 * x09;
|
||||||
|
Q += 0 * x08;
|
||||||
|
Q += -39 * x07;
|
||||||
|
Q += -71 * x06;
|
||||||
|
Q += -93 * x05;
|
||||||
|
Q += -101 * x04;
|
||||||
|
Q += -93 * x03;
|
||||||
|
Q += -71 * x02;
|
||||||
|
Q += -39 * x01;
|
||||||
|
Q += 0 * x00;
|
||||||
|
|
||||||
h[10] = h[6];
|
I /= 1024;
|
||||||
h[9] = h[5];
|
Q /= 1024;
|
||||||
h[8] = h[4];
|
|
||||||
h[7] = h[3];
|
|
||||||
h[6] = h[2];
|
|
||||||
h[5] = h[1];
|
|
||||||
h[4] = h[0];
|
|
||||||
h[3] = x3;
|
|
||||||
h[2] = x2;
|
|
||||||
h[1] = x1;
|
|
||||||
h[0] = x0;
|
|
||||||
|
|
||||||
return (struct IQ){ I, Q };
|
return (struct IQ){ I, Q };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue