Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institute of Technical Acoustics (ITA)
toolbox
Commits
c6c45ff8
Commit
c6c45ff8
authored
Dec 11, 2017
by
Markus Mueller-Trapet
Browse files
bugfix related to zeros at beginning and end
parent
1b663fd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/DSP/Edit/ita_multiple_time_windows.m
View file @
c6c45ff8
...
...
@@ -32,16 +32,16 @@ else
nOverlap
=
round
(
sArgs
.
overlap
);
end
nSegments
=
ceil
(
a
.
nSamples
/
(
nWindow
-
nOverlap
))
+
1
;
nNewLength
=
(
nSegments
-
1
)
*
(
nWindow
-
nOverlap
)
+
nWindow
;
if
nNewLength
-
nWindow
>
a
.
nSamples
a
=
ita_extend_dat
(
a
,
nNewLength
-
nWindow
,
'forcesamples'
);
end
% half a window length at beginning and end
ext_zeros
=
zeros
(
nWindow
/
2
,
a
.
nChannels
);
data
=
[
ext_zeros
;
a
.
time
;
ext_zeros
];
nSegments
=
ceil
((
size
(
data
,
1
)
-
nWindow
)
/
(
nWindow
-
nOverlap
))
+
1
;
nNewLength
=
(
nSegments
-
1
)
*
(
nWindow
-
nOverlap
)
+
nWindow
;
if
nNewLength
>
a
.
nSamples
a
=
ita_extend_dat
(
a
,
nNewLength
,
'forcesamples'
);
end
%% generate window
win_vec
=
window
(
sArgs
.
window
,
nWindow
+
1
);
win_vec
(
end
)
=
[];
...
...
Write
Preview
Supports
Markdown
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