Help with library implementation
Aug 8, 2011 at 1:04pm UTC
Hi all,
I'm attempting to write a program that will compute the FFTs of a data set 32 point accross the band froma user-specified file and will output the results to another file. I downlaoded the FFTW library, I am just having trouble figuring out how ot use it/implement it in my program. This is what I have so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char filename[101];
ifstream existtest, infile;
ofstream opentest, outfile;
cout << "Copyright: 3 Aug 2011 Karla Guardado\n\n" ;
cout << "Program takes data from user-specified file and computes FFTs\n" ;
cout << "(Fast Fourier Transforms) on data. Outputs FFTs to FFTdata.xls.\n" ;
cout << endl;
cout << "Enter file name. (Type name, extension included, then press <ENTER>.)" ;
cout << endl << endl << "File name: " ;
cin >> filename;
existtest.open(filename);
if (existtest.fail()) {
existtest.close();
cout << "ERROR: File does not exsist. Exiting.\n" << endl;
system ("pause" );
return 0;
}
existtest.close();
opentest.open(filename);
if (opentest.fail()) {
opentest.close();
cout << "ERROR: File failed to open. Exiting." ;
system ("pause" );
return 0;
}
//read, take FFTs on data, output to outfile
outfile.open("FFTdata.xls" );
system ("pause" );
return 0;
}
Any help would be greatly appreciated!
Thanks!
Last edited on Aug 8, 2011 at 2:42pm UTC
Topic archived. No new replies allowed.