Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
MPAI-Private
MPAI-CAE
eae
Commits
c9783dab
Commit
c9783dab
authored
Aug 08, 2022
by
Mert Burkay Çöteli
Browse files
packager,soundfielddescription and synthesistransform updates,bug fixes
parent
2e153cc8
Changes
8
Hide whitespace changes
Inline
Side-by-side
AnalysisTransform/analysistransform.cpp
View file @
c9783dab
...
...
@@ -9,30 +9,19 @@ analysistransform::analysistransform()
this
->
windowsize
=
2048
;
this
->
overlap
=
1024
;
this
->
nofmics
=
32
;
int
lngth
=
(
windowsize
/
2
+
1
)
*
(
signallength
/
(
overlap
));
outputsignal
=
(
std
::
complex
<
float
>
*
)
malloc
(
sizeof
(
std
::
complex
<
float
>
)
*
lngth
);
}
// Create a constructor for analysis transform
analysistransform
::
analysistransform
(
int
windowsize
=
2048
,
int
signallength
=
20480
,
int
hopsize
=
1024
,
int
nofmics
=
32
)
analysistransform
::
analysistransform
(
int
windowsize
,
int
signallength
,
int
hopsize
,
int
nofmics
)
{
this
->
signallength
=
signallength
;
this
->
windowsize
=
windowsize
;
this
->
overlap
=
hopsize
;
this
->
nofmics
=
nofmics
;
int
lngth
=
(
windowsize
/
2
+
1
)
*
(
signallength
/
(
hopsize
));
outputsignal
=
(
std
::
complex
<
float
>
*
)
malloc
(
sizeof
(
std
::
complex
<
float
>
)
*
lngth
);
}
// Create a hamming window of windowLength samples in buffer
void
analysistransform
::
hamming
(
int
windowLength
,
float
*
buffer
)
{
void
analysistransform
::
hamming
(
int
windowLength
,
double
*
buffer
)
{
for
(
int
i
=
0
;
i
<
windowLength
;
i
++
)
{
...
...
@@ -42,91 +31,95 @@ void analysistransform::hamming(int windowLength, float* buffer) {
/*
Signal in : x[0] to x[signalLength - 1]
nofmics : the number of the microphones
realpart : fft_real[0] to fft_real[N/2 -1]
imagpart : imagpart[0] to imagpart[N/2 -1]
*/
void
*
analysistransform
::
ST
FT
(
float
*
signal
,
float
*
realpart
,
float
*
imagpart
)
{
void
*
analysistransform
::
F
FT
(
double
*
signal
,
double
*
realpart
,
double
*
imagpart
)
{
double
*
data
;
fftw_complex
*
fft_result
;
fftw_plan
plan_forward
,
plan_backward
;
fftw_plan
plan_forward
;
int
i
;
data
=
(
double
*
)
fftw_malloc
(
sizeof
(
double
)
*
this
->
windowsize
);
fft_result
=
(
fftw_complex
*
)
fftw_malloc
(
sizeof
(
fftw_complex
)
*
this
->
windowsize
);
int
outputcounter
=
0
;
fft_result
=
(
fftw_complex
*
)
fftw_malloc
(
sizeof
(
fftw_complex
)
*
this
->
windowsize
);
plan_forward
=
fftw_plan_dft_r2c_1d
(
this
->
windowsize
,
data
,
fft_result
,
FFTW_ESTIMATE
);
// Create a hamming window of appropriate length
float
*
window
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
this
->
windowsize
);
double
*
window
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
this
->
windowsize
);
hamming
(
this
->
windowsize
,
window
);
int
chunkPosition
=
0
;
int
readIndex
;
// Should we stop reading in chunks?
int
bStop
=
0
;
// Process each chunk of the signal
int
channelindex
=
0
;
// Process each chunk of the signal
for
(
channelindex
=
0
;
channelindex
<
this
->
nofmics
;
channelindex
++
)
{
int
outputcounter
=
channelindex
;
int
chunkPosition
=
0
;
while
(
chunkPosition
<
this
->
signallength
&&
!
bStop
)
{
while
(
chunkPosition
<
this
->
signallength
&&
!
bStop
)
{
// Copy the chunk into our buffer
for
(
i
=
0
;
i
<
this
->
windowsize
;
i
++
)
{
// Copy the chunk into our buffer
for
(
i
=
0
;
i
<
this
->
windowsize
;
i
++
)
{
readIndex
=
chunkPosition
+
i
;
readIndex
=
(
chunkPosition
+
i
)
*
this
->
nofmics
+
channelindex
;
if
(
readIndex
<
this
->
signallength
)
{
if
(
readIndex
<
this
->
signallength
*
this
->
nofmics
)
{
// Note the windowing!
data
[
i
]
=
signal
[
readIndex
]
*
window
[
i
];
// Note the windowing!
data
[
i
]
=
signal
[
readIndex
]
*
window
[
i
];
}
else
{
}
else
{
// we have read beyond the signal, so zero-pad it!
// we have read beyond the signal, so zero-pad it!
data
[
i
]
=
0.0
;
data
[
i
]
=
0.0
;
bStop
=
1
;
bStop
=
1
;
}
}
}
// Perform the FFT on our chunk
fftw_execute
(
plan_forward
);
// Perform the FFT on our chunk
fftw_execute
(
plan_forward
);
// Copy the first (windowSize/2 + 1) data points into your spectrogram.
// We do this because the FFT output is mirrored about the nyquist
// frequency, so the second half of the data is redundant. This is how
// Matlab's spectrogram routine works.
// Copy the first (windowSize/2 + 1) data points into your spectrogram.
// We do this because the FFT output is mirrored about the nyquist
// frequency, so the second half of the data is redundant. This is how
// Matlab's spectrogram routine works.
for
(
i
=
0
;
i
<
this
->
windowsize
/
2
;
i
++
)
{
for
(
i
=
0
;
i
<
this
->
windowsize
/
2
;
i
++
)
{
*
(
realpart
+
outputcounter
)
=
fft_result
[
i
][
0
];
*
(
imagpart
+
outputcounter
)
=
fft_result
[
i
][
1
];
*
(
realpart
+
outputcounter
)
=
fft_result
[
i
][
0
];
*
(
imagpart
+
outputcounter
)
=
fft_result
[
i
][
1
];
outputcounter
+=
this
->
nofmics
;
}
outputcounter
+=
this
->
nofmics
;
}
chunkPosition
+=
this
->
overlap
;
chunkPosition
+=
this
->
overlap
;
}
// Excuse the formatting, the while ends here.
}
// Excuse the formatting, the while ends here.
bStop
=
0
;
}
fftw_destroy_plan
(
plan_forward
);
fftw_free
(
data
);
...
...
AnalysisTransform/analysistransform.h
View file @
c9783dab
...
...
@@ -14,10 +14,9 @@ class analysistransform
public:
analysistransform
();
analysistransform
(
int
windowsize
,
int
signallength
,
int
hopsize
,
int
nofmics
);
void
*
ST
FT
(
float
*
signal
,
float
*
realpart
,
float
*
imagpart
);
void
*
F
FT
(
double
*
signal
,
double
*
realpart
,
double
*
imagpart
);
private:
void
hamming
(
int
windowLength
,
float
*
buffer
);
std
::
complex
<
float
>*
outputsignal
;
void
hamming
(
int
windowLength
,
double
*
buffer
);
int
signallength
;
int
windowsize
;
int
overlap
;
...
...
Packager/packager.cpp
View file @
c9783dab
#include
"packager.h"
/*
Audio Scene Geometry : jsonformat
Microphone Array Geometry : jsonformat
Denoised Speech : Interleaved multichannel Audio
Speech1 ----- Speech2 ----- Speech3 ----- SpeechN
Sample11,Sample21,Sample31...SampleK1 ----- Sample12,Sample22,Sample32...SampleK2 ----- Sample1N,Sample2N,Sample3N...SampleKN
packager
::
packager
(
char
audioscene_geometry
[],
char
microphonearray_geometry
[],
double
*
interleavedmultichannelaudio
)
*/
// Constructor for the packager object
packager
::
packager
()
{
// parsing and serializing Audio Scene Geometry
json
j_complete
=
json
::
parse
(
audioscene_geometry
);
*
BlockIndex
=
static_cast
<
double
>
(
j_complete
[
"BlockIndex"
]);
*
BlockStart
=
static_cast
<
double
>
(
j_complete
[
"BlockStart"
]);
*
BlockEnd
=
static_cast
<
double
>
(
j_complete
[
"BlockEnd"
]);
*
SpeechCount
=
static_cast
<
unsigned
char
>
(
j_complete
[
"SpeechCount"
]);
};
// Create message array for the block
unsigned
char
*
packager
::
createdata
(
char
audioscene_geometry
[],
char
microphonearray_geometry
[],
double
*
interleavedmultichannelaudio
,
int
*
messagesize
)
{
// deserializing Audio Scene Geometry json file
json
j_complete
=
json
::
parse
(
audioscene_geometry
);
double
BlockIndex
=
(
double
)
static_cast
<
int
>
(
j_complete
[
"BlockIndex"
]);
double
BlockStart
=
(
double
)
static_cast
<
int
>
(
j_complete
[
"BlockStart"
]);
double
BlockEnd
=
(
double
)
static_cast
<
int
>
(
j_complete
[
"BlockEnd"
]);
unsigned
char
SpeechCount
=
static_cast
<
unsigned
char
>
(
j_complete
[
"SpeechCount"
]);
//
parsing and
serializing Microphone Array Geometry
//
de
serializing Microphone Array Geometry
json file
json
j_complete_mag
=
json
::
parse
(
microphonearray_geometry
);
*
BlockSize
=
blocksizes
[
static_cast
<
int
>
(
j_complete_mag
[
"BlockSize"
])];
*
SamplingRate
=
samplingrates
[
static_cast
<
int
>
(
j_complete_mag
[
"SamplingRate"
])];
*
SampleType
=
sampletypes
[
static_cast
<
int
>
(
j_complete_mag
[
"SampleType"
])];
unsigned
char
BlockSize
=
static_cast
<
unsigned
char
>
(
j_complete_mag
[
"BlockSize"
]);
unsigned
char
SamplingRate
=
static_cast
<
unsigned
char
>
(
j_complete_mag
[
"SamplingRate"
]);
unsigned
char
SampleType
=
static_cast
<
unsigned
char
>
(
j_complete_mag
[
"SampleType"
]);
int
BlockSze
=
static_cast
<
int
>
(
blocksizes
[
j_complete_mag
[
"BlockSize"
]]);
total_msgsize
=
32
+
(
SpeechCount
)
*
(
32
+
8
*
BlockSze
);
int
Sampletpe
=
static_cast
<
int
>
(
sampletypes
[
j_complete_mag
[
"SampleType"
]]);
// Allocation of the output array
packagedcontent
=
(
unsigned
char
*
)
calloc
(
sizeof
(
unsigned
char
),
total_msgsize
);
// Mem copy for the pointer addresses
memcpy
(
packagedcontent
,
&
"EAE"
,
3
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
3
,
&
BlockIndex
,
8
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
11
,
&
BlockStart
,
8
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
19
,
&
BlockEnd
,
8
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
27
,
&
BlockSize
,
1
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
28
,
&
SamplingRate
,
1
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
29
,
&
SpeechCount
,
1
*
sizeof
(
unsigned
char
));
memcpy
(
packagedcontent
+
30
,
&
SampleType
,
1
*
sizeof
(
unsigned
char
));
for
(
int
klm
=
0
;
klm
<
*
SpeechCount
;
klm
++
)
// Checksum for the message Header
int
sum
=
0
;
for
(
int
ind
=
0
;
ind
<
31
;
ind
++
){
sum
+=
*
(
packagedcontent
+
ind
);}
*
(
packagedcontent
+
31
)
=
sum
%
256
;
// For each speech object, place the denoised speech to the message
for
(
int
klm
=
0
;
klm
<
SpeechCount
;
klm
++
)
{
unsigned
char
*
speechuuid
;
//;
insertnewspeech
(
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"AzimuthDirection"
]),
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"ElevationDirection"
]),
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"Distance"
]),
static_cast
<
unsigned
char
>
(
j_complete
[
"SpeechList"
][
klm
][
"DistanceFlag"
]),
(
int
)(
*
BlockSize
),
interleavedmultichannelaudio
,
static_cast
<
int
>
(
j_complete
[
"SpeechList"
][
klm
][
"ChannelID"
]),
speechuuid
);
int
speech_index
=
klm
*
(
int
)(
BlockSze
);
int
messagedata_index
=
32
+
klm
*
(
32
+
8
*
BlockSze
);
string
s_uuid
=
j_complete
[
"SpeechList"
][
klm
][
"SpeechID"
];
insertnewspeech
(
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"AzimuthDirection"
]),
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"ElevationDirection"
]),
static_cast
<
double
>
(
j_complete
[
"SpeechList"
][
klm
][
"Distance"
]),
static_cast
<
unsigned
char
>
(
j_complete
[
"SpeechList"
][
klm
][
"DistanceFlag"
]),
(
int
)(
BlockSze
),
interleavedmultichannelaudio
+
speech_index
,
static_cast
<
int
>
(
j_complete
[
"SpeechList"
][
klm
][
"ChannelID"
]),
s_uuid
,
packagedcontent
+
messagedata_index
,
Sampletpe
/
4
);
}
}
;
*
messagesize
=
total_msgsize
;
void
packager
::
insertnewspeech
(
double
m_Azimuth
,
double
m_Elevation
,
double
m_Distance
,
unsigned
char
m_DistanceFlag
,
int
m_blocksize
,
double
*
m_interleavedmultichannel
,
int
ChannelID
,
unsigned
char
*
uuid
)
{
SpeechInfo
m_speech
=
SpeechInfo
();
return
packagedcontent
;
}
*
m_speech
.
Azimuth
=
m_Azimuth
;
*
m_speech
.
Elevation
=
m_Elevation
;
*
m_speech
.
Distance
=
m_Distance
;
*
m_speech
.
DistanceFlag
=
m_DistanceFlag
;
// Insert speech data into array
void
packager
::
insertnewspeech
(
float
m_Azimuth
,
float
m_Elevation
,
float
m_Distance
,
unsigned
char
m_DistanceFlag
,
int
m_blocksize
,
double
*
m_interleavedmultichannel
,
int
ChannelID
,
string
uuid
,
unsigned
char
*
in_array
,
int
samplebytes
)
{
// Speech Information Header
memcpy
(
in_array
,
&
uuid
,
16
*
sizeof
(
unsigned
char
));
memcpy
(
in_array
+
16
,
&
m_Azimuth
,
4
*
sizeof
(
unsigned
char
));
memcpy
(
in_array
+
20
,
&
m_Elevation
,
4
*
sizeof
(
unsigned
char
));
memcpy
(
in_array
+
24
,
&
m_Distance
,
4
*
sizeof
(
unsigned
char
));
memcpy
(
in_array
+
28
,
&
m_DistanceFlag
,
1
*
sizeof
(
unsigned
char
));
// Speech Header
int
sum
=
0
;
for
(
int
ind
=
0
;
ind
<
30
;
ind
++
){
sum
+=
*
(
in_array
+
ind
);
}
*
(
in_array
+
31
)
=
sum
%
256
;
m_speech
.
speechdata
=
m_interleavedmultichannel
;
Speech
.
push_back
(
m_speech
);
};
\ No newline at end of file
memcpy
(
in_array
+
32
,
m_interleavedmultichannel
,
m_blocksize
*
sizeof
(
unsigned
char
)
*
samplebytes
);
};
Packager/packager.h
View file @
c9783dab
...
...
@@ -6,36 +6,20 @@
using
namespace
std
;
using
json
=
nlohmann
::
json
;
class
SpeechInfo
{
public:
unsigned
char
Speechuuid
[
16
];
unsigned
char
Azimuth
[
4
];
unsigned
char
Elevation
[
4
];
unsigned
char
Distance
[
4
];
unsigned
char
DistanceFlag
[
1
];
double
*
speechdata
;
};
class
packager
{
public:
packager
(
char
audioscene_geometry
[],
char
microphonearray_geometry
[],
double
*
interleavedmultichannelaudio
);
void
insertnewspeech
(
double
m_Azimuth
,
double
m_Elevation
,
double
m_Distance
,
unsigned
char
m_DistanceFlag
,
int
m_blocksize
,
double
*
m_interleavedmultichannel
,
int
ChannelID
,
unsigned
char
*
uuid
);
packager
();
void
insertnewspeech
(
float
m_Azimuth
,
float
m_Elevation
,
float
m_Distance
,
unsigned
char
m_DistanceFlag
,
int
m_blocksize
,
double
*
m_interleavedmultichannel
,
int
ChannelID
,
string
uuid
,
unsigned
char
*
in_array
,
int
samplebytes
);
unsigned
char
*
createdata
(
char
audioscene_geometry
[],
char
microphonearray_geometry
[],
double
*
interleavedmultichannelaudio
,
int
*
messagesize
);
private:
unsigned
char
Header
[
3
]
=
{
0x45
,
0x41
,
0x45
};
unsigned
char
BlockIndex
[
8
];
unsigned
char
BlockStart
[
8
];
unsigned
char
BlockEnd
[
8
];
unsigned
char
BlockSize
[
1
];
unsigned
char
SamplingRate
[
1
];
unsigned
char
SpeechCount
[
1
];
unsigned
char
SampleType
[
1
];
unsigned
char
Checksum
[
1
];
vector
<
SpeechInfo
>
Speech
;
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
};
int
total_msgsize
;
unsigned
char
*
packagedcontent
;
};
SoundFieldDescription/soundfielddescription.cpp
View file @
c9783dab
...
...
@@ -6,60 +6,10 @@
//}
soundfielddescription
::
soundfielddescription
()
soundfielddescription
::
soundfielddescription
(
char
microphone_array_geometry
[]
)
{
char
text
[]
=
R"(
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Microphone Array Geometry",
"MicrophoneArrayType": 0,
"MicrophoneArrayScat": 0,
"MicrophoneArrayFilterURI": "filter.file",
"SamplingRate": 4,
"SampleType": 2,
"BlockSize": 5,
"NumberofMicrophones": 32,
"MicrophoneList" : [
{"xCoord" : 0.93358,"yCoord" : 0.0,"zCoord" : 0.35836,"directivity" : 0.0,"micxLookCoord" : 0.93358,"micyLookCoord" : 0.0,"miczLookCoord" : 0.35836},
{"xCoord" : 0.84804,"yCoord" : 0.52991,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : 0.84804,"micyLookCoord" : 0.52991,"miczLookCoord" : 0.0},
{"xCoord" : 0.93358,"yCoord" : 0.0,"zCoord" : -0.35836,"directivity" : 0.0,"micxLookCoord" : 0.93358,"micyLookCoord" : 0.0,"miczLookCoord" : -0.35836},
{"xCoord" : 0.84804,"yCoord" : -0.52991,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : 0.84804,"micyLookCoord" : -0.52991,"miczLookCoord" : 0.0},
{"xCoord" : 0.52991,"yCoord" : 0.0,"zCoord" : 0.84804,"directivity" : 0.0,"micxLookCoord" : 0.52991,"micyLookCoord" : 0.0,"miczLookCoord" : 0.84804},
{"xCoord" : 0.57922,"yCoord" : 0.57922,"zCoord" : 0.57357,"directivity" : 0.0,"micxLookCoord" : 0.57922,"micyLookCoord" : 0.57922,"miczLookCoord" : 0.57357},
{"xCoord" : 0.35836,"yCoord" : 0.93358,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : 0.35836,"micyLookCoord" : 0.93358,"miczLookCoord" : 0.0},
{"xCoord" : 0.57922,"yCoord" : 0.57922,"zCoord" : -0.57357,"directivity" : 0.0,"micxLookCoord" : 0.57922,"micyLookCoord" : 0.57922,"miczLookCoord" : -0.57357},
{"xCoord" : 0.52991,"yCoord" : 0.0,"zCoord" : -0.84804,"directivity" : 0.0,"micxLookCoord" : 0.52991,"micyLookCoord" : 0.0,"miczLookCoord" : -0.84804},
{"xCoord" : 0.57922,"yCoord" : -0.57922,"zCoord" : -0.57357,"directivity" : 0.0,"micxLookCoord" : 0.57922,"micyLookCoord" : -0.57922,"miczLookCoord" : -0.57357},
{"xCoord" : 0.35836,"yCoord" : -0.93358,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : 0.35836,"micyLookCoord" : -0.93358,"miczLookCoord" : 0.0},
{"xCoord" : 0.57922,"yCoord" : -0.57922,"zCoord" : 0.57357,"directivity" : 0.0,"micxLookCoord" : 0.57922,"micyLookCoord" : -0.57922,"miczLookCoord" : 0.57357},
{"xCoord" : -0.00625,"yCoord" : 0.35831,"zCoord" : 0.93358,"directivity" : 0.0,"micxLookCoord" : -0.00625,"micyLookCoord" : 0.35831,"miczLookCoord" : 0.93358},
{"xCoord" : 0.0,"yCoord" : 0.84804,"zCoord" : 0.52991,"directivity" : 0.0,"micxLookCoord" : 0.0,"micyLookCoord" : 0.84804,"miczLookCoord" : 0.52991},
{"xCoord" : 0.0,"yCoord" : 0.85716,"zCoord" : -0.51503,"directivity" : 0.0,"micxLookCoord" : 0.0,"micyLookCoord" : 0.85716,"miczLookCoord" : -0.51503},
{"xCoord" : 0.006254,"yCoord" : 0.35831,"zCoord" : -0.93358,"directivity" : 0.0,"micxLookCoord" : 0.006254,"micyLookCoord" : 0.35831,"miczLookCoord" : -0.93358},
{"xCoord" : -0.93358,"yCoord" : 0.0,"zCoord" : 0.35836,"directivity" : 0.0,"micxLookCoord" : -0.93358,"micyLookCoord" : 0.0,"miczLookCoord" : 0.35836},
{"xCoord" : -0.84804,"yCoord" : -0.52991,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : -0.84804,"micyLookCoord" : -0.52991,"miczLookCoord" : 0.0},
{"xCoord" : -0.93358,"yCoord" : 0.0,"zCoord" : -0.35836,"directivity" : 0.0,"micxLookCoord" : -0.93358,"micyLookCoord" : 0.0,"miczLookCoord" : -0.35836},
{"xCoord" : -0.84804,"yCoord" : 0.52991,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : -0.84804,"micyLookCoord" : 0.52991,"miczLookCoord" : 0.0},
{"xCoord" : -0.52991,"yCoord" : 0.0,"zCoord" : 0.84804,"directivity" : 0.0,"micxLookCoord" : -0.52991,"micyLookCoord" : 0.0,"miczLookCoord" : 0.84804},
{"xCoord" : -0.57922,"yCoord" : -0.57922,"zCoord" : 0.57357,"directivity" : 0.0,"micxLookCoord" : -0.57922,"micyLookCoord" : -0.57922,"miczLookCoord" : 0.57357},
{"xCoord" : -0.35836,"yCoord" : -0.93358,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : -0.35836,"micyLookCoord" : -0.93358,"miczLookCoord" : 0.0},
{"xCoord" : -0.57922,"yCoord" : -0.57922,"zCoord" : -0.57357,"directivity" : 0.0,"micxLookCoord" : -0.57922,"micyLookCoord" : -0.57922,"miczLookCoord" : -0.57357},
{"xCoord" : -0.52991,"yCoord" : 0.0,"zCoord" : -0.84804,"directivity" : 0.0,"micxLookCoord" : -0.52991,"micyLookCoord" : 0.0,"miczLookCoord" : -0.84804},
{"xCoord" : -0.57922,"yCoord" : 0.57922,"zCoord" : -0.57357,"directivity" : 0.0,"micxLookCoord" : -0.57922,"micyLookCoord" : 0.57922,"miczLookCoord" : -0.57357},
{"xCoord" : -0.35836,"yCoord" : 0.93358,"zCoord" : 0.0,"directivity" : 0.0,"micxLookCoord" : -0.35836,"micyLookCoord" : 0.93358,"miczLookCoord" : 0.0},
{"xCoord" : -0.57922,"yCoord" : 0.57922,"zCoord" : 0.57357,"directivity" : 0.0,"micxLookCoord" : -0.57922,"micyLookCoord" : 0.57922,"miczLookCoord" : 0.57357},
{"xCoord" : -0.00625,"yCoord" : -0.35831,"zCoord" : 0.93358,"directivity" : 0.0,"micxLookCoord" : -0.00625,"micyLookCoord" : -0.35831,"miczLookCoord" : 0.93358},
{"xCoord" : 0.0,"yCoord" : -0.84804,"zCoord" : 0.52991,"directivity" : 0.0,"micxLookCoord" : 0.0,"micyLookCoord" : -0.84804,"miczLookCoord" : 0.52991},
{"xCoord" : 0.0,"yCoord" : -0.84804,"zCoord" : -0.52991,"directivity" : 0.0,"micxLookCoord" : 0.0,"micyLookCoord" : -0.84804,"miczLookCoord" : -0.52991},
{"xCoord" : 0.00625,"yCoord" : -0.35831,"zCoord" : -0.93358,"directivity" : 0.0,"micxLookCoord" : 0.00625,"micyLookCoord" : -0.35831,"miczLookCoord" : -0.93358}
],
"MicrophoneArrayLookCoord" : {"xLookCoord" : 0.0, "yLookCoord" : 0.0, "zLookCoord" : 0.0}
}
)"
;
// parsing and serializing JSON
json
j_complete
=
json
::
parse
(
text
);
json
j_complete
=
json
::
parse
(
microphone_array_geometry
);
nofmicrophones
=
j_complete
[
"NumberofMicrophones"
];
array_type
=
(
ArrayType
)
j_complete
[
"MicrophoneArrayType"
];
...
...
SoundFieldDescription/soundfielddescription.h
View file @
c9783dab
...
...
@@ -45,7 +45,7 @@ enum class ArrayScattering
class
soundfielddescription
{
public:
soundfielddescription
();
soundfielddescription
(
char
microphone_array_geometry
[]
);
void
*
calcsphericalharmonics
(
double
*
pressure_real_in
,
double
*
pressure_imag_in
,
double
*
shd_realpart_out
,
double
*
shd_imagpart_out
);
private:
vector
<
float
>
micanglestheta
;
...
...
audioscenegeometry.json
0 → 100644
View file @
c9783dab
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"title"
:
"Audio Scene Geometry"
,
"BlockIndex"
:
1
,
"BlockStart"
:
1659533438878
,
"BlockEnd"
:
1659533438898
,
"SpeechCount"
:
1
,
"SourceDetectionMask"
:
[
1
,
1
,
1
],
"SpeechList"
:
[
{
"SpeechID"
:
"09859d16-3c73-4bb0-9c74-91b451e34925"
,
"ChannelID"
:
0.0
,
"AzimuthDirection"
:
0.35836
,
"ElevationDirection"
:
0.0
,
"DistanceFlag"
:
0.93358
,
"Distance"
:
0.0
}
]
}
\ No newline at end of file
microphonearraygeometry.json
0 → 100644
View file @
c9783dab
{
"$schema"
:
"http://json-schema.org/draft-07/schema#"
,
"title"
:
"Microphone Array Geometry"
,
"MicrophoneArrayType"
:
0
,
"MicrophoneArrayScat"
:
0
,
"MicrophoneArrayFilterURI"
:
"filter.file"
,
"SamplingRate"
:
4
,
"SampleType"
:
2
,
"BlockSize"
:
5
,
"NumberofMicrophones"
:
32
,
"MicrophoneList"
:
[
{
"xCoord"
:
0.93358
,
"yCoord"
:
0.0
,
"zCoord"
:
0.35836
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.93358
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
0.35836
},
{
"xCoord"
:
0.84804
,
"yCoord"
:
0.52991
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.84804
,
"micyLookCoord"
:
0.52991
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
0.93358
,
"yCoord"
:
0.0
,
"zCoord"
:
-0.35836
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.93358
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
-0.35836
},
{
"xCoord"
:
0.84804
,
"yCoord"
:
-0.52991
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.84804
,
"micyLookCoord"
:
-0.52991
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
0.52991
,
"yCoord"
:
0.0
,
"zCoord"
:
0.84804
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.52991
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
0.84804
},
{
"xCoord"
:
0.57922
,
"yCoord"
:
0.57922
,
"zCoord"
:
0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.57922
,
"micyLookCoord"
:
0.57922
,
"miczLookCoord"
:
0.57357
},
{
"xCoord"
:
0.35836
,
"yCoord"
:
0.93358
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.35836
,
"micyLookCoord"
:
0.93358
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
0.57922
,
"yCoord"
:
0.57922
,
"zCoord"
:
-0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.57922
,
"micyLookCoord"
:
0.57922
,
"miczLookCoord"
:
-0.57357
},
{
"xCoord"
:
0.52991
,
"yCoord"
:
0.0
,
"zCoord"
:
-0.84804
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.52991
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
-0.84804
},
{
"xCoord"
:
0.57922
,
"yCoord"
:
-0.57922
,
"zCoord"
:
-0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.57922
,
"micyLookCoord"
:
-0.57922
,
"miczLookCoord"
:
-0.57357
},
{
"xCoord"
:
0.35836
,
"yCoord"
:
-0.93358
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.35836
,
"micyLookCoord"
:
-0.93358
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
0.57922
,
"yCoord"
:
-0.57922
,
"zCoord"
:
0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.57922
,
"micyLookCoord"
:
-0.57922
,
"miczLookCoord"
:
0.57357
},
{
"xCoord"
:
-0.00625
,
"yCoord"
:
0.35831
,
"zCoord"
:
0.93358
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.00625
,
"micyLookCoord"
:
0.35831
,
"miczLookCoord"
:
0.93358
},
{
"xCoord"
:
0.0
,
"yCoord"
:
0.84804
,
"zCoord"
:
0.52991
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.0
,
"micyLookCoord"
:
0.84804
,
"miczLookCoord"
:
0.52991
},
{
"xCoord"
:
0.0
,
"yCoord"
:
0.85716
,
"zCoord"
:
-0.51503
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.0
,
"micyLookCoord"
:
0.85716
,
"miczLookCoord"
:
-0.51503
},
{
"xCoord"
:
0.006254
,
"yCoord"
:
0.35831
,
"zCoord"
:
-0.93358
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.006254
,
"micyLookCoord"
:
0.35831
,
"miczLookCoord"
:
-0.93358
},
{
"xCoord"
:
-0.93358
,
"yCoord"
:
0.0
,
"zCoord"
:
0.35836
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.93358
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
0.35836
},
{
"xCoord"
:
-0.84804
,
"yCoord"
:
-0.52991
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.84804
,
"micyLookCoord"
:
-0.52991
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
-0.93358
,
"yCoord"
:
0.0
,
"zCoord"
:
-0.35836
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.93358
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
-0.35836
},
{
"xCoord"
:
-0.84804
,
"yCoord"
:
0.52991
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.84804
,
"micyLookCoord"
:
0.52991
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
-0.52991
,
"yCoord"
:
0.0
,
"zCoord"
:
0.84804
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.52991
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
0.84804
},
{
"xCoord"
:
-0.57922
,
"yCoord"
:
-0.57922
,
"zCoord"
:
0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.57922
,
"micyLookCoord"
:
-0.57922
,
"miczLookCoord"
:
0.57357
},
{
"xCoord"
:
-0.35836
,
"yCoord"
:
-0.93358
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.35836
,
"micyLookCoord"
:
-0.93358
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
-0.57922
,
"yCoord"
:
-0.57922
,
"zCoord"
:
-0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.57922
,
"micyLookCoord"
:
-0.57922
,
"miczLookCoord"
:
-0.57357
},
{
"xCoord"
:
-0.52991
,
"yCoord"
:
0.0
,
"zCoord"
:
-0.84804
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.52991
,
"micyLookCoord"
:
0.0
,
"miczLookCoord"
:
-0.84804
},
{
"xCoord"
:
-0.57922
,
"yCoord"
:
0.57922
,
"zCoord"
:
-0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.57922
,
"micyLookCoord"
:
0.57922
,
"miczLookCoord"
:
-0.57357
},
{
"xCoord"
:
-0.35836
,
"yCoord"
:
0.93358
,
"zCoord"
:
0.0
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.35836
,
"micyLookCoord"
:
0.93358
,
"miczLookCoord"
:
0.0
},
{
"xCoord"
:
-0.57922
,
"yCoord"
:
0.57922
,
"zCoord"
:
0.57357
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.57922
,
"micyLookCoord"
:
0.57922
,
"miczLookCoord"
:
0.57357
},
{
"xCoord"
:
-0.00625
,
"yCoord"
:
-0.35831
,
"zCoord"
:
0.93358
,
"directivity"
:
0.0
,
"micxLookCoord"
:
-0.00625
,
"micyLookCoord"
:
-0.35831
,
"miczLookCoord"
:
0.93358
},
{
"xCoord"
:
0.0
,
"yCoord"
:
-0.84804
,
"zCoord"
:
0.52991
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.0
,
"micyLookCoord"
:
-0.84804
,
"miczLookCoord"
:
0.52991
},
{
"xCoord"
:
0.0
,
"yCoord"
:
-0.84804
,
"zCoord"
:
-0.52991
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.0
,
"micyLookCoord"
:
-0.84804
,
"miczLookCoord"
:
-0.52991
},
{
"xCoord"
:
0.00625
,
"yCoord"
:
-0.35831
,
"zCoord"
:
-0.93358
,
"directivity"
:
0.0
,
"micxLookCoord"
:
0.00625
,
"micyLookCoord"
:
-0.35831
,
"miczLookCoord"
:
-0.93358
}
],
"MicrophoneArrayLookCoord"
:
{
"xLookCoord"
:
0.0
,
"yLookCoord"
:
0.0
,
"zLookCoord"
:
0.0
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment