Part 3: FFT Implementation (individual task)
FFT Implementation Project Instructions
Objective
Develop a program in C that generates a specific signal, performs a 1024-point Fast Fourier Transform. (FFT) on it, and computes the magnitudes of the resulting frequency components. This implementation should specifically target the C2000 C28379D processor using Code Composer Studio (CCS) as the development environment.
Outcomes
● Gain a deeper understanding of the FFT algorithm.
● Implement complex number operations specifically for the C2000 C28379D DSP.
● Apply mathematical concepts in programming for signal processing using real-time DSP techniques.
Project Description
You are required to write a program from scratch that synthesises a signal composed of two sine waves of 200 Hz and 600 Hz, sampled at 8000 Hz. The program will then perform. a 1024-point FFT on this signal and calculate the magnitude of each frequency component. The entire code must be written using the C programming language, targeting the Texas Instruments C2000 C28379D processor.
Expected Output
● The output of the FFT should clearly show two peaks corresponding to the frequencies of the input signal (200 Hz and 600 Hz), similar to the graph shown in Figure 3. The magnitude values on the yaxis should reflect the intensity of the corresponding frequency components in the signal.
Steps
1. Theory Review:
● Study the principles of the FFT, particularly the Cooley-Tukey algorithm, which is suitable for lengths that are powers of two.
● Understand how to manage complex numbers in C programming for DSP applications.
● Review mathematical operations involved in signal processing, such as generating sine waves, complex multiplication, and magnitude calculation.
2. Environment Setup:
● Install and configure Code Composer Studio (CCS), the integrated development environment specifically tailored for Texas Instruments processors.
● Setup CCS for the C2000 C28379D processor, ensuring all relevant tools and libraries are available.
3. Signal Generation:
● Write a function to generate a composite signal from the specified sine waves of 2o0 Hz and 600 Hz, sampled at 8000 Hz.
● Implement the signal using fixed-point arithmetic as required by DSP operations on the C2000 C28379D.
4. FFT Algorithm Implementation:
● Implement a 1024-point FFT tailored for the C28379D processor.
● Manage bit-reversal and the computation of FFT stages efficiently to leverage the DSP capabilities of the processor.
● Calculate twiddle factors using trigonometric functions appropriate for fixed-point or integer math.
5. Complex Number Operations:
● Implement your own complex number operations, as standard C does not natively support complex data types efficiently for DSP tasks (unless using the C99 standard or above).
6. Magnitude Calculation:
● Create a function to calculate the magnitude of each frequency component from the FFT results, using math functions suitable for DSP operations.
7. Integration and Testing:
● Integrate all components: signal generation, FFT computation, and magnitude calculation.
● Test the program thoroughly in CCS, using simulation and real-time debugging tools provided by CCS for the C28379D processor.
● Validate results against theoretical expectations or reference FFT implementations.
8. Documentation:
● Document the development process, code, and any challenges encountered, focusing on how the DSP-specific features of the C28379D were utilised.
● Provide a comprehensive explanation of each part of the program and its testing methodology.
Submission:
● Submit the complete source code (in a project) along with a detailed report, including build and run instructions within CCS.
● Submit a report on the implementation, limited to a maximum of two pages.
Figure 3 FFT output.
Marking Scheme (Total: 34 Marks)
Criterion Description Marks
Implementation & Functionality
Fully working FFT with correct signal generation and frequency peaks. 16
Configuration & Accuracy
Correct magnitude computation and algorithm flow (bit reversal, twiddle factors, etc.). 9
Documentation & Explanation
Clear explanation of implementation, challenges, and verification steps. 4
Verification & Presentation
Evidence of FFT output showing two main peaks (200 Hz, 600 Hz). 5
Total 34