Hi Guys! I was doing some tests to learn how to use zita resampler and I got an unexpected output. All the last positions of my output vector were 0 and I don't know why.
I have copied the main files of zita resampler to my home directory. The files were resampler.cc, resampler-tables.cc, vresampler.cc and their respective headers. I have done this because I will need to modify the source code to use it with double precision vectors. Does anyone know what I am doing wrong? I'm trying to do this to improve mod-DS1's performance. https://github.com/portalmod/mod-distortion I'm attaching my code. greets André
#include <iostream> #include <fstream> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include "resampler.h" using namespace std; typedef float sample_t; int main(void) { cout << "OverSample Test" << endl; const uint32_t samplerate = 44100, n_over = 2; const uint32_t n_samples = 256; sample_t *buffer, *buffer_over, freq_Hz = 1000; buffer = (sample_t *) malloc(sizeof(sample_t) * n_samples); buffer_over = (sample_t *) malloc(sizeof(sample_t) * n_samples * n_over); //SinWave for (uint32_t i = 0; i< n_samples ; i++) { buffer[i] = sin(2*M_PI*freq_Hz*i/samplerate); } for (uint32_t i = 0; i<n_samples; i++) { cout << "buffer[" << i << "] = " << buffer[i] << endl; } Resampler over; over.setup(samplerate, n_over*samplerate, 1, 16); over.inp_count = n_samples; over.out_count = n_samples*n_over; over.inp_data = buffer; over.out_data = buffer_over; over.process(); for (uint32_t i = 0; i< n_over*n_samples; i++) { cout << "buffer_over[" << i << "] = " << buffer_over[i] << endl; } return 0; }
_______________________________________________ Linux-audio-dev mailing list Linux-audio-dev@lists.linuxaudio.org http://lists.linuxaudio.org/listinfo/linux-audio-dev