soundfielddescription.h 1.46 KB
Newer Older
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
1
2
#pragma once

Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
3
4
#include "micarray.h"

Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
5
6
7
8
9
10
11
12
13
14
15
#ifndef Q_MOC_RUN
#include "boost/geometry.hpp"
#endif

#include "boost/math/special_functions/bessel.hpp"
#include "boost/math/special_functions/bessel_prime.hpp"
#include "boost/math/special_functions/legendre.hpp"
#include "boost/math/special_functions/hankel.hpp"
#include "boost/math/special_functions/spherical_harmonic.hpp"
#include "boost/variant/get.hpp"

Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
16
17
18
19
20

#include <nlohmann/json.hpp>



Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
21
22
23
24
25
26
#define SHDorder 1
#define PI 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117068

using namespace std;
using namespace boost::geometry;
using namespace boost::math;
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using json = nlohmann::json;

enum class ArrayType
{
	Spherical,
	Circular,
	Planar,
	Linear,
	Other
};

enum class ArrayScattering
{
	Rigid,
	Open,
	OtherArray
};
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
44
45
46
47

class soundfielddescription
{
public:
48
    soundfielddescription(char microphone_array_geometry[]);
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
49
50
    void* calcsphericalharmonics(double* pressure_real_in, double* pressure_imag_in, double* shd_realpart_out, double* shd_imagpart_out);
private:
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
51
52
	vector<float> micanglestheta;
	vector<float> micanglesphi;
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
53
54
    int nofmicrophones;
    int nofsamples;
Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
55
56
57
58
59
60
61
62
63
64
    ArrayType array_type;
    ArrayScattering array_scattering_type;
	int sampling_rate;
	int sample_type;
	int block_size;
	int samplingrates[8] = { 16000,24000,32000,44100,48000,64000,96000,192000 };
	int sampletypes[3] = { 16,24,32 };
	int blocksizes[7] = { 64,128,256,512,1024,2048,4096 };
	micarray microphone_array_params;

Mert Burkay Çöteli's avatar
Mert Burkay Çöteli committed
65
66
};