From: vilaemail on
Hi,

I don't know where to post this (since FFTW developers do not provide help
with VB, and posting on MSDN for non-VB related question is kinda dumb) so
I decided to ask you guys. :)

I really can't import FFTW library in VB.NET 9 (VS 2008). When trying to
reference to it i get this error message:

A reference to '...\libfftw3-3.dll' could not be added. Please make sure
that the file is accessible, and that it is a valid assembly or COM
component.

My guess is that file is not "a valid assembly or COM component". How to
fix this. Thanks for any help.

Sincerely,
Filip.


From: Vladimir Vassilevsky on


vilaemail wrote:

> Hi,
>
> I don't know where to post this (since FFTW developers do not provide help
> with VB, and posting on MSDN for non-VB related question is kinda dumb) so
> I decided to ask you guys. :)
>
> I really can't import FFTW library in VB.NET 9 (VS 2008). When trying to
> reference to it i get this error message:
>
> A reference to '...\libfftw3-3.dll' could not be added. Please make sure
> that the file is accessible, and that it is a valid assembly or COM
> component.
>
> My guess is that file is not "a valid assembly or COM component". How to
> fix this. Thanks for any help.

Do you really need FFTW ?
Would simple straightforward FFT work for you?


#include <math.h>


#if !defined M_PI
#define M_PI 3.14159265359
#endif


void fft(float *x,float *y,int order,int param)

{
unsigned int n,l,e,f,i,j,o,o1,j1,i1,k;
float u,v,z,c,s,p,q,r,t,w,a;


n=1u<<order;


for(l=1;l<=order;l++)
{

u=1.0;
v=0.0;
e=1u<<(order-l+1);
f=e/2;

z=M_PI/f;

c=cos(z);
s=sin(z);

if(param==FFT) s=-s;

for(j=1;j<=f;j++)
{
for(i=j;i<=n;i+=e)
{
o=i+f-1;
o1=i-1;
p=x[o1]+x[o];
r=x[o1]-x[o];
q=y[o1]+y[o];
t=y[o1]-y[o];
x[o]=r*u-t*v;
y[o]=t*u+r*v;
x[o1]=p;
y[o1]=q;
}
w=u*c-v*s;
v=v*c+u*s;
u=w;
}
}


j=1;

for(i=1;i<n;i++)
{
if(i<j)
{
j1=j-1;
i1=i-1;
p=x[j1];
q=y[j1];
x[j1]=x[i1];
y[j1]=y[i1];
x[i1]=p;
y[i1]=q;
}

k=n/2;

while(k<j)
{
j=j-k;
k=k/2;
}

j+=k;
}

if(param==FFT) return;

a=1.0/n;
for(k=0;k<n;k++)
{
x[k]*=a;
y[k]*=a;
}
return;
}
From: Cristiano on
Vladimir Vassilevsky wrote:
> e=1u<<(order-l+1);

Is that correct?

Cristiano


From: Michael Plante on
vilaemail wrote:
>I don't know where to post this (since FFTW developers do not provide
help
>with VB, and posting on MSDN for non-VB related question is kinda dumb)

No surprise there. I doubt they'd help with MSVC even, and C's at least a
sane language.


>I really can't import FFTW library in VB.NET 9 (VS 2008). When trying to
>reference to it i get this error message:
>
>A reference to '...\libfftw3-3.dll' could not be added. Please make sure
>that the file is accessible, and that it is a valid assembly or COM
>component.
>
>My guess is that file is not "a valid assembly or COM component". How to
>fix this. Thanks for any help.


Well, both. The three dots in the path probably doesn't help. I seem to
recall that being a shortcut in '95 or something, but...

Probably no easy fix. That's not even a supported language, nevermind the
compiler/OS. Search for (or write) a wrapper (bindings) of some sort. My
guess is people who care enough to use FFTW couldn't be bothered with
something like .NET, though there's all types of people...

From: vilaemail on

>
>Well, both. The three dots in the path probably doesn't help. I seem to
>recall that being a shortcut in '95 or something, but...
>
>Probably no easy fix. That's not even a supported language, nevermind
the
>compiler/OS. Search for (or write) a wrapper (bindings) of some sort.
My
>guess is people who care enough to use FFTW couldn't be bothered with
>something like .NET, though there's all types of people...
>
>

The dots were placed by me. In message box I get good absolute path.

Well then do suggest me any other language (in witch I could make all FFT
functions and create a .dll or .exe that will later be callable by vb.net).