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
c2d3e569
Commit
c2d3e569
authored
Nov 28, 2018
by
Stefan Westerfeld
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More FFT refactoring.
Signed-off-by:
Stefan Westerfeld
<
stefan@space.twc.de
>
parent
9d0fa112
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
17 deletions
+3
-17
audiowmark.cc
src/audiowmark.cc
+3
-17
No files found.
src/audiowmark.cc
View file @
c2d3e569
...
...
@@ -390,33 +390,19 @@ get_watermark (const string& origfile, const string& infile, const string& orig_
frame
[
i
]
*=
2.0
/
window_weight
;
/* FFT transform */
float
*
fft_in
=
new_array_float
(
frame
.
size
());
float
*
fft_out
=
new_array_float
(
frame
.
size
());
std
::
copy
(
frame
.
begin
(),
frame
.
end
(),
fft_in
);
fftar_float
(
frame
.
size
(),
fft_in
,
fft_out
);
vector
<
complex
<
float
>>
fft_out
=
fft
(
frame
);
vector
<
int
>
up
;
vector
<
int
>
down
;
get_up_down
(
f
,
up
,
down
);
for
(
auto
u
:
up
)
{
const
double
re
=
fft_out
[
u
*
2
];
const
double
im
=
fft_out
[
u
*
2
+
1
];
const
double
mag
=
sqrt
(
re
*
re
+
im
*
im
);
umag
+=
log
(
mag
);
umag
+=
log
(
abs
(
fft_out
[
u
]));
}
for
(
auto
d
:
down
)
{
const
double
re
=
fft_out
[
d
*
2
];
const
double
im
=
fft_out
[
d
*
2
+
1
];
const
double
mag
=
sqrt
(
re
*
re
+
im
*
im
);
dmag
+=
log
(
mag
);
dmag
+=
log
(
abs
(
fft_out
[
d
]));
}
free_array_float
(
fft_out
);
free_array_float
(
fft_in
);
}
}
if
((
f
%
Params
::
frames_per_bit
)
==
(
Params
::
frames_per_bit
-
1
))
...
...
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