ambisonicWeight::ambisonicWeight(int anOrder, int aVectorSize, std::string anOptimMode) { m_order = anOrder; m_number_of_harmonics = m_order * 2 + 1; m_number_of_outputs = m_number_of_harmonics; m_number_of_inputs = m_number_of_harmonics; m_vector_size = aVectorSize; m_speakers_angles = new double[m_order]; m_index_of_harmonics = new int[m_number_of_harmonics]; m_optimVector = new double[m_number_of_harmonics]; m_input_vector = gsl_vector_alloc(m_number_of_harmonics * m_number_of_harmonics); m_input_vector_view = new gsl_vector_view[m_number_of_harmonics]; m_output_vector = gsl_vector_alloc(m_number_of_harmonics * m_number_of_harmonics); m_output_vector_view = new gsl_vector_view[m_number_of_harmonics]; gsl_vector_set_zero(m_input_vector); gsl_vector_set_zero(m_output_vector); for (int j = 0; j < m_number_of_harmonics; j++) { m_input_vector_view[j] = gsl_vector_subvector(m_input_vector, j * m_number_of_harmonics, m_number_of_harmonics); m_output_vector_view[j] = gsl_vector_subvector(m_output_vector, j * m_number_of_harmonics, m_number_of_harmonics); } computeIndex(); computeAngles(); computePseudoInverse(); setOptimMode(anOptimMode); }
void RadialLookUpTable::recompute(double scale, double maxRadius) { if(this->scale == scale && this->maxRadius == maxRadius) return; this->maxRadius = maxRadius; this->scale = scale; numElementsPerLine = maxRadius / scale * 2; numElementsPerLineHalf = maxRadius / scale; computeAngles(); computeDistances(); }