How to derive the formula to compute an integer window number for given window width and overlap fraction (example given)

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a task of computing the window number for some time-dependent signals with overlapping. I have broken down the task to a purely mathematical (arithmetic/algebra) problem and provide an illustrative example here to aid thinking.



We are given a fixed window length $l_textw$ in seconds, and an overlap fraction $x$. The windows span t_start to t_finish (t_start is inclusive and t_finish is exclusive), i.e. the interval is $[t_textstart, t_textfinish)$. The question is, given a time $t_k$, what is the general mathematical formula that computes the earliest window $N_k in mathbbN$ that includes $t_k$? The formula takes two parameters $l_textw$ and $x$.



If that was too abstract, here is a simple example. Consider $l_textw = 0.4 s$. That is the first window $N_1$ spans $[0,0.4)$. The overlap factor is given to be $x=0.4$ which implies an overlap duration of $xcdot l_textw = 0.16 s$.
This means that the next window $N_2$ spans $[0.16,0.56)$ and so on ad infinitum.



The table below can then be visualised (and has no ending point). Now, given any time-point $t_k$, what is the most general formula that predicts the window $N_k$ in which it belongs? eg. if $t_k = 1.40$, the formula should predict $N_k$ = 7. if $t_k = 0.96$ it should predict $N_k=5$ and so on.



| t_start | t_finish | N(window no) |
|:-----------|------------:|:------------:|
| 0 | 0.40 | 1 |
| 0.16 | 0.56 | 2 |
| 0.40 | 0.80 | 3 |
| 0.56 | 0.96 | 4 |
| 0.80 | 1.20 | 5 |
| 0.96 | 1.36 | 6 |
| 1.20 | 1.60 | 7 |
| 1.36 | 1.76 | 8 |
| 1.60 | 2.00 | 9 |
| 1.76 | 2.16 | 10 |
| 2.00 | 2.40 | 11 |






