Skip to content

Commit 09e6421

Browse files
committed
Indentation changed to 2 spaces per indent
1 parent 46b8464 commit 09e6421

File tree

445 files changed

+138205
-137899
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+138205
-137899
lines changed

AppNotes/FixedPointFFT.c

+454-451
Large diffs are not rendered by default.

Benchfft/benchfft.c

+507-482
Large diffs are not rendered by default.

Examples/Android/SigLib_Graph/app/src/main/java/com/numerix_dsp/siglib_wrap/siglib_wrap_wrap.c

+24,652-17,655
Large diffs are not rendered by default.

Examples/Benchmark_XMOS/fft.c

+49-51
Original file line numberDiff line numberDiff line change
@@ -4,85 +4,83 @@
44

55
// Include files
66
#include <stdio.h>
7-
#include <siglib.h> // SigLib DSP library
7+
#include <siglib.h> // SigLib DSP library
88
#if ENABLE_BENCHMARK
99
#include "xbenchmark.h"
1010
#endif
1111

1212
// Define constants
1313
#define FFT_LENGTH 16
14-
#define LOG2_FFT_LENGTH SAI_FftLengthLog2(FFT_LENGTH) // Log2 FFT length,
14+
#define LOG2_FFT_LENGTH SAI_FftLengthLog2(FFT_LENGTH) // Log2 FFT length,
1515

1616
// Declare global variables and arrays
17-
static SLData_t *pRealData, *pImagData, *pFFTCoeffs;
18-
static SLData_t SinePhase;
17+
static SLData_t *pRealData, *pImagData, *pFFTCoeffs;
18+
static SLData_t SinePhase;
1919

2020

