Matlab coder C conversion of an fft
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tommy Owens
le 12 Juin 2017
Commenté : Tommy Owens
le 12 Juin 2017
Can someone give me an example of what an fft should look like within a coder converted c code snippet? I am aware that the documentation says that fft is coder compatible, but I have not yet obtained successful results. What I end up receiving from coder is simply a copy of the input data. any help would be welcome. An example of what I have been testing is below.
function anFFT= fft_soundfile(input)
anFFT = input;
%do fft
X = abs(fft(input,1024));
%fft end
holder = X(1);
%data = abs(y)
end
What I am getting is as follows
/*
* Academic License - for use in teaching, academic research, and meeting
* course requirements at degree granting institutions only. Not for
* government, commercial, or other organizational use.
*
* anFFT.c
*
* Code generation for function 'anFFT'
*
*/
/* Include files */
#include "rt_nonfinite.h"
#include "anFFT.h"
/* Function Definitions */
void anFFT(const double input[27387], double b_anFFT[27387])
{
memcpy(&b_anFFT[0], &input[0], 27387U * sizeof(double));
/* do fft */
/* fft end */
/* data = abs(y) */
}
/* End of code generation (anFFT.c) */
This doesn't seem to be generating an fft. Can anyone help with this?
0 commentaires
Réponse acceptée
Walter Roberson
le 12 Juin 2017
You have
function anFFT= fft_soundfile(input)
anFFT = input;
so your output is a copy of your input. Nothing you do later in your code affects the output. Everything after that point is optimized away.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur MATLAB Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!