This project has moved and is read-only. For the latest updates, please go here.

BlackmannHarrisWindow Function has an error

Nov 28, 2012 at 10:26 PM

The BlackmannHarrisWindow Function in the FastFourierTransform class appears to have an error.

I know this function is not currently used but as I like to think NAudio is accurate I thought it worth mentioning.  The error is in the final term of the BlackmannHarris windowing function.  According to wikipedia, and confirmed elsewhere, the fourth term should have a 6 rather than a 4. 

The fourth term should be

(0.01168 *

Math.Cos((6 * Math.PI * n) / (frameSize - 1)));

rather than

(0.01168 *

Math.Cos((4 * Math.PI * n) / (frameSize - 1)));

Nov 28, 2012 at 10:40 PM

Yes, you're right. I've made the change. Please review and check it is OK now:



Nov 30, 2012 at 3:58 AM

Thanks Mark,

That was quick of you.  The window function code now looks correct.

Best wishes

John C