does anyone understand how to use the pocketfft by martin reinecke?
Link: https://gitlab.mpcdf.mpg.de/mtr/pocketfft
Basically it's just this snipped of code:
rfft_forward(rfft_plan plan, double c[], double fct);
I understood,
that the plan needs to be created to the "internal" planning of the algorithm,
the array c[] is input data and will be overwritten with output data, but what stands the double
fct
for?
I recorded some data with my embededd system (STM32f446RE with a sensor) and did a reference fft in python ( that one works ) which differs alot from the pocketfft and I dont understand why
Is my code maybe wrong somehow?
double resultD[SIZE];
for (i=0; i < SIZE; i++){
resultD[i] = (double)result[i][1];
}
rfft_plan plan = make_rfft_plan(SIZE);
rfft_forward(plan, resultD, 1.);
destroy_rfft_plan(plan);
n = sprintf( buffer, "%s\n", "X" );
HAL_UART_Transmit(&huart2, buffer, n, 1000);
for(i = 0; i < SIZE; i++) {
n = sprintf( buffer, "%f\n", resultD[i] );
HAL_UART_Transmit(&huart2, buffer, n, 1000);
}
In blue u can see the reference fft with python, in red the fft from the µC and the code above.
It differs in amplitude and it's shifted.
Therefor I think it's not about just a scaling factor
rfft_plan plan = make_rfft_plan(SIZE);
torfft_plan plan = make_rfft_plan(2*SIZE);
and see if they better align. $\endgroup$rfft_plan plan = make_rfft_plan(2*SIZE);
did not help here. Is it maybe possible that two different ffts deliver such different results? $\endgroup$