Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of fft_test_k22f by
Diff: main.cpp
- Revision:
- 1:6b7e5eae3a55
- Parent:
- 0:015ecf1bac06
- Child:
- 2:b25d473135e8
--- a/main.cpp Fri Sep 30 14:51:31 2016 +0000
+++ b/main.cpp Fri Sep 30 16:05:16 2016 +0000
@@ -12,7 +12,7 @@
DigitalOut led_g(PTA2);
DigitalOut led_b(PTD5);
-const int FFT_LEN = 64;
+const int FFT_LEN = 1024;
const int bins = 32;
@@ -31,7 +31,10 @@
int32_t i = 0;
-
+ printf("\r\n\r\nFFT test program!\r\n");
+ printf("by Curtis Mattull\r\n\r\n\r\n");
+
+
// Init arm_ccft_32
switch (FFT_LEN)
{
@@ -68,23 +71,34 @@
for(i = 0; i< FFT_LEN*2; i+=2)
{
//fast math sine table[512+1]
- samples[i] = sinTable_f32[i*4];
+ samples[i] = sinTable_f32[i/4];
samples[i+1] = 0;
}
+ /*multiply the dummy data with more dummy data*/
+// for(i = 0; i< FFT_LEN*2; i+=2)
+// {
+// //fast math sine table[512+1]
+// samples[i] +=sinTable_f32[i/2] ;
+// samples[i+1] = 0;
+// }
+
// Run FFT on sample data.
arm_cfft_f32(S, samples, 0, 1);
// Calculate magnitude of complex numbers output by the FFT.
arm_cmplx_mag_f32(samples, magnitudes, FFT_LEN);
- for(i = 0; i< FFT_LEN; i++)
+ printf("\r\nThe first 20 bins:\r\n");
+
+ for(i = 0; i< 20; i++)
{
- printf("magnitudes[%f]: %f\r\n",i,magnitudes[i]);
+ printf("magnitudes[%i]: %f\r\n",i,magnitudes[i]);
}
-
- printf("test complete");
+ led_g.write(led_on);
+ printf("test complete\r\n");
+ wait(1);
while(1)
{
