* @param Nc The number of coefficients of the corresponding FIR filter.
* @return double[] containing the coefficients of the FIR filter.
*/
static double[] calculateCoefficients( DesignGrid G, int Nc ) {
LagrangePolynomial LP = constructInterpolatingPolynomial( G, computeDelta( G ) );
int log2nfft = 6;
int nfft = 64;
while ( nfft < Nc ) {
nfft *= 2;
log2nfft++;
}
double[] X = new double[ nfft ];
double[] x = new double[ nfft ];
for ( int i = 0; i <= nfft/2; i++ ) {
X[i] = (double) LP.evaluate( Math.cos( 2.0*Math.PI*i/nfft ) );
}
RDFT dft = new RDFT( log2nfft );
dft.evaluateInverse( X, x );