C program that reads signal parameters, displays a grid of theoretical vs approximated signals, and finds the maximum using dichotomic search.
Author: Axel Fouet
make # compile
./projet # run- Input validation — reads and checks parameters via
saisie_valanddetec_erreur - Signal display — prints a grid comparing theoretical (
_thr) and approximated (_sum) signals - Max search — recursive dichotomic search (
max_dicho) to find the signal maximum over one period
TRIANGLE— no discontinuity, max converges to 1SAWTOOTHandSQUARE— discontinuities near the maximum cause the Gibbs phenomenon, max converges to ≈ 1.18
| Task | Complexity |
|---|---|
| Fill signal grid | O(nbL × nbN) |
| Display grid | O(nbL²) |
| Overall task 2 | O(nbL² + nbL × nbN) |