Re: oversampling coefficient specification, lib_dsp
Posted: Thu May 11, 2017 5:14 pm
Sorry about my lib confusion. I am using the 72-tap US3 version.
The community of XMOS. The place to be when developing with XMOS technology.
https://www.xcore.com:443/
Code: Select all
// Copyright (c) 2017, XMOS Ltd, All rights reserved
#include <xs1.h>
#include <xclib.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "src.h"
#define NUM_OF_TAPS (SRC_FF3V_FIR_NUM_PHASES * SRC_FF3V_FIR_TAPS_PER_PHASE)
extern const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE];
int main()
{
int32_t data[SRC_FF3V_FIR_TAPS_PER_PHASE];
memset(data, 0, sizeof(data));
for (unsigned s=0;s<24;s++)
{
int32_t samp = (s == 0 ? 0x7fffffff : 0); //impulse
//Walk backwards through phases
printf("%d\n", src_us3_voice_input_sample(data, src_ff3v_fir_coefs[2], samp));
printf("%d\n", src_us3_voice_get_next_sample(data, src_ff3v_fir_coefs[1]));
printf("%d\n", src_us3_voice_get_next_sample(data, src_ff3v_fir_coefs[0]));
}
return 0;
}