stftLayer error: “Size of input in T dimension must be greater than or equal to window length” despite correct input shape
Hi everyone,
I’m encountering a confusing issue when using the stftLayer in MATLAB’s Deep Learning Toolbox. I’m trying to pass a dlarray signal to an stftLayer inside a dlnetwork. The input signal has size:
size(signal) – [1 24 2401]
dims(signal) – ‘CBT’
The stfftLayer configuration is:
winLength = 256;
overlap = 128;
fftLength = 256;
stft_net = [sequenceInputLayer(size(signal,1))
stftLayer("Window",winLength,"FFTLength",fftLength,"OverlapLength",overlap,"Name","stft")];
stftNet = dlnetwork(stft_net);
However, when I am trying to use this model, I am receiving the following error:
Error using stftLayer/validateProperties (line 238)
Window length must be greater than one sample.
Error in stftLayer (line 166)
this = validateProperties(this);
^^^^^^^^^^^^^^^^^^^^^^^^
The signal properties are shown below for further clarity
K>> size(signal)
ans =
1 24 2401
K>> dims(signal)
ans =
‘CBT’
What could be causing the stftLayer to misinterpret the time dimension and throw the error, even when T is clearly larger than the window length? Any insights would be much appreciated.Hi everyone,
I’m encountering a confusing issue when using the stftLayer in MATLAB’s Deep Learning Toolbox. I’m trying to pass a dlarray signal to an stftLayer inside a dlnetwork. The input signal has size:
size(signal) – [1 24 2401]
dims(signal) – ‘CBT’
The stfftLayer configuration is:
winLength = 256;
overlap = 128;
fftLength = 256;
stft_net = [sequenceInputLayer(size(signal,1))
stftLayer("Window",winLength,"FFTLength",fftLength,"OverlapLength",overlap,"Name","stft")];
stftNet = dlnetwork(stft_net);
However, when I am trying to use this model, I am receiving the following error:
Error using stftLayer/validateProperties (line 238)
Window length must be greater than one sample.
Error in stftLayer (line 166)
this = validateProperties(this);
^^^^^^^^^^^^^^^^^^^^^^^^
The signal properties are shown below for further clarity
K>> size(signal)
ans =
1 24 2401
K>> dims(signal)
ans =
‘CBT’
What could be causing the stftLayer to misinterpret the time dimension and throw the error, even when T is clearly larger than the window length? Any insights would be much appreciated. Hi everyone,
I’m encountering a confusing issue when using the stftLayer in MATLAB’s Deep Learning Toolbox. I’m trying to pass a dlarray signal to an stftLayer inside a dlnetwork. The input signal has size:
size(signal) – [1 24 2401]
dims(signal) – ‘CBT’
The stfftLayer configuration is:
winLength = 256;
overlap = 128;
fftLength = 256;
stft_net = [sequenceInputLayer(size(signal,1))
stftLayer("Window",winLength,"FFTLength",fftLength,"OverlapLength",overlap,"Name","stft")];
stftNet = dlnetwork(stft_net);
However, when I am trying to use this model, I am receiving the following error:
Error using stftLayer/validateProperties (line 238)
Window length must be greater than one sample.
Error in stftLayer (line 166)
this = validateProperties(this);
^^^^^^^^^^^^^^^^^^^^^^^^
The signal properties are shown below for further clarity
K>> size(signal)
ans =
1 24 2401
K>> dims(signal)
ans =
‘CBT’
What could be causing the stftLayer to misinterpret the time dimension and throw the error, even when T is clearly larger than the window length? Any insights would be much appreciated. stftlayer, deep learning, signal processing MATLAB Answers — New Questions