diff options
author | ymherklotz <ymherklotz@gmail.com> | 2018-03-05 12:54:29 +0000 |
---|---|---|
committer | ymherklotz <ymherklotz@gmail.com> | 2018-03-05 12:54:29 +0000 |
commit | fb6696ea0232887f63a943b11e0f16b811b241b9 (patch) | |
tree | ad0d3809e21060c6463e6c36a7a3ce31a0a53290 /Project/RTDSP/frame.c | |
parent | fcaf88ac27152cf3c553fb5976ce2aed3b64f6f2 (diff) | |
download | NoiseSilencer-fb6696ea0232887f63a943b11e0f16b811b241b9.tar.gz NoiseSilencer-fb6696ea0232887f63a943b11e0f16b811b241b9.zip |
Ex2 working
Diffstat (limited to 'Project/RTDSP/frame.c')
-rw-r--r-- | Project/RTDSP/frame.c | 9 |
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]); + } |