File: overlapadd.c

package info (click to toggle)
pd-lyonpotpourri 2.0%2Bgit20121009-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 2,920 kB
  • ctags: 1,880
  • sloc: ansic: 18,330; makefile: 364
file content (21 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * input I is a folded spectrum of length N; output O and
 * synthesis window W are of length Nw--overlap-add windowed,
 * unrotated, unfolded input data into output O
 */

#include "fftease.h"

void overlapadd( float *I, int N, float *W, float *O, int Nw, int n )

{
 int i ;
    while ( n < 0 )
	n += N ;
    n %= N ;
    for ( i = 0 ; i < Nw ; i++ ) {
	O[i] += I[n]*W[i] ;
	if ( ++n == N )
	    n = 0 ;
    }
}