21-
int main(void)
22-
21+
int main (
22+
void)
2323
{
2424
#if ENABLE_BENCHMARK
25-
int start_time, end_time, overhead_time;
26-
overhead_time = xbench_init();
25+
int start_time, end_time, overhead_time;
26+
overhead_time = xbench_init ();
2727
#endif
2828

29-
// Allocate memory
30-
pRealData = SUF_VectorArrayAllocate (FFT_LENGTH);
31-
pImagData = SUF_VectorArrayAllocate (FFT_LENGTH);
32-
pFFTCoeffs = SUF_FftCoefficientAllocate (FFT_LENGTH);
29+
// Allocate memory
30+
pRealData = SUF_VectorArrayAllocate (FFT_LENGTH);
31+
pImagData = SUF_VectorArrayAllocate (FFT_LENGTH);
32+
pFFTCoeffs = SUF_FftCoefficientAllocate (FFT_LENGTH);
3333

34-
if ((NULL == pRealData) || (NULL == pImagData) || (NULL == pFFTCoeffs)) {
35-
printf ("\n\nMemory allocation failed\n\n");
36-
exit(0);
37-
}
34+
if ((NULL == pRealData) || (NULL == pImagData) || (NULL == pFFTCoeffs)) {
35+
printf ("\n\nMemory allocation failed\n\n");
36+
exit (0);
37+
}
3838

39-
// Initialise FFT
40-
SIF_Fft (pFFTCoeffs, // Pointer to FFT coefficients
41-
SIGLIB_BIT_REV_STANDARD, // Bit reverse mode flag / Pointer to bit reverse address table
42-
FFT_LENGTH); // FFT length
39+
// Initialise FFT
40+
SIF_Fft (pFFTCoeffs, // Pointer to FFT coefficients
41+
SIGLIB_BIT_REV_STANDARD, // Bit reverse mode flag / Pointer to bit reverse address table
42+
FFT_LENGTH); // FFT length
4343

4444

45-
SinePhase = SIGLIB_ZERO;
46-
SDA_SignalGenerate (pRealData, // Pointer to destination array
47-
SIGLIB_SINE_WAVE, // Signal type - Sine wave
48-
0.9, // Signal peak level
49-
SIGLIB_FILL, // Fill (overwrite) or add to existing array contents
50-
SIGLIB_TWO / (SLData_t)FFT_LENGTH, // Signal frequency
51-
SIGLIB_ZERO, // D.C. Offset
52-
SIGLIB_ZERO, // Unused
53-
SIGLIB_ZERO, // Signal end value - Unused
54-
&SinePhase, // Signal phase - maintained across array boundaries
55-
SIGLIB_NULL_DATA_PTR , // Unused
56-
FFT_LENGTH); // Output dataset length
45+
SinePhase = SIGLIB_ZERO;
46+
SDA_SignalGenerate (pRealData, // Pointer to destination array
47+
SIGLIB_SINE_WAVE, // Signal type - Sine wave
48+
0.9, // Signal peak level
49+
SIGLIB_FILL, // Fill (overwrite) or add to existing array contents
50+
SIGLIB_TWO / (SLData_t) FFT_LENGTH, // Signal frequency
51+
SIGLIB_ZERO, // D.C. Offset
52+
SIGLIB_ZERO, // Unused
53+
SIGLIB_ZERO, // Signal end value - Unused
54+
&SinePhase, // Signal phase - maintained across array boundaries
55+
SIGLIB_NULL_DATA_PTR, // Unused
56+
FFT_LENGTH); // Output dataset length
5757

58-
printf ("\nSource sine wave\n");
59-
SUF_PrintArray (pRealData, FFT_LENGTH);
58+
printf ("\nSource sine wave\n");
59+
SUF_PrintArray (pRealData, FFT_LENGTH);
6060

6161

6262
#if ENABLE_BENCHMARK
63-
start_time = xbench_get_time();
63+
start_time = xbench_get_time ();
6464
#endif
65-
SDA_Rfft (pRealData, // Pointer to real array
66-
pImagData, // Pointer to imaginary array
67-
pFFTCoeffs, // Pointer to FFT coefficients
68-
SIGLIB_BIT_REV_STANDARD, // Bit reverse mode flag / Pointer to bit reverse address table
69-
FFT_LENGTH, // FFT length
70-
LOG2_FFT_LENGTH); // log2 FFT length
65+
SDA_Rfft (pRealData, // Pointer to real array
66+
pImagData, // Pointer to imaginary array
67+
pFFTCoeffs, // Pointer to FFT coefficients
68+
SIGLIB_BIT_REV_STANDARD, // Bit reverse mode flag / Pointer to bit reverse address table
69+
FFT_LENGTH, // FFT length
70+
LOG2_FFT_LENGTH); // log2 FFT length
7171
#if ENABLE_BENCHMARK
72-
end_time = xbench_get_time();
73-
printf ("FFT Elapsed time = %d cycles\n", end_time - start_time - overhead_time);
72+
end_time = xbench_get_time ();
73+
printf ("FFT Elapsed time = %d cycles\n", end_time - start_time - overhead_time);
7474
#endif
7575

7676

77-
printf ("\nReal FFT of pure sine wave\n");
78-
SUF_PrintArray (pRealData, FFT_LENGTH);
77+
printf ("\nReal FFT of pure sine wave\n");
78+
SUF_PrintArray (pRealData, FFT_LENGTH);
7979

8080

81-
SUF_MemoryFree (pRealData); // Free memory
82-
SUF_MemoryFree (pImagData);
83-
SUF_MemoryFree (pFFTCoeffs);
81+
SUF_MemoryFree (pRealData); // Free memory
82+
SUF_MemoryFree (pImagData);
83+
SUF_MemoryFree (pFFTCoeffs);
8484

85-
exit(0);
85+
exit (0);
8686
}
87-
88-

Examples/Benchmark_XMOS/xbenchmark.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// XMOS Benchmarking Functions
22

3-
int xbench_get_time(void);
4-
5-
int xbench_init(void);
3+
int xbench_get_time (
4+
void);
65

6+
int xbench_init (
7+
void);

0 commit comments

Comments
 (0)