Find file
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (22 sloc) 916 Bytes
This is a bit of a demo app in that this will take the FFT of a file that contains a column vector of
elements. This function does not care how many elements are in the input file.
#include <stdio.h>
#include <stdlib.h>
#include "xsfft.h"
int main(int argc, char *argv[])
unsigned long dataLength = 100;
int *rawData = (int *)calloc(dataLength, sizeof(int));
for (unsigned long signalIndex = 0; signalIndex < dataLength; ++signalIndex, *(rawData + signalIndex) = signalIndex);
xsComplex *data = xsAllocArrayInt(rawData, dataLength);
data = xsInterpolateWithFactor2(data, &dataLength);
for(unsigned long dataIndex = 0; dataIndex < dataLength; ++dataIndex) {
printf("%f\n", (data + dataIndex)->real);
return 0;