Hi Klara.
I was starting to write an answer to describe how the NFC-HOA renderer
works, and suddenly I found the bug myself!
It was really much simpler than I thought: The algorithm requires an
IFFT to be made, but I used an FFT by mistake!
The fix is there:
https://github.com/SoundScapeRenderer/ssr/pull/115
And it will be in the new release that's coming out very soon.
Since I've already written most of the answer describing the NFC-HOA
renderer, I'm including it below, even though the error is fixed now.
Maybe you find another error or have other suggestions for
improvements.
On Fri, Oct 19, 2018 at 4:36 PM Klara Juros wrote:
>
> Hello!
>
> Thanks for answer, I'll try to do my best. Hovewer, I have some questions about the code for NFC-HOA. I wanted to make some transformations in spatial domain (like warping etc.) and I found an article about ambisonic and the equations used in SFS Toolbox ("An analytical approach to sound field reproduction using circular and spherical loudspeaker distributions" 2008 Spors, Ahrens), but nothing about how its done in SSR, and it;s hard for me to find out how it's done in SSR. Can You in few word explain it to me ? I would appreciate that !
The mathematical basis of the implementation is described in
Spors, S.; Kuscher, V.; Ahrens, J.:
Efficient realization of model-based rendering for 2.5-dimensional
near-field compensated higher order Ambisonics. IEEE Workshop on
Applications of Signal Processing to Audio and Acoustics, New Paltz,
USA, 2011
https://ieeexplore.ieee.org/abstract/document/6082325
http://www.int.uni-rostock.de/fileadmin/user_upload/publications/spors/2011/Spors_etal_WASPAA_2011_efficient_NFCHOA.pdf
Parts of this were also in a Bachelor's thesis (of the second author)
at TU Berlin (in German):
Vincent Kuscher, February 2011:
Effiziente Realisierung von higher-order Ambisonics mittels digitaler Filter
I don't think it is available online, at least I couldn't find it.
But hopefully all the necessary math is in the paper above.
The actual implementation for the SSR is described in a Master's
thesis at TU Berlin:
Moritz Heppner, I think 2012:
Integration of a higher order Ambisonics algorithm into a spatial
sound rendering tool
I couldn't find that either.
But I can try to walk you through the implementation, hopefully that helps:
The relevant code is in the file src/nfchoarenderer.h.
First, look for APF_PROCESS. There are multiple instances. Look at the
first one, in the class NfcHoaRenderer.
This is everything that the renderer does. Plus, in the beginning the
list of "Input" objects is processed (which I guess isn't relevant for
our case) and in the end the list of "Output" objects is processed
(where the resulting audio data is copied to the outputs).
So the first thing in APF_PROCESS is the _source_list being processed.
To see what's happening, look for the next instance of APF_PROCESS
(this time in the NfcHoaRenderer::Source class).
In this function the parameters "source_model", "distance" and "angle" are set.
Hopefully correctly.
The next stage is in the _mode_pair_list, which is a list of ModePair objects.
The reason why we use pairs of modes is efficiency. The lists are
scheduled very naively and the list elements are distributed evenly
over all available threads. The problem is that calculating some modes
needs much more time than some others, depending on their order.
Therefore we combine the lowest and the highest mode to one pair, then
the second and penultimate mode, and so on.
This way, each ModePair needs *approximately* the same time for
processing and the distribution of the processing over multiple
threads is more even.
The NfcHoaRenderer::ModePair class has its own APF_PROCESS, which just
calls the process() functions of the two Mode objects.
In the NfcHoaRenderer::Mode::_process() function the filter
coefficients are updated if necessary and the IIR filters are actually
applied. And the interpolation mode for the next stage is determined.
The next stage in the algorithm is the _mode_accumulator_list. The
ModeAccumulator class combines all the modes from the sources (which
are stored in a "mode_pointers" list).
For each mode number, two channels of a matrix are filled with data.
One channel for the positive nodes and one for the negative nodes. At
the same time some interpolation is done.
After that, back in the first APF_PROCESS, the matrix is transposed.
The next stage is the _fft_list, holding FftProcessor objects.
[Note: At this point I've found the bug.]
Each of those objects makes an IFFT (not an FFT!) of a single channel
of the matrix.
Finally, in the output list, the "slices" (i.e. the rows) of the
matrix are copied to the output buffer.
That's it!
If you have further questions or if you want to have a more detailed
explanation of some parts of the code, don't hesitate to ask.
cheers,
Matthias
> Cheers
>
> Klara
>
> W dniu wtorek, 2 października 2018 18:05:51 UTC+3 użytkownik Matthias Geier napisał:
>>
>> On Mon, Oct 1, 2018 at 6:25 PM Klara Juros wrote:
>> >
>> > Hi!
>> > I want to work with Near Filed Compensated Higher Order Ambisonics in SSR and as I can see, all the files (code) are given in the toolbox, and I can use it. But I was wondering, why for ex. here
https://github.com/SoundScapeRenderer/LAC2018-SSR-Lightning-Talk/blob/master/README.md it's said that NFC Hoa is not supported? What does it mean ? Is it that NFC-HOA is still quite experimental ?
>> Yes, the NFC HOA renderer is available and can be compiled and
>> started. It will even produce audio output. And it is very efficient.
>>
>> The problem is: it's wrong!
>>
>> It may even sound right at first, but as soon as you move a sound
>> source around, you will hear that something isn't quite right. You
>> will hear two sources instead of one, where the second one moves
>> somewhat symmetric to the first.
>>
>> Obviously, there is a bug somewhere in the implementation. Sadly,
>> nobody has found it so far.
>>
>> Please look into the code
>> (
https://github.com/SoundScapeRenderer/ssr/blob/master/src/nfchoarenderer.h),
>> it would be great if somebody could fix this!
>>
>> Any insights into the problem are very much appreciated!
>>
>> cheers,
>> Matthias
>>
>> > Thanks for help. :)
>> > Klara
>
> --
> You received this message because you are subscribed to the Google Groups "SoundScape Renderer" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
SoundScapeRende...@googlegroups.com.
> To post to this group, send email to
SoundScap...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/SoundScapeRenderer/7eab1d75-c89b-4b1c-bfab-c9c4c61ea582%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.