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

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

[Octave-bug-tracker] [bug #60116] Off-by-one error in output of specgram


From: anonymous
Subject: [Octave-bug-tracker] [bug #60116] Off-by-one error in output of specgram for certain parameter combinations
Date: Thu, 25 Feb 2021 11:36:55 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0

URL:
  <https://savannah.gnu.org/bugs/?60116>

                 Summary: Off-by-one error in output of specgram for certain
parameter combinations
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Thu 25 Feb 2021 04:36:54 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any

    _______________________________________________________

Details:

The specgram function contains this line:
https://sourceforge.net/p/octave/signal/ci/default/tree/inst/specgram.m#l157


offset = [ 1 : step : length(x)-win_size ];


The formula I expect would be:


offset = [ 1 : step : length(x)-win_size+1 ];


Take for example length(x) = 3, win_size = 1, step = 1. You would expect
offset = [ 1, 2, 3 ] but above formula returns [ 1, 2 ]. The number of frames
in the output is off-by-one iff length(x)-win_size is a multiple of step.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60116>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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