Question
The exercises for the lecture Real-Time Systems concern approaches from hardware-related software development, in particular performance-optimized software development. For this purpose, a problem is set
The exercises for the lecture Real-Time Systems concern approaches from hardware-related software development, in particular performance-optimized software development. For this purpose, a problem is set here in which a partial algorithm for calculating a discrete Fourier transformation is implemented accordingly. The discrete Fourier transform (DFT) calculates the frequencies inherent in a function over time. One can imagine that a tone, e.g. of a musical instrument, is recorded and then after the recording analyzed, which fundamental tones (= "height of the tone") and which harmonics (= "timbre") are contained in it. The discrete (and fast) Fourier transform (DFT, FFT) are now suitable algorithms to perform this via digital computer. The DFT now uses the sine and cosine functions and can therefore be implemented classically with floating point data types (float, double). However, the calculations with such data types are very timeconsuming if no hardware support (co-processor) is available. Especially in embedded systems, this is often missing, and for performance reasons one likes to choose the implementation in the form of integer data types. This is exactly your task: to find a solution for the integration of the sine and cosine functions for integration into algorithms that compute with data exclusively in integer format. To anticipate it right away: A simple "casting" like x = (int)(100. * sin ( y )) is NOT sufficient at all, because this only means that first in double format is calculated and then converted to Integer. However, they should replace the invoice itself. In detail:
Task 1: Capture the algorithm behind the discrete Fourier transform. As a basis, you can find some information in the script "Embedded Systems Engineering Manual V0.67", which is available for download on the server, but please use more information to understand the algorithm.
Task 2: Please focus exclusively on the implementation of the sine and cosine functions in integer format. For the calculation of the DFT, it is assumed that the fundamental vibration has a maximum period of 2048 measuring points. Thus, you need the sine function with a period of 2048 points, but you must also be able to calculate a sine function with e.g. 977 or 638 points as a period. Please discuss your approach to calculating such a function with varying scores with as little effort as possible. Accuracy is considered to be a precision of 16 bits in the function values.
Task 3: Please now implement the calculation of the sine and cosine functions for any number of points (< 2048) per period and test your implementation so that the error does not exceed +/- 1 lsb. I need the code of task 2 and task 3 in C.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started