Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AmbisonicProcessor: Rotating around {0, 0, 0} is not a null op in 3rd order #32

Open
konradglas opened this issue Aug 12, 2021 · 0 comments

Comments

@konradglas
Copy link

Hi!
When I run the code below, I would expect the sound field not being altered at all. But in channel 12 I can see a boost of 3.5. Is this expected, because I am using the processor wrong?

#include "AmbisonicEncoder.h"
#include "AmbisonicProcessor.h"

#include <iostream>
#include <vector>

int main(int argc, char *argv[]) {

  CAmbisonicEncoder encoder;
  encoder.Configure(3, true, 0);
  encoder.SetPosition({0.0, M_PI * 0.5, 0.0});

  int sampleCount = 10;

  std::vector<float> dirac;
  dirac.resize(sampleCount, 0.f);
  dirac[0] = 1.f;

  CBFormat impulse;
  impulse.Configure(3, true, 10);
  // encode a signal from a mono impulse
  encoder.Process(dirac.data(), impulse.GetSampleCount(), &impulse);

  CAmbisonicProcessor processor;
  processor.Configure(3, true, sampleCount, 0);
  processor.SetOrientation({0, 0, 0});
  processor.Refresh();

  std::cout << "Channel 12 at "<< impulse.m_ppfChannels[12][0] << std::endl;
  // rotate by nothing
  processor.Process(&impulse, sampleCount);
  // result is different
  std::cout << "Channel 12 at " << impulse.m_ppfChannels[12][0] << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant