I am currently running into a larger problem whilst programming an audio processing software. My target is time-shifting signals in frequency domain, then transform them back to time domain and merging 2 streams into an output.
I'm windowing the incoming signal(s) to extract frames of 32 samples with an offset of 16 samples.
Hence, assuming 64 input (and output) samples, a total of 4 overlapping frames is created:
Frame 1 =$[-16...-1,0...15]$,
Frame 2 = $[0...31]$,
Frame 3 = $[16...47]$,
Frame 4 = $[32...63]$.
Here $[-16...-1]$ are samples from a previous iteration (or zeroed out in the beginning) and the last 16 samples $[48...63]$ are stored for the next iteration.
Assume $x[n]$ is the input signal in the first frame, and it is timeshifted and added to output such that $x[n+2]=y[m]$. For that im adding leading and trailing zeros before shifting. However, it would shift the signal out of the scope of the output buffer. Same for frame 4 and timeshifts like $[n-2]$, where it shifts out of the buffer (into the next iteration).
How can I handle such shifting, considering i have fixed shift values, e.g. 6 samples?