octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52758] [octave forge] (signal-1.3.2) fracshif


From: Klaus Braun
Subject: [Octave-bug-tracker] [bug #52758] [octave forge] (signal-1.3.2) fracshift(x, d) don't shift, if d is an integer
Date: Fri, 19 Jan 2018 17:55:59 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0

Follow-up Comment #1, bug #52758 (project octave):

Is anybody reading bug reports from Anonymous Windows users?
I have now registered and try it again...

fracshift(x,d) does not work if x is a row vector and d is an integer.
If d is an exact integer fracshift uses circshift(x,d) in line 41 of
fracshift.m. But circshift expects the dimension to shift as 3rd parameter -
if it is omitted it shifts the columns and in case of a row vector it does
effectively nothing, see following example:


x = [0 1 0 0 0 0 0 0];  %row vector doesn't work
#x = [0;1;0;0;0;0;0;0];  %column vector works

y = fracshift(x,1);    %integer shift doesn't work
#y = fracshift(x,1.1);  %fractional shift works

subplot(211);
plot(x);
title("original vector x");
subplot(212);
plot(y);
title("shifted vector y");


Suggested bugfix:

circshift(x,d,isrow(x)+1).


Other solution: In line 87-92 there is a "check if input is a row vector" and
then the row vector transposed in a column vector. Maybe call circshift(x,d)
after this (and before the back transpose).

By the way: bug #47387 (signal-1.2.2) is yet not fixed in signal-1.3.2


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52758>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]