Skip to content

Stymphalian/seng440_project

Repository files navigation

Date Modified: 
	August 1st, 2014
Authors:
	Amanda Dash	, V00768568
	Jordan Yu	, V00727036
For:
	SENG 499
	Prof. Sima


fft.h 
	header file for basic fft functions.
	the header file includes the following function prototypes:
	_fft(complex_t* input, complex_t* output, int n);

fft_util.c 
	source file for utility fft.h functions.

fft1.c
	first implementaion of the fft. Recursive and uses O(n^2)
	additional space per iteration.

fft2.c
	recursive + O(n) additional memory consumption

fft3.c
	recursive -> iterative implemntation

fft4.c
	profiled the code and 100% of the time was spent calculating the twiddles.
	Precalculate the twiddle factors, and passed in an fft_t context structure
	for the _fft function to get access to the twiddles.	
	Performance increase: 2.29191951 speedup	

fft5.c 
	Faster implementation of the bit_reversal function.
	Performance increase: 1.125691942 speedup

fft6.c 
	Inlined the 'complex_mult' method.
	Performance increase: 1.06848584 speedup

fft7.c
	Floating point to fixed point arithmetic.
	Max sample size of 2^17
	input samples: 15b decimal, 16 fractional, 1 sign bit
	twiddle factors: 1b decimal, 30 fractional, 1 sign bit	
	Performance descrese: 0.972271208 speedown

fft8.c
	Reworked fixed-point arithmetic.
	Micro-optimizations in the main _fft2 loop.
	i.e 
		divisions,multiplications into bit-shifts)
		inline of the bit-reverals function inside the jig_input function.
	Performance increase: 1.070503415 speedup



testbench/
	Files for testing an implemenation of the fft.
	Workflow for running tests.
	1. run 'make' to make the fft program ( default name = 'noin' )
	2. 'cp noin testbench/'
	3. 'cd testbench'
	4. run 'make' to create the testbench programs
	5. ./generate.sh -- Generate all the test data
	6. ./test.sh  > rs.test -- Run the tests and output the results
	7. open the rs.test file and check to see that the error is not "bad"
	8. make clean  -- clean up all the test data
	9. ./clean.sh


time_benchmark/
	Folder containing the timing tests for all the implementations.
	Example files:
	time1 - for timing test for fft1.c
	data3 - is the gprof data for fft3.c
	diff_3_4 - the time improvement from version 3 to version 4


	To obtain the time{x} data
	1. Ensure that the testbench program are compiled.
	2. Modify the makefile such that -DTIME_TEST is set.
	3. run make
	4. run ./test.sh 

	To obtain the data{x} data
	1. Compile with -pg flages
	2. ./noin 65536 0 < testbench/sample_data/65536_re_im_samples
	3. gprof ./noin >data{x}


-----GPU-----
qpu_test/
	Folder contains the basic files for a hello world version of the qpu code
	Does not currenly work 100%. But basically adds two numbers together.
        The butterfly.asm has the better commented code.

gpu.c   Contains the GPU functions (requires gpu.h)

mailbox.c  Part of the userland RPi firmware, added to project for convenience
	


FUTURE IMPROVEMENTS:
1. Memory thrasing.When performing the butterfly, the indices of each half of the butter fly 
are N/2 away from each other. Given that N can be quite large, this will probably incur
cache misses,thereby killig our performance.
2. Create look-up tables for cos and sin values.
3. Compile with -O3 for compiler optimizations.

About

FFT for SENG440 project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published