share|cite|improve this question























    up vote
    0
    down vote

    favorite












    I have a task of computing the window number for some time-dependent signals with overlapping. I have broken down the task to a purely mathematical (arithmetic/algebra) problem and provide an illustrative example here to aid thinking.



    We are given a fixed window length $l_textw$ in seconds, and an overlap fraction $x$. The windows span t_start to t_finish (t_start is inclusive and t_finish is exclusive), i.e. the interval is $[t_textstart, t_textfinish)$. The question is, given a time $t_k$, what is the general mathematical formula that computes the earliest window $N_k in mathbbN$ that includes $t_k$? The formula takes two parameters $l_textw$ and $x$.



    If that was too abstract, here is a simple example. Consider $l_textw = 0.4 s$. That is the first window $N_1$ spans $[0,0.4)$. The overlap factor is given to be $x=0.4$ which implies an overlap duration of $xcdot l_textw = 0.16 s$.
    This means that the next window $N_2$ spans $[0.16,0.56)$ and so on ad infinitum.



    The table below can then be visualised (and has no ending point). Now, given any time-point $t_k$, what is the most general formula that predicts the window $N_k$ in which it belongs? eg. if $t_k = 1.40$, the formula should predict $N_k$ = 7. if $t_k = 0.96$ it should predict $N_k=5$ and so on.



    | t_start | t_finish | N(window no) |
    |:-----------|------------:|:------------:|
    | 0 | 0.40 | 1 |
    | 0.16 | 0.56 | 2 |
    | 0.40 | 0.80 | 3 |
    | 0.56 | 0.96 | 4 |
    | 0.80 | 1.20 | 5 |
    | 0.96 | 1.36 | 6 |
    | 1.20 | 1.60 | 7 |
    | 1.36 | 1.76 | 8 |
    | 1.60 | 2.00 | 9 |
    | 1.76 | 2.16 | 10 |
    | 2.00 | 2.40 | 11 |






    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a task of computing the window number for some time-dependent signals with overlapping. I have broken down the task to a purely mathematical (arithmetic/algebra) problem and provide an illustrative example here to aid thinking.



      We are given a fixed window length $l_textw$ in seconds, and an overlap fraction $x$. The windows span t_start to t_finish (t_start is inclusive and t_finish is exclusive), i.e. the interval is $[t_textstart, t_textfinish)$. The question is, given a time $t_k$, what is the general mathematical formula that computes the earliest window $N_k in mathbbN$ that includes $t_k$? The formula takes two parameters $l_textw$ and $x$.



      If that was too abstract, here is a simple example. Consider $l_textw = 0.4 s$. That is the first window $N_1$ spans $[0,0.4)$. The overlap factor is given to be $x=0.4$ which implies an overlap duration of $xcdot l_textw = 0.16 s$.
      This means that the next window $N_2$ spans $[0.16,0.56)$ and so on ad infinitum.



      The table below can then be visualised (and has no ending point). Now, given any time-point $t_k$, what is the most general formula that predicts the window $N_k$ in which it belongs? eg. if $t_k = 1.40$, the formula should predict $N_k$ = 7. if $t_k = 0.96$ it should predict $N_k=5$ and so on.



      | t_start | t_finish | N(window no) |
      |:-----------|------------:|:------------:|
      | 0 | 0.40 | 1 |
      | 0.16 | 0.56 | 2 |
      | 0.40 | 0.80 | 3 |
      | 0.56 | 0.96 | 4 |
      | 0.80 | 1.20 | 5 |
      | 0.96 | 1.36 | 6 |
      | 1.20 | 1.60 | 7 |
      | 1.36 | 1.76 | 8 |
      | 1.60 | 2.00 | 9 |
      | 1.76 | 2.16 | 10 |
      | 2.00 | 2.40 | 11 |






      share|cite|improve this question











      I have a task of computing the window number for some time-dependent signals with overlapping. I have broken down the task to a purely mathematical (arithmetic/algebra) problem and provide an illustrative example here to aid thinking.



      We are given a fixed window length $l_textw$ in seconds, and an overlap fraction $x$. The windows span t_start to t_finish (t_start is inclusive and t_finish is exclusive), i.e. the interval is $[t_textstart, t_textfinish)$. The question is, given a time $t_k$, what is the general mathematical formula that computes the earliest window $N_k in mathbbN$ that includes $t_k$? The formula takes two parameters $l_textw$ and $x$.



      If that was too abstract, here is a simple example. Consider $l_textw = 0.4 s$. That is the first window $N_1$ spans $[0,0.4)$. The overlap factor is given to be $x=0.4$ which implies an overlap duration of $xcdot l_textw = 0.16 s$.
      This means that the next window $N_2$ spans $[0.16,0.56)$ and so on ad infinitum.



      The table below can then be visualised (and has no ending point). Now, given any time-point $t_k$, what is the most general formula that predicts the window $N_k$ in which it belongs? eg. if $t_k = 1.40$, the formula should predict $N_k$ = 7. if $t_k = 0.96$ it should predict $N_k=5$ and so on.



      | t_start | t_finish | N(window no) |
      |:-----------|------------:|:------------:|
      | 0 | 0.40 | 1 |
      | 0.16 | 0.56 | 2 |
      | 0.40 | 0.80 | 3 |
      | 0.56 | 0.96 | 4 |
      | 0.80 | 1.20 | 5 |
      | 0.96 | 1.36 | 6 |
      | 1.20 | 1.60 | 7 |
      | 1.36 | 1.76 | 8 |
      | 1.60 | 2.00 | 9 |
      | 1.76 | 2.16 | 10 |
      | 2.00 | 2.40 | 11 |








      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Jul 18 at 21:54









      Krishna

      1438




      1438




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Start by considering only the odd numbered windows. Every time is in one of these and time $t$ is in window $n=2lfloor frac t0.4 rfloor+1$. Now compute how far you are into the window as $Delta t=t-0.4n$. If $Delta t lt 0.16$ you are in the previous window as well, so subtract $1$.



          For the general case, $n=2lfloor frac tl_w rfloor+1, Delta t=t-l_wn$. If $Delta t lt xl_w$ you are in the previous window as well, so subtract $1$.






          share|cite|improve this answer























          • That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
            – Krishna
            Jul 18 at 22:09










          • You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
            – Ross Millikan
            Jul 18 at 22:49











          • My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
            – Krishna
            Jul 18 at 22:56










          • I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
            – Ross Millikan
            Jul 18 at 22:59











          • I think my post was wrong. Sorry for wasting your time. I shall revise it soon
            – Krishna
            Jul 18 at 23:03










          Your Answer




          StackExchange.ifUsing("editor", function ()
          return StackExchange.using("mathjaxEditing", function ()
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          );
          );
          , "mathjax-editing");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "69"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2856050%2fhow-to-derive-the-formula-to-compute-an-integer-window-number-for-given-window-w%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Start by considering only the odd numbered windows. Every time is in one of these and time $t$ is in window $n=2lfloor frac t0.4 rfloor+1$. Now compute how far you are into the window as $Delta t=t-0.4n$. If $Delta t lt 0.16$ you are in the previous window as well, so subtract $1$.



          For the general case, $n=2lfloor frac tl_w rfloor+1, Delta t=t-l_wn$. If $Delta t lt xl_w$ you are in the previous window as well, so subtract $1$.






          share|cite|improve this answer























          • That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
            – Krishna
            Jul 18 at 22:09










          • You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
            – Ross Millikan
            Jul 18 at 22:49











          • My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
            – Krishna
            Jul 18 at 22:56










          • I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
            – Ross Millikan
            Jul 18 at 22:59











          • I think my post was wrong. Sorry for wasting your time. I shall revise it soon
            – Krishna
            Jul 18 at 23:03














          up vote
          0
          down vote













          Start by considering only the odd numbered windows. Every time is in one of these and time $t$ is in window $n=2lfloor frac t0.4 rfloor+1$. Now compute how far you are into the window as $Delta t=t-0.4n$. If $Delta t lt 0.16$ you are in the previous window as well, so subtract $1$.



          For the general case, $n=2lfloor frac tl_w rfloor+1, Delta t=t-l_wn$. If $Delta t lt xl_w$ you are in the previous window as well, so subtract $1$.






          share|cite|improve this answer























          • That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
            – Krishna
            Jul 18 at 22:09










          • You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
            – Ross Millikan
            Jul 18 at 22:49











          • My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
            – Krishna
            Jul 18 at 22:56










          • I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
            – Ross Millikan
            Jul 18 at 22:59











          • I think my post was wrong. Sorry for wasting your time. I shall revise it soon
            – Krishna
            Jul 18 at 23:03












          up vote
          0
          down vote










          up vote
          0
          down vote









          Start by considering only the odd numbered windows. Every time is in one of these and time $t$ is in window $n=2lfloor frac t0.4 rfloor+1$. Now compute how far you are into the window as $Delta t=t-0.4n$. If $Delta t lt 0.16$ you are in the previous window as well, so subtract $1$.



          For the general case, $n=2lfloor frac tl_w rfloor+1, Delta t=t-l_wn$. If $Delta t lt xl_w$ you are in the previous window as well, so subtract $1$.






          share|cite|improve this answer















          Start by considering only the odd numbered windows. Every time is in one of these and time $t$ is in window $n=2lfloor frac t0.4 rfloor+1$. Now compute how far you are into the window as $Delta t=t-0.4n$. If $Delta t lt 0.16$ you are in the previous window as well, so subtract $1$.



          For the general case, $n=2lfloor frac tl_w rfloor+1, Delta t=t-l_wn$. If $Delta t lt xl_w$ you are in the previous window as well, so subtract $1$.







          share|cite|improve this answer















          share|cite|improve this answer



          share|cite|improve this answer








          edited Jul 18 at 22:53


























          answered Jul 18 at 22:04









          Ross Millikan

          276k21186352




          276k21186352











          • That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
            – Krishna
            Jul 18 at 22:09










          • You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
            – Ross Millikan
            Jul 18 at 22:49











          • My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
            – Krishna
            Jul 18 at 22:56










          • I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
            – Ross Millikan
            Jul 18 at 22:59











          • I think my post was wrong. Sorry for wasting your time. I shall revise it soon
            – Krishna
            Jul 18 at 23:03
















          • That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
            – Krishna
            Jul 18 at 22:09










          • You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
            – Ross Millikan
            Jul 18 at 22:49











          • My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
            – Krishna
            Jul 18 at 22:56










          • I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
            – Ross Millikan
            Jul 18 at 22:59











          • I think my post was wrong. Sorry for wasting your time. I shall revise it soon
            – Krishna
            Jul 18 at 23:03















          That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
          – Krishna
          Jul 18 at 22:09




          That formula is not general. In particular, it works only for this table. If you change $t_textw$ or $x$, it won't work. I am looking for a general formula. The table was just an example of one case
          – Krishna
          Jul 18 at 22:09












          You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
          – Ross Millikan
          Jul 18 at 22:49





          You can change $0.4$ to $l_w$ and $0.16$ to $xl_w$ and it works fine. It does depend on the structure of the overlap that you have defined, that every other window starts at a multiple of $l_w$. I have put that in
          – Ross Millikan
          Jul 18 at 22:49













          My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
          – Krishna
          Jul 18 at 22:56




          My point is that I already tried your formula before posting here. For a completely different case, say $l_w = 0.72$ and $x=0.35$, will it work? I think my table is not generic enough. I shall change it tomorrow.
          – Krishna
          Jul 18 at 22:56












          I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
          – Ross Millikan
          Jul 18 at 22:59





          I believe it will. Do you have an example that says otherwise? Maybe I have not understood correctly how the overlap works. Would the start times then be $0,0.252,0.72,0.972,1.44,1.692,2.16$?
          – Ross Millikan
          Jul 18 at 22:59













          I think my post was wrong. Sorry for wasting your time. I shall revise it soon
          – Krishna
          Jul 18 at 23:03




          I think my post was wrong. Sorry for wasting your time. I shall revise it soon
          – Krishna
          Jul 18 at 23:03












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2856050%2fhow-to-derive-the-formula-to-compute-an-integer-window-number-for-given-window-w%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?