array manipulation (shifting data)
Hi All
I have to process a double array of 4096 elements. When processing is done, I need to shift the data by 512 samples
Code:
double *window = malloc(4096 * sizeof(*window)) ;
.....
for(j = 0; j < 4096 - 512; j++) {
window[j] = window[j + 512] ;
}
after this process, I add 512 new values add the end of the array. This process is repeated a million times, so performance is very important.
So my question is, does C has a library that can do certain array manipulation (like shifting)
If not, what would be the fastest way to do this? I can imaging that there might be certain pointer tricks to speedup this process!
Any help would be appreciated!
thnx
LuCa