QAM add constellation plot

This commit is contained in:
2025-09-30 13:31:59 +02:00
parent 1b1851be8a
commit 821c3ea016
6 changed files with 188 additions and 20 deletions

35
plot/plot_constellation.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef PLOT_CONSTELLATION_H
#define PLOT_CONSTELLATION_H
#include <complex.h>
#include <SDL2/SDL.h>
typedef struct {
SDL_Window *window;
SDL_Renderer *renderer;
int width;
int height;
double scale;
double offset_x;
double offset_y;
} plot_t;
// Initialiser SDL et la fenêtre
void plot_init(plot_t *plot, int width, int height, double scale);
// Dessiner la constellation (grille de départ)
void plot_draw_constellation(plot_t *plot, double complex **constellation, int M);
// Dessiner un tableau de points complexes
void plot_draw_points(plot_t *plot, double complex *points, int nb_points, SDL_Color color);
// Dessiner les points progressivement avec animation
// delay_ms = délai entre chaque point en millisecondes
// Keypress pendant animation coupe lanimation
void plot_draw_points_animated(plot_t *plot, double complex *points, int nb_points, SDL_Color color, int delay_ms);
// Fermer SDL proprement
void plot_close(plot_t *plot);
#endif