make fast si5351 i2c control, add scan command

This commit is contained in:
TT 2016-09-19 13:13:42 +09:00
parent 7c4c5a76dc
commit c84d5f0fa5
3 changed files with 100 additions and 34 deletions

25
dsp.c
View file

@ -41,7 +41,6 @@ hilbert_transform(void)
int32_t accn0 = 0;
int32_t acc1 = 0;
int32_t accn1 = 0;
int32_t s;
for (i = 0; i < 8; i += 2) {
uint32_t c = *(uint32_t*)&hilbert31_coeffs[i];
@ -75,6 +74,7 @@ hilbert_transform(void)
}
void calclate_gamma(void)
#if 0
{
__SIMD32_TYPE *r = __SIMD32_CONST(refiq_buf);
__SIMD32_TYPE *s = __SIMD32_CONST(samp_buf);
@ -98,7 +98,30 @@ void calclate_gamma(void)
gamma_real = acc_r / 65536;
gamma_imag = acc_i / 65536;
}
#else
{
int16_t *r = refiq_buf;
int16_t *s = samp_buf;
int len = SAMPLE_LEN/5;
double acc_r = 0;
double acc_i = 0;
double acc_ref = 0;
int i;
double rn;
for (i = 0; i < len; i++) {
int16_t s0 = *s++;
int16_t rr = *r++;
int16_t ri = *r++;
acc_r += (double)(s0 * rr);
acc_i += (double)(s0 * ri);
acc_ref += (double)rr*rr + (double)ri*ri;
}
rn = sqrtf(acc_ref / len);
gamma_real = 16 * acc_r / rn / len;
gamma_imag = 16 * acc_i / rn / len;
}
#endif
void
dsp_process(int16_t *capture, size_t length)