RTXI 1.3
plugins/include/DSP/rectnglr.cpp
Go to the documentation of this file.
00001 /*
00002  * Rectangular window
00003  */
00004 
00005 #include <math.h>
00006 #include "rectnglr.h"
00007 #include "misdefs.h"
00008 #include <gsl/gsl_math.h>
00009 
00010 RectangularWindow::RectangularWindow(int length) {
00011         Initialize(length);
00012         GenerateWindow(length);
00013         return;
00014 }
00015 
00016 void RectangularWindow::GenerateWindow(int length) {
00017         if (length % 2) // odd length window centered at zero
00018         {
00019                 for (int n = 0; n < Half_Length; n++) {
00020                         Half_Lag_Win[n] = 1.0;
00021                 }
00022         } else // even length window centered at -1/2
00023         {
00024                 for (int n = 0; n < Half_Length; n++) {
00025                         Half_Lag_Win[n] = 1.0;
00026                 }
00027         }
00028         return;
00029 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines