You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mdctn wraps input data around so the transformed output is exactly the same size as the input. Let's see what we mean by that:
Imagine a signal with 6 samples: a b c d e f, and we need to apply MDCT on it with a window length of 4.
Here are our windows:
a b c d
c d e f
We were able to create two windows, both of which overlap on c d. Because IMDCT can only recover samples that at least two windows overlap on, we can recover c d with IMDCT, but sample a b e f are lost.
The common solution to this, as far as I've seen, is to pad the signal at the beginning and the ending.
padded_signal = 0 0 a b c d e f 0 0
Now we have 4 over-lapping windows:
0 0 a b
a b c d
c d e f
e f 0 0
Now all of our samples are in at least two windows, and we'll be able to recover them all. But after transformation, the output has more samples than the input signal has. A window of 4 samples has 2 samples after applying MDCT, so our output has 8 samples, while the input has 6.
Instead of padding, mdctn wraps the signal around, by copying the initial samples to the end. Like so:
wrapped_signal = a b c d e f a b
In practice, the first and last N/4 samples are copied, where N is the window length. But N/4 is 1 in our example.
Let's see what our windows look like:
a b c d
c d e f
e f a b
All the samples are in two windows, so using the intersection of the first and last windows' IMDCT, we'll be able to recover all the samples using the same number of samples as input.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
mdctn
wraps input data around so the transformed output is exactly the same size as the input. Let's see what we mean by that:Imagine a signal with 6 samples:
a b c d e f
, and we need to apply MDCT on it with a window length of 4.Here are our windows:
a b c d
c d e f
We were able to create two windows, both of which overlap on
c d
. Because IMDCT can only recover samples that at least two windows overlap on, we can recoverc d
with IMDCT, but samplea b e f
are lost.The common solution to this, as far as I've seen, is to pad the signal at the beginning and the ending.
padded_signal = 0 0 a b c d e f 0 0
Now we have 4 over-lapping windows:
0 0 a b
a b c d
c d e f
e f 0 0
Now all of our samples are in at least two windows, and we'll be able to recover them all. But after transformation, the output has more samples than the input signal has. A window of 4 samples has 2 samples after applying MDCT, so our output has 8 samples, while the input has 6.
Instead of padding,
mdctn
wraps the signal around, by copying the initial samples to the end. Like so:wrapped_signal = a b c d e f a b
In practice, the first and last
N/4
samples are copied, whereN
is the window length. ButN/4
is 1 in our example.Let's see what our windows look like:
a b c d
c d e f
e f a b
All the samples are in two windows, so using the intersection of the first and last windows' IMDCT, we'll be able to recover all the samples using the same number of samples as input.
Beta Was this translation helpful? Give feedback.
All reactions