}
// dft on index 2 of 'index 1 transformed data'
for(x=0;x<X;x++) {
- off_f=0;
+ off_f=x;
for(v=0;v<Y;v++) {
//dprintf(fourier->outfd,"[fourier] (u=%d,v=%d)\n",v,x);
- off_r=0;
+ off_r=x;
for(y=0;y<Y;y++) {
arg=-2.0*M_PI*v*y/Y;
- fourier->ftdata[off_f+x].r+=(cos(arg)*data[off_r+x].r-sin(arg)*data[off_r+x].i);
- fourier->ftdata[off_f+x].r+=(sin(arg)*data[off_r+x].r+cos(arg)*data[off_r+x].i);
+ fourier->ftdata[off_f].r+=(cos(arg)*data[off_r].r-sin(arg)*data[off_r].i);
+ fourier->ftdata[off_f].r+=(sin(arg)*data[off_r].r+cos(arg)*data[off_r].i);
off_r+=X;
}
- fourier->ftdata[off_f+x].r/=Y;
- fourier->ftdata[off_f+x].i/=Y;
+ fourier->ftdata[off_f].r/=Y;
+ fourier->ftdata[off_f].i/=Y;
off_f+=X;
}
}
-
+
free(data);
return F_SUCCESS;