I have a list of an evenly sampled signal. For the sake of discussion, assume that the array can be obtained by the following python code
fs =2
np.arange(start=0, stop=360, step=fs)
In my perspective, the above code would correspond to a 90-second long signal. I would like to analyze small chunks of the last 10 seconds of the signal as follow:
1. Iteration #1: array from the beginning to the end
2. Iteration #2: array from the beginning to the (end -1 second)
3. Iteration #3: array from the beginning to the (end -2 seconds)
4. Iteration #4: array from the beginning to the (end -3 seconds)
5. Iteration #4: array from the beginning to the (end -3 seconds)
etc....
5. Iteration #10: array from the beginning to the (end -10 second)
There are some convoluted ways I could maybe achieve this by using for loops and counters but I feel like this is overkill as I suspect this could be achieved by some simple array indexing methods as suggested by this StackOverflow question. Can someone point me in the right direction to get this done with an elegant code?