----------------------------------------------------------------------------- name: blackman() desc: make window -----------------------------------------------------------------------------
| 62 | // desc: make window |
| 63 | //----------------------------------------------------------------------------- |
| 64 | void blackman(float * window, unsigned long length) |
| 65 | { |
| 66 | unsigned long i; |
| 67 | double pi, phase = 0, delta; |
| 68 | |
| 69 | pi = 4.*atan(1.0); |
| 70 | delta = 2 * pi / (double)length; |
| 71 | |
| 72 | for (i = 0; i < length; i++) |
| 73 | { |
| 74 | window[i] = (float)(0.42 - .5*cos(phase) + .08*cos(2 * phase)); |
| 75 | phase += delta; |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | |
| 80 |