SHARE
TWEET

Untitled

a guest Dec 2nd, 2012 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Copy negative frequency components to end of buffer and zero out middle
  2. //  inp    - input buffer of complex floats
  3. //    n    - transform size
  4. //  interp - interpolation amount
  5. void zero_pad_freq(cfloat_t *inp, size_t n, size_t interp) {
  6.     memmove(inp + n*interp - n/2, inp + (n+1)/2, (n+1)/2*sizeof(cfloat_t));
  7.     memset (inp + n/2 + 1, 0,           (n*(interp-1)-1)*sizeof(cfloat_t));
  8.    
  9.     if (n % 2 == 0) {
  10.         inp[n/2]          /= 2.0;
  11.         inp[n*interp-n/2]  = conj(inp[n/2])/2.0;
  12.     }
  13. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top