Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Copy negative frequency components to end of buffer and zero out middle
- // inp - input buffer of complex floats
- // n - transform size
- // interp - interpolation amount
- void zero_pad_freq(cfloat_t *inp, size_t n, size_t interp) {
- memmove(inp + n*interp - n/2, inp + (n+1)/2, (n+1)/2*sizeof(cfloat_t));
- memset (inp + n/2 + 1, 0, (n*(interp-1)-1)*sizeof(cfloat_t));
- if (n % 2 == 0) {
- inp[n/2] /= 2.0;
- inp[n*interp-n/2] = conj(inp[n/2])/2.0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement