On 05/16/2019 11:52 PM, Koyel Das (Vehere) via USRP-users wrote:
Hi,
Following is a snapshot of my code using fftw_plan_dft_2d. I am
getting all zeros in the imaginary part of fft (in the printf command
of the following code:last line). The real part is correct.Could you
please tell where am I going wrong?
fftw_complex *imageOutputPlane=VDDSAlgorithm::imageOutPlane;
fftw_complex *imageInputPlane=VDDSAlgorithm::imageInputPlane;
unsigned char*imageData=VDDSAlgorithm::imageData;
unsigned char*imageDataFinal=VDDSAlgorithm::imageDataFinal;
memset(imageInputPlane,0x0,IMAGE_DIMENSION*IMAGE_DIMENSION*sizeof(fftw_complex));
memset(imageOutputPlane,0x0,IMAGE_DIMENSION*IMAGE_DIMENSION*sizeof(fftw_complex));
memset(imageData,0x0,IMAGE_DIMENSION*IMAGE_DIMENSION);
for(size_t count=0;count<TOTAL_BASE_LINE;count++){
imageInputPlane[(int)round(IMAGE_DIMENSION/2+diffX[count])*IMAGE_DIMENSION+(int)round(IMAGE_DIMENSION/2-diffY[count])][0]=phy[count][0];
imageInputPlane[(int)round(IMAGE_DIMENSION/2+diffX[count])*IMAGE_DIMENSION+(int)round(IMAGE_DIMENSION/2-diffY[count])][1]=-(phy[count][1]);
imageInputPlane[(int)round(IMAGE_DIMENSION/2-diffX[count])*IMAGE_DIMENSION+(int)round(IMAGE_DIMENSION/2+diffY[count])][0]=phy[count][0];
imageInputPlane[(int)round(IMAGE_DIMENSION/2-diffX[count])*IMAGE_DIMENSION+(int)round(IMAGE_DIMENSION/2+diffY[count])][1]=phy[count][1];
}
fftLock.lock();
fftw_plan
planeX=fftw_plan_dft_2d(IMAGE_DIMENSION,IMAGE_DIMENSION,
imageInputPlane, imageOutputPlane, FFTW_FORWARD, FFTW_ESTIMATE);
fftw_execute(planeX);
fftw_destroy_plan(planeX);
fftLock.unlock();
double max=0;
for(size_t row=0;row<IMAGE_DIMENSION;row++){
for(size_t col=0;col<IMAGE_DIMENSION;col++){
if(col==0)printf("\n");
if(col<100){
printf("(%lf,%lf)",imageOutputPlane[row*IMAGE_DIMENSION+col][0],imageOutputPlane[row*IMAGE_DIMENSION+col][1]);
}
}
}
Regards,
Koyel Das
Senior – Product Engineer
Vehere | Proactive Communications Intelligence & Cyber Defence
M: +919051132173 | T: +91 33 40545454 | F: +91 33 40545455 | W:
www.vehere.com <http://www.vehere.com/>//
I'm having a hard time seeing how this is related to UHD and USRPs.
There's probably a support forum for FFTW out there that would be more
helpful than here.
_______________________________________________
USRP-users mailing list
USRP-users@lists.ettus.com
http://lists.ettus.com/mailman/listinfo/usrp-users_lists.ettus.com