Here's my
modified source and x64 dll that should be compilable on linux if you have a float fftw3 lying around. I didn't test it though. Report your findings and so on. Just done as a 30 min code stabbing session while eating dinner.
Changes:
Removes the loadlibrary loading of fftw3 and instead uses the official fftw3.h
Replaced all homegrown pi constants with the more accurate M_PI
Removed all unused variables where it was obvious no use was ever intended
Fixed an extreme number of type conversion warnings, some of them by making sure all calculations stay in float precision
And can someone check this piece of code?
Code:
void pointNotchFilter2D( float * freqFilter, int* spec, int ht, int wd)
{
// point centered notch filter
float xf = spec[2] * wd / (NYQUIST);
float yf = spec[3] * ht / (NYQUIST );
int degree = 2 * spec[4];
// calculate notch radial sqr
float d0sq = sqrt (xf*xf + yf*yf);
d0sq = (ht * ht + wd * wd)/ 4;
It looks very suspect. Like it should be multiplied or divided or something instead of the first value assigned to d0sq just being discarded.