Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
audiowmark
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
audiowmark
Commits
035b27f1
Commit
035b27f1
authored
Aug 14, 2022
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify crash
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
75556db4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
35 deletions
+3
-35
wmspeed.cc
src/wmspeed.cc
+3
-35
No files found.
src/wmspeed.cc
View file @
035b27f1
...
...
@@ -215,13 +215,6 @@ SpeedSync::prepare_mags (const SpeedScanParams& scan_params)
const
int
sub_frame_size
=
Params
::
frame_size
/
2
;
const
int
sub_sync_search_step
=
Params
::
sync_search_step
/
2
;
vector
<
float
>
window
=
FFTAnalyzer
::
gen_normalized_window
(
sub_frame_size
);
FFTProcessor
fft_processor
(
sub_frame_size
);
float
*
in
=
fft_processor
.
in
();
float
*
out
=
fft_processor
.
out
();
/* set mag matrix size */
int
n_sync_rows
=
0
;
int
n_sync_cols
=
sync_bits
.
size
();
...
...
@@ -229,42 +222,17 @@ SpeedSync::prepare_mags (const SpeedScanParams& scan_params)
n_sync_rows
++
;
sync_matrix
.
resize
(
n_sync_rows
,
n_sync_cols
);
size_t
pos
=
0
;
int
row
=
0
;
while
(
pos
+
sub_frame_size
<
in_data_sub
.
n_frames
())
for
(
int
row
=
0
;
row
<
n_sync_rows
;
row
++
)
{
int
col
=
0
;
const
std
::
vector
<
float
>&
samples
=
in_data_sub
.
samples
();
vector
<
float
>
fft_out_db
;
for
(
int
ch
=
0
;
ch
<
in_data_sub
.
n_channels
();
ch
++
)
{
for
(
int
i
=
0
;
i
<
sub_frame_size
;
i
++
)
{
in
[
i
]
=
samples
[
ch
+
(
pos
+
i
)
*
in_data_sub
.
n_channels
()]
*
window
[
i
];
}
fft_processor
.
fft
();
for
(
int
i
=
Params
::
min_band
;
i
<=
Params
::
max_band
;
i
++
)
{
const
float
min_db
=
-
96
;
fft_out_db
.
push_back
(
db_from_complex
(
out
[
i
*
2
],
out
[
i
*
2
+
1
],
min_db
));
}
}
for
(
const
auto
&
sync_bit
:
sync_bits
)
for
(
int
col
=
0
;
col
<
n_sync_cols
;
col
++
)
{
float
umag
=
1
,
dmag
=
1
;
sync_matrix
(
row
,
col
++
)
=
MagMatrix
::
Mags
{
umag
,
dmag
};
sync_matrix
(
row
,
col
)
=
MagMatrix
::
Mags
{
umag
,
dmag
};
assert
(
umag
!=
0
);
assert
(
dmag
!=
0
);
}
assert
(
col
==
n_sync_cols
);
row
++
;
pos
+=
sub_sync_search_step
;
}
assert
(
row
==
n_sync_rows
);
}
template
<
bool
B2
>
void
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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