You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constunsignedint nSamples = (unsignedint)hrir.GetNumDataSamples(); // For example: 512 samples.
181
+
182
+
if (delays.size() == data.size() / nSamples){
183
+
specifiedDelays = true;
184
+
}
185
+
else {
186
+
if (delays.size() == 2)
187
+
{
188
+
specifiedDelays = false;
189
+
SET_RESULT(RESULT_WARNING, "This HRTF file does not contain individual delays for each HRIR. Therefore, some comb filter effect can be perceived due to interpolations and custom head radius should not be used");
190
+
}
191
+
else
192
+
{
193
+
SET_RESULT(RESULT_ERROR_BADSIZE, "SOFA gives incoherent number of HRIRs and delays");
194
+
returnfalse;
195
+
}
196
+
}
197
+
181
198
double distance = pos[array2DIndex(0, 2, nMeasurements, dims[1])]; //We consider that every HRIR are meased at the same distance, so we get the firts one
/** \brief Process a buffer with complex numbers to get two separated vectors one with the powers and other with the phases.
94
+
* \details This method return two vectors with the power and phase of the vector introduced.
95
+
* \param [in] inputBuffer Vector of samples that has real and imaginary parts interlaced. inputBuffer[i] = Re[Xj], x[i+1] = Img[Xj]
96
+
* \param [out] powerBuffer Vector of real numbers that are the power of the complex numbers. moduleBuffer[i] = inputBuffer[2 * i]^2 * inputBuffer[2 * i + 1]^2
97
+
* \param [out] phaseBuffer Vector of real numbers that are the argument of the complex numbers. phaseBuffer [i] = atan(inputBuffer[2 * i + 1] / inputBuffer[2 * i]^2)
98
+
* \throws May throw exceptions and errors to debugger
0 commit comments