status = vmov((TMS_FLOAT *)signal, (TMS_FLOAT *)cu, fft_size * 2); if (status < 0)
sam_error(status);
/* |
|
|
* Perform the CFFT |
|
|
*/ |
|
|
printf("Performing CFFT\n"); |
|
|
status = cfft(cu, | /* input buffer | */ |
NULL, | /* Twids not needed by | */ |
cy, | /* output/scratch buffer | */ |
1, | /* repeat value - 1 this time | */ |
1.0, | /* forward FFT scaled by 1.0 | */ |
fft_size); | /* one million complex points */ | |
if (status < 0) |
|
|
sam_error(status); |
|
|
/*
*Move the FFT results back to host memory
*(returned status indicates which buffer holds the final results)
*/
if (status == 1)
status = vmov((TMS_FLOAT *)cu, (TMS_FLOAT *)results, fft_size * 2); else
status = vmov((TMS_FLOAT *)cy, (TMS_FLOAT *)results, fft_size * 2); if (status < 0)
sam_error(status);
/*
*Synchronize with the
*/
printf("Wait for all
if (status < 0) sam_error(status);
/*
*Print values
*/
printf ("First 10 values of CFFT results:\n"); for (ii=0; ii<10; ii++)
printf ("%02d: [%8.4f, %8.4f]\n",
ii, results[ii].real, results[ii].imag);
/*
*Check result vector
*/
ecount = 0;
printf ("Checking result vector..\n"); for (ii=0; ii<fft_size; ii++)
{
if ((results[ii].real != real_val) (results[ii].imag != imag_val))
{
if (ecount < 5)
{
printf ("Error in element | %d", ii); |
| |
printf (" | ShB: [%8.4f, | %8.4f] ", real_val, imag_val); |
|
printf ("Is: [%8.4f, %8.4f]\n", |
| ||
| results[ii].real, |
| |
|
|
| |
Texas Memory Systems, Inc. (8/6/01) |