aboutsummaryrefslogtreecommitdiffstats
path: root/Project/RTDSP/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'Project/RTDSP/frame.c')
-rw-r--r--Project/RTDSP/frame.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Project/RTDSP/frame.c b/Project/RTDSP/frame.c
index 1db240e..0f506e0 100644
--- a/Project/RTDSP/frame.c
+++ b/Project/RTDSP/frame.c
@@ -78,7 +78,7 @@ float *input;
float *intermediate;
float *output;
volatile int index = 0;
-float* mag;
+float mag[BUFLEN];
complex C[BUFLEN];
@@ -197,14 +197,17 @@ void wait_buffer(void)
/************************* DO PROCESSING OF FRAME HERE **************************/
// Copy data elements to complex
- for (i = 0; i < BUFLEN; ++i)
+ for (i = 0; i < BUFLEN; ++i) {
+ C[i].i = 0;
C[i].r = intermediate[i];
+ }
fft(BUFLEN, C);
// Calculate the magnitude of the complex numbers
- for (i = 0; i < BUFLEN; ++i)
+ for (i = 0; i < BUFLEN; ++i) {
mag[i] = cabs(C[i]);
+ }