Fri 09 Aug 2013 03:34:35 AM UTC, comment #2:
Thanks for confirming.
Yes, it probably should work if lengths are the same, subject to compatibility.
As written, the function seems to broadcast a column window across the columns of a matrix signal argument, which is compatible with fft matrix handling. But, I have not tested this.
M.Reich
|
Fri 09 Aug 2013 02:50:15 AM UTC, comment #1:
Confirmed in the development version of Octave as well. The window is not applied but the signal is still normalized by the window power.
The function also fails if the signal argument is a row vector instead of a column vector, with or without a window. I think it should work on any combination of row or column vector inputs as long as they have the same length.
|
Thu 08 Aug 2013 03:24:48 PM UTC, original submission:
periodogram(x,win,...)returns an incorrect result if win is a row vector or if win is a column vector whose length does not equal the length of parameter x. Here, '...' represents be the remaining optional parameters.
In the current implementation of periodogram, lines 108 through 114 apply the window 'win' only if either
(size (x) == size (window)
or if
(size (x, 1) == size (window, 1) && size (window, 2) == 1)
As a result, if 'win' is a row vector whose length equals the length of 'x', the window is not applied, although it would make sense to do so. In the case that the lengths of 'win' and 'x' do not match, it would make sense to flag an error.
Moreover, since line 147 normalizes the periodogram by 'win'even if the window was not applied, the function can return an incorrect result.
Most window functions in the signal library work correctly as the 'win' parameter since they return column vectors, e.g.
size(blackman(1000))
But those which return row vectors need conversion to column a vector to work correctly, e.g
size(blackmanharris(1000))
|