diff --git a/QAM/DDPLL/qam.c b/QAM/DDPLL/qam.c deleted file mode 100644 index 02b1ff5..0000000 --- a/QAM/DDPLL/qam.c +++ /dev/null @@ -1,346 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define A 10 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp) / norm_factor; - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - int idx = k * qam->N + n; - s[idx] = A * iq * cexp(2 * I * M_PI * qam->Fc * ((double)idx / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat, FILE *fp_constel) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)(k * qam->N + n) / qam->Fs)) / A; - } - r /= qam->N; - - if (fp_constel) { - fprintf(fp_constel, "% .8f % .8f\n", creal(r), cimag(r)); - fflush(fp_constel); - } - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl = 0; - int j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// PLL pour corriger le déphasage -void pll_qam_symbol(qam_system* qam, double complex* symbols_rx, double complex* r_corr, int nb_symbols, double Kp, double Ki, double alpha, FILE* fp_error) { - double phase_est = 0.0; - double integrator = 0.0; - double filtered_error = 0.0; - - int sm = (int)sqrt(qam->M); - int N = qam->N; - - for (int k = 0; k < nb_symbols; k++) { - double complex r_symbol = 0; - for (int n = 0; n < N; n++) { - int idx = k * N + n; - r_symbol += symbols_rx[idx] * cexp(-2.0 * I * M_PI * qam->Fc * ((double)idx / qam->Fs)); - } - r_symbol /= N; - - r_symbol *= cexp(-I * phase_est); - - double min_d = INFINITY; - double complex closest = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r_symbol - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - closest = qam->constellation[i][j]; - } - } - } - - double error = carg(r_symbol * conj(closest)); - - filtered_error = (1.0 - alpha) * filtered_error + alpha * error; - integrator += Ki * filtered_error; - phase_est += Kp * filtered_error + integrator; - - // Écriture de l'erreur PLL dans le fichier - if (fp_error) { - fprintf(fp_error, "%d % .8f\n", k, 100 * filtered_error); - fflush(fp_error); - } - - for (int n = 0; n < N; n++) { - int idx = k * N + n; - r_corr[idx] = symbols_rx[idx] * cexp(-I * phase_est); - } - } -} - - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { - int errors = 0; - for (int i = 0; i < nb_bits; i++) { - if (bits1[i] != bits2[i]) errors++; - } - return (double)errors / nb_bits; -} - -// Minimise le BER (si la pll s'est lockée de maniere déphasée de k*pi/2) -void demodulate2(qam_system* qam, double complex* r_corr, int nb_symbols, uint8_t* input_bits, uint8_t* output_bits, FILE* fp_constel) { - - int nb_bits = nb_symbols * qam->k; - double best_ber = INFINITY; - double best_angle = 0.0; - uint8_t* temp_bits = (uint8_t*)malloc(nb_bits * sizeof(uint8_t)); - - for (int r = 0; r < 4; r++) { - double angle = r * M_PI/2; - - double complex* rotated = (double complex*)malloc(sizeof(double complex) * nb_symbols * qam->N); - for (int i = 0; i < nb_symbols * qam->N; i++) { - rotated[i] = r_corr[i] * cexp(I * angle); - } - - demodulate(qam, rotated, nb_symbols, temp_bits, fp_constel); - - double ber = compare_bits(input_bits, temp_bits, nb_bits); - - if (ber < best_ber) { - best_ber = ber; - best_angle = angle; - } - - free(rotated); - } - - for (int i = 0; i < nb_symbols * qam->N; i++) { - r_corr[i] *= cexp(I * best_angle); - } - - demodulate(qam, r_corr, nb_symbols, output_bits, fp_constel); - - free(temp_bits); -} - - -int main () { - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - //qam.Ts = 0.0003; - //qam.N = (int)qam.Fs * qam.Ts; - qam.Ts = 0.01; - qam.N = (int)(qam.Fs * qam.Ts); - qam.Fc = 2000; - init_constellation(&qam); - - //int nb_bits = 1000; - //int nb_symbols = nb_bits / qam.k; - - //uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - //for (int i = 0; i < nb_bits; i++) { - // input_bits[i] = rand() % 2; - //} - char* texte = "Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux"; - int nb_chars = strlen(texte); - int nb_bits = nb_chars * 8; - int nb_symbols = (nb_bits + qam.k - 1) / qam.k; - - // Conversion du texte en bits - uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - for(int i = 0; i < nb_chars; i++){ - for(int b = 0; b < 8; b++){ - input_bits[i*8 + b] = (texte[i] >> (7-b)) & 1; - } - } - - // Conversion en symboles - double complex* symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits, nb_bits, symbols); - - // Modulation - int total_samples = qam.N * nb_symbols; - double complex* s = malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne - double snr_dB = 5; // SNR en dB - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - add_noise(s, total_samples, 10); - - - FILE *fp_ref = fopen("constellation_ref.dat", "w"); - int sm = (int)sqrt(qam.M); - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - fprintf(fp_ref, "% .8f % .8f\n", creal(qam.constellation[i][j]), cimag(qam.constellation[i][j])); - } - } - fclose(fp_ref); - FILE *fp_constel = fopen("constellation.dat", "w"); - - // Ajout de dephasage - //double phase_offset = M_PI / 6.0; // 30 degrés - //for (int i = 0; i < total_samples; i++) { - // s[i] *= cexp(I * phase_offset); - //} - - // AJout de decalage de fréquence - double freq_offset = 1; // Hz de décalage - for (int i = 0; i < total_samples; i++) { - double t = (double)i / qam.Fs; - s[i] *= cexp(I * 2 * M_PI * freq_offset * t); - } - - // Ajout de decalage entre les symbole - //int offset_samples = (int)(0.3 * qam.N); // décalage de 30% d’un symbole - //memmove(s + offset_samples, s, (total_samples - offset_samples) * sizeof(double complex)); - - double complex* r_corr = malloc(sizeof(double complex) * total_samples); - double Kp = 0.2; - double Ki = 0.02; - double alpha = 0.1; - FILE* fp_error = fopen("pll_error.dat", "w"); - pll_qam_symbol(&qam, s, r_corr, nb_symbols, Kp, Ki, alpha, fp_error); - fclose(fp_error); - - // Démodulation - uint8_t* output_bits = (uint8_t*)malloc(nb_bits * sizeof(uint8_t)); - demodulate2(&qam, r_corr, nb_symbols, input_bits, output_bits, fp_constel); - //demodulate(&qam, r_corr, nb_symbols, output_bits, fp_constel); - - fclose(fp_constel); - - // Reconstruction du texte - char* texte_recup = malloc(nb_chars + 1); - for(int i = 0; i < nb_chars; i++){ - char c = 0; - for(int b = 0; b < 8; b++){ - c |= output_bits[i*8 + b] << (7-b); - } - texte_recup[i] = c; - } - texte_recup[nb_chars] = '\0'; - printf("Texte original : %s\n\n", texte); - printf("Texte demodulé : %s\n", texte_recup); - - // Calcul du BER - double ber = compare_bits(input_bits, output_bits, nb_bits); - printf("Taux d'erreur blind QAM: %.4f\n", ber * 100); - - // Libération mémoire - free(input_bits); - free(output_bits); - free(symbols); - free(r_corr); - free(s); - free_constellation(&qam); - - return 0; -} diff --git a/QAM/OLD/constellation.dat b/QAM/OLD/constellation.dat deleted file mode 100644 index 45a4b59..0000000 --- a/QAM/OLD/constellation.dat +++ /dev/null @@ -1,1092 +0,0 @@ --0.21166224 -0.63349416 --0.65928982 0.19795052 --0.66662134 0.18796323 - 0.61262399 -0.12793747 --0.56796260 0.13484510 --0.62114773 0.17359794 --1.40125623 -0.18955888 --0.44291685 -1.79454204 --0.64479169 0.17535068 - 0.07645999 0.65046063 --1.09840160 0.88664761 --0.14770709 -0.62781736 --0.59674135 0.08597069 --0.99742096 0.93922735 --0.58386660 0.09641782 --0.15785855 -0.55906405 --1.37119845 -0.24619118 - 1.83077901 -0.54678807 --1.37874374 -0.28400077 --0.56103290 -1.83731803 --0.97335800 0.89567253 - 0.21174101 -1.38468023 --1.02371764 0.98760758 --1.36815422 -0.23648208 --0.60728121 0.15417119 --0.17707024 -0.62173184 --0.51026534 0.12385160 - 1.33550012 0.21819596 --1.14534103 0.93347727 --0.55717069 -1.84031362 --0.62745113 0.14567583 --0.19021321 -0.67735621 --1.09448694 1.00733086 - 0.06421953 0.61570763 --1.43520466 -0.27686183 --0.48654809 -1.81722578 --0.65474356 0.14662885 --1.72170971 0.46798849 --0.66813245 0.18712646 --0.14863999 -0.58200817 --1.33836789 -0.28379462 --0.47765750 -1.86616038 --0.60336748 0.20073873 --1.27356212 -0.27669849 --0.63818138 0.15414256 - 1.81780374 -0.45223663 --0.68141144 0.20271499 - 0.48993550 1.85146596 --0.55246646 0.23535401 - 0.99877299 0.99789076 --0.55928420 0.18828545 - 0.30989983 -1.42759106 --1.38785548 -0.31507658 --0.48887992 -1.89429781 --1.03388763 0.92517957 --1.07852247 0.97651671 --0.60174811 0.18878260 - 1.05992790 -0.97266691 --0.60587560 0.18225975 - 0.65186380 -0.10590021 --1.04241808 0.92756390 --1.86916641 0.44147056 --0.68206115 0.15672010 --0.35874842 1.37442590 --1.08814886 0.93156829 - 0.64513435 -0.12031898 --1.35788891 -0.35617794 --0.51424548 -1.82870599 --0.57778423 0.14667545 --0.89780146 -1.09605774 --1.12541931 0.88563685 --0.98399699 -1.08646063 --1.13111203 0.95061279 --0.13315727 -0.60214856 --0.62176694 0.10552978 --0.15878925 -0.62701154 --1.08623214 0.95393694 --0.18755104 -0.64756719 --1.08810956 0.96124679 - 1.09262093 -0.94097947 --1.42723722 -0.30697881 - 1.89177178 -0.50301351 --1.37282609 -0.35981923 --0.50959914 -1.89107725 --0.16208191 -0.57538735 --0.57480282 0.21362547 --0.60023376 0.12491680 - 0.55881885 -0.18323396 --0.63750447 0.19901065 --0.55860638 0.15048477 --1.37968789 -0.22992439 --0.49753745 -1.75561579 --0.61847420 0.14718362 - 0.27974831 0.61983187 --1.09265147 0.86860424 --0.15822587 -0.52485923 --0.62889392 0.15445108 --1.01818953 0.98355486 --0.71765873 0.13498461 --0.19665309 -0.63758150 --1.43457885 -0.27010912 - 1.88341886 -0.45069316 --1.42675523 -0.29726579 --0.49768102 -1.74512975 --1.06450351 0.95476220 - 0.34751352 -1.38734889 --1.05389448 1.02377376 --1.40509430 -0.25501978 --0.52552791 0.26563179 --0.21045069 -0.66497565 --0.57700711 0.13766843 - 1.33846977 0.33604419 --1.09443418 0.93392551 --0.41532483 -1.82620916 --0.65691207 0.09385588 --0.19723140 -0.69836938 --1.09138567 0.95307788 - 0.15316596 0.67164008 --1.38310375 -0.40923706 --0.50848878 -1.79683145 --0.60503645 0.21076753 --1.91049859 0.52735170 --0.62888448 0.12120881 --0.11550908 -0.66978847 --1.39522397 -0.18884980 --0.55841789 -1.86329980 --0.63025540 0.22205593 --1.36749329 -0.32958590 --0.65195857 0.19114293 - 1.80913218 -0.48133672 --0.63325331 0.14053854 - 0.50054371 1.94036203 --0.62652553 0.19661961 - 0.99737236 1.00455000 --0.67667109 0.16622462 - 0.24882498 -1.38543819 --1.42704505 -0.27723088 --0.48879072 -1.73521001 --1.05182190 0.87762741 --1.05655115 1.01388561 --0.60319950 0.17343875 - 1.05220756 -1.02228927 --0.60906175 0.19227052 - 0.56759724 -0.14636223 --1.09621448 1.01511670 --1.77333150 0.43700824 --0.53685210 0.16322734 --0.30095119 1.38499232 --0.99083447 0.88977900 - 0.60124381 -0.10577537 --1.36145724 -0.21693740 --0.44046234 -1.83309934 --0.60507917 0.19065292 --1.00198411 -1.02204068 --1.01129365 0.93130478 --0.94308073 -1.05486343 --0.99696573 0.99004087 --0.19103442 -0.66571498 --0.57934047 0.15486420 --0.16418024 -0.58555639 --1.10070665 0.92763479 --0.10757143 -0.62420967 --1.04637717 0.96451337 - 1.09051739 -0.92914391 --1.37604868 -0.30211158 - 1.88648550 -0.43591031 --1.36865863 -0.30854212 --0.41833756 -1.83006964 --0.16403425 -0.69071270 --0.61433162 0.20831428 --0.71262978 0.19239096 - 0.61365394 -0.03657952 --0.56636682 0.12036560 --0.64956167 0.11474180 --1.49340925 -0.24921784 --0.46523850 -1.89833069 --0.62410466 0.14872931 - 0.21022812 0.64009422 --0.97752451 0.98794682 --0.10778916 -0.55223303 --0.64399991 0.13151184 --1.07344068 0.96834502 --0.68779604 0.12653376 --0.14653638 -0.62348274 --1.38558063 -0.28259489 - 1.85406344 -0.39488446 --1.34288963 -0.26607235 --0.40053364 -1.70850575 --1.08318003 0.97799349 - 0.20605462 -1.45477624 --1.02169862 0.94028327 --1.40922803 -0.41954349 --0.66656812 0.15387338 --0.11886277 -0.63552901 --0.49764544 0.18727139 - 1.38542972 0.30189577 --1.12797149 0.96978500 --0.56691201 -1.80525517 --0.66572329 0.19609344 --0.17760839 -0.55192756 --1.05859813 0.94615982 - 0.17867014 0.58574016 --1.36963761 -0.30721450 --0.51891617 -1.79156638 --0.57230905 0.22601209 --1.84864391 0.51902401 --0.63731222 0.17000381 --0.02517450 -0.64167464 --1.43149969 -0.33434012 --0.48994563 -1.70972887 --0.62833949 0.22743937 --1.31892919 -0.21407731 --0.55709783 0.15063016 - 1.85499265 -0.40376493 --0.71779090 0.09627123 - 0.48965700 1.77416501 --0.60511053 0.09747586 - 1.06879056 1.08065771 --0.72646011 0.13108312 - 0.32092954 -1.44070525 --1.37843595 -0.33241917 --0.48901278 -1.84822134 --1.09031362 0.98238633 --1.00365440 0.89573416 --0.69158129 0.27776664 - 1.04645570 -0.99406418 --0.70003727 0.18527727 - 0.50939095 -0.18159792 --1.03175101 0.90467874 --1.83093397 0.50701899 --0.72040124 0.05166044 --0.19031405 1.37442072 --1.03273184 0.88132238 - 0.52464479 -0.14371175 --1.37555700 -0.37197507 --0.47185340 -1.81848114 --0.67576748 0.17798338 --0.89739343 -1.11050246 --1.00048350 0.88295547 --0.84969359 -0.94164284 --1.06910969 0.87866390 --0.17255121 -0.50358321 --0.58922301 0.12584212 --0.06189429 -0.67696005 --1.15243479 0.93771173 --0.21790542 -0.57767304 --1.04239567 0.95375948 - 1.08901193 -0.94735069 --1.34759995 -0.27382955 - 1.77403875 -0.52813373 --1.36572467 -0.24829340 --0.50389085 -1.82561498 --0.19950874 -0.64823292 --0.69146922 0.11716533 --0.70066183 0.14704900 - 0.58370003 -0.16090818 --0.62882573 0.10807210 --0.62108350 0.16960304 --1.33760875 -0.26543392 --0.46155116 -1.81579621 --0.56654590 0.14316712 - 0.12787540 0.57921437 --1.08982284 0.98121690 --0.18646105 -0.57712211 --0.67650447 0.14828641 --0.94737369 0.98247549 --0.60066990 0.11059309 --0.19402513 -0.54008421 --1.37200336 -0.24409506 - 1.80035231 -0.50260089 --1.38228540 -0.34911238 --0.51560449 -1.80992332 --1.03104101 1.00996998 - 0.21804146 -1.36798813 --1.01252167 0.97177167 --1.40668803 -0.28860775 --0.64842711 0.18743230 --0.19559445 -0.52466697 --0.59103026 0.09746866 - 1.31486252 0.20512568 --1.08032968 0.95019618 --0.48149577 -1.74705891 --0.63617853 0.20811642 --0.18289722 -0.49704909 --1.04798337 0.86664409 - 0.19075453 0.63153561 --1.35814166 -0.30006222 --0.45985352 -1.85889434 --0.69631406 0.15921673 --1.88119088 0.56118923 --0.49683182 0.17863553 --0.08922174 -0.58782908 --1.33878579 -0.24113912 --0.51841799 -1.76005165 --0.68545726 0.10560564 --1.50649531 -0.17600528 --0.73366077 0.18141892 - 1.88804971 -0.47599369 --0.65846535 0.18102956 - 0.48046239 1.88786970 --0.64314963 0.17698467 - 1.01473546 1.08747031 --0.55487712 0.17375212 - 0.21457183 -1.41144846 --1.47580865 -0.34326835 --0.32342135 -1.77822531 --1.07820770 0.88873214 --0.99723956 1.04019696 --0.58614054 0.19646802 - 1.05108639 -0.82290859 --0.62581542 0.10820590 - 0.56035749 -0.10655594 --1.07288233 0.95369173 --1.75761499 0.52083595 --0.66784782 0.21196706 --0.27255108 1.39008831 --1.01850209 1.00065046 - 0.69339902 -0.16892976 --1.42349179 -0.25528508 --0.46648951 -1.81375509 --0.63968671 0.09248562 --0.96862032 -1.05860474 --1.12494928 0.90878104 --0.92101699 -1.08925200 --1.06780270 0.97509489 --0.09588155 -0.64602856 --0.63711044 0.11127364 --0.23968051 -0.60428322 --0.95788628 0.99247412 --0.18430457 -0.66544838 --1.00317620 0.99640261 - 1.05114551 -0.93393715 --1.39543541 -0.27847812 - 1.81214409 -0.50258128 --1.43687324 -0.30129317 --0.52333889 -1.87922961 --0.11116764 -0.67617910 --0.59777164 0.15222512 --0.63683334 0.15817295 - 0.61718365 -0.15724204 --0.60942112 0.23808585 --0.57141965 0.16824508 --1.36553573 -0.24055553 --0.49619910 -1.80410065 --0.52522182 0.11542569 - 0.15316605 0.54234322 --1.03008824 0.88108130 --0.17872950 -0.61924677 --0.52748500 0.13434045 --1.05865427 0.92505916 --0.61035130 0.15863972 --0.13748775 -0.57846595 --1.38913828 -0.29262748 - 1.82586996 -0.47354389 --1.33110556 -0.29023984 --0.59409085 -1.82220989 --1.05926257 0.87999934 - 0.30529830 -1.31183153 --1.06714516 1.00308971 --1.48955325 -0.31757786 --0.63567702 0.21661396 --0.15117397 -0.52216803 --0.62330310 0.16490657 - 1.27976249 0.31010486 --1.09768921 0.97568377 --0.41222705 -1.84593110 --0.56886706 0.19021606 --0.22433817 -0.60024408 --1.00677248 0.89148905 - 0.13684681 0.62465567 --1.49225154 -0.35032676 --0.48989890 -1.92134750 --0.62048030 0.17535535 --1.88940578 0.43491995 --0.62029595 0.10075866 --0.17030152 -0.60931213 --1.43108692 -0.22478414 --0.52431895 -1.88010476 --0.64573117 0.21573793 --1.37282195 -0.30713584 --0.50498089 0.11649598 - 1.77056910 -0.45137069 --0.54272349 0.17245028 - 0.52289295 1.79957057 --0.65262416 0.13183544 - 0.95919779 1.08205809 --0.62989126 0.15208993 - 0.32070444 -1.35013413 --1.37970077 -0.28326753 --0.51839913 -1.78198097 --1.07795246 1.01050380 --1.12038884 0.93334508 --0.73898229 0.19554639 - 1.03769488 -0.95635921 --0.65177336 0.18957218 - 0.62157082 -0.20490408 --1.07969465 0.92376739 --1.81240689 0.50129688 --0.59102317 0.06885525 --0.28519051 1.38444326 --1.09078682 0.92323437 - 0.61222233 -0.09626676 --1.32918440 -0.29190573 --0.51946475 -1.85809266 --0.59032347 0.22980514 --0.95060213 -1.16136156 --1.12001062 0.90276529 --0.87586214 -1.09617976 --1.06460924 0.95099338 --0.18419400 -0.67278415 --0.73280039 0.12476788 --0.04100332 -0.63257596 --0.97288469 0.99592436 --0.18183313 -0.70961060 --1.06228061 1.04499967 - 1.06380153 -0.96619318 --1.41045083 -0.32435047 - 1.91888121 -0.45768324 --1.46439548 -0.27967514 --0.46558304 -1.81775731 --0.14242828 -0.57770096 --0.68666956 0.09756451 --0.67869855 0.06166822 - 0.62711153 -0.32612000 --0.64503249 0.20753035 --0.70693075 0.04288198 --1.40039870 -0.29193527 --0.41615619 -1.91452553 --0.70467013 0.20647626 - 0.15330012 0.56572398 --1.10960405 0.93377725 --0.19909614 -0.59073162 --0.53013922 0.15400712 --1.05736818 0.91153008 --0.62945071 0.14799292 --0.13219398 -0.60290112 --1.42122479 -0.31683773 - 1.75650497 -0.44742048 --1.32660338 -0.26087525 --0.42875248 -1.80010827 --0.94001600 0.96943463 - 0.29091872 -1.36137425 --1.02906560 0.93487133 --1.29383651 -0.34426053 --0.67232959 0.11527985 --0.09948656 -0.61556546 --0.59030499 0.13783502 - 1.39400708 0.25512325 --1.11159399 0.91647631 --0.44059292 -1.77224646 --0.57878450 0.18054274 --0.04272465 -0.66124937 --1.02136133 1.03057808 - 0.12655399 0.62911299 --1.36278144 -0.29804815 --0.40503008 -1.79372547 --0.64228522 0.09873060 --1.86175202 0.42469062 --0.64660111 0.19036415 --0.15809607 -0.62835264 --1.34144018 -0.25865212 --0.60677316 -1.88768108 --0.63163690 0.14744869 --1.45047250 -0.28342752 --0.63721233 0.17068490 - 1.82537380 -0.50433494 --0.58064427 0.09318917 - 0.46170224 1.86789498 --0.54007371 0.04837852 - 0.97442065 0.96606302 --0.57752267 0.18782220 - 0.27196434 -1.37923645 --1.50900221 -0.20322280 --0.50637847 -1.86700229 --1.04028435 0.98584385 --1.04675817 0.87042942 --0.60462180 0.14114230 - 1.13657031 -0.94127222 --0.54622767 0.17435618 - 0.67834450 -0.12233796 --1.10945878 0.94282447 --1.89389073 0.49062635 --0.60533955 0.15211963 --0.26947361 1.35859323 --0.96962260 0.88610671 - 0.65574521 -0.11415314 --1.40860380 -0.31694676 --0.52158448 -1.82661739 --0.53615090 0.21487120 --0.95109683 -0.99559190 --1.00756323 0.89500869 --0.95317828 -1.09339590 --1.05197258 0.98565573 --0.09872628 -0.69548942 --0.66299871 0.24073042 --0.13411670 -0.61315188 --1.08873868 0.98595292 --0.25875928 -0.64962210 --1.02146730 0.97742688 - 1.12609838 -0.93176705 --1.43389563 -0.29840671 - 1.84759664 -0.47231140 --1.32291546 -0.27032971 --0.51817354 -1.91273382 --0.19827168 -0.50106587 --0.67149255 0.15261585 --0.61748717 0.16411765 - 0.60013440 -0.25013917 --0.61644131 0.13415789 --0.68936339 0.13867855 --1.36762142 -0.26380367 --0.45524581 -1.77714302 --0.67293412 0.10432996 - 0.19676575 0.54164076 --1.05710548 0.93029442 --0.27095609 -0.67928046 --0.56235855 0.09652396 --0.99143412 0.91418526 --0.67803974 0.18997699 --0.11499046 -0.59012064 --1.37198733 -0.31587972 - 1.92449249 -0.40669738 --1.43856453 -0.32159070 --0.49291422 -1.87621232 --1.09355865 0.92681598 - 0.26696362 -1.41769586 --1.13817013 0.96908462 --1.40967515 -0.20786705 --0.59156411 0.19653632 --0.20529315 -0.72688609 --0.55844992 0.19424130 - 1.38504677 0.15628465 --1.03969860 0.97163362 --0.52637739 -1.91058428 --0.68849776 0.16538917 --0.15813602 -0.64018794 --1.10196546 1.04113875 - 0.21437957 0.67282050 --1.35210977 -0.28816983 --0.50025319 -1.85534635 --0.63018641 0.25211435 --1.80654517 0.45614632 --0.66263694 0.18531926 --0.05914119 -0.60710371 --1.43214196 -0.34688333 --0.49860421 -1.78783064 --0.57675885 0.18441646 --1.36878381 -0.27889717 --0.59063329 0.14071212 - 1.87954977 -0.50391032 --0.56960253 0.12630514 - 0.46927447 1.82411649 --0.60834180 0.09564296 - 0.92760054 1.01116583 --0.62871150 0.23983584 - 0.25905016 -1.33996868 --1.40963941 -0.19957679 --0.51169465 -1.86891430 --0.99716449 0.95943813 --1.07957007 0.89140390 --0.51371711 0.14273066 - 1.03906955 -0.97849904 --0.59860461 0.17073970 - 0.62597961 -0.16053722 --1.01043033 0.93830792 --1.81303899 0.50069568 --0.59334296 0.19095283 --0.29180480 1.35641869 --1.11178212 0.96156071 - 0.72530258 -0.17724952 --1.45735727 -0.28264390 --0.57862051 -1.85506416 --0.67920914 0.14768955 --1.01559275 -1.01068899 --1.08380200 0.85980806 --1.02377156 -1.13422602 --1.00846367 0.99992434 --0.20760941 -0.64228030 --0.58606898 0.21870785 --0.19758952 -0.61039985 --1.05290475 0.87460637 --0.19542150 -0.57564887 --1.11656891 0.96538486 - 1.08666769 -0.90467772 --1.40732766 -0.21706844 - 1.85598091 -0.51644273 --1.33642764 -0.18799444 --0.53884944 -1.88704668 --0.17657775 -0.61809756 --0.61061157 0.12737169 --0.63333585 0.12220880 - 0.52421722 -0.16537705 --0.61098009 0.15792695 --0.64105064 0.19904518 --1.39516755 -0.29460807 --0.64138589 -1.75503876 --0.67611824 0.16164230 - 0.17487635 0.62013100 --1.10241746 0.83377247 --0.26134997 -0.65435322 --0.57811256 0.20080790 --1.04725796 0.97701150 --0.66807704 0.20189772 --0.20217344 -0.63239045 --1.44582200 -0.27085925 - 1.80253594 -0.52526520 --1.35499195 -0.29490053 --0.50940811 -1.89737175 --1.06859889 0.93306135 - 0.33923281 -1.50088504 --0.97900731 0.94382520 --1.40959665 -0.27926284 --0.54312460 0.18301198 --0.21740931 -0.63931915 --0.60956949 0.18708594 - 1.33095764 0.22475515 --1.09952110 0.98997656 --0.53857170 -1.77457394 --0.65812885 0.23308324 --0.12492237 -0.62557142 --1.00066443 0.99181149 - 0.20820653 0.57650931 --1.33695436 -0.25349059 --0.46061815 -1.78691636 --0.54690426 0.10704518 --1.85067330 0.45490579 --0.72758068 0.09630779 --0.19102931 -0.53349023 --1.40252377 -0.27089786 --0.40430910 -1.85112744 --0.57124780 0.26314874 --1.37373094 -0.33186111 --0.59064516 0.13155758 - 1.89621756 -0.45684403 --0.56842207 0.22354600 - 0.58595834 1.82107888 --0.64719191 0.10251391 - 0.96177785 1.09886915 --0.55061668 0.17454010 - 0.25422983 -1.35286892 --1.43527340 -0.31271313 --0.49716320 -1.76562795 --1.01981524 0.95526135 --1.04848204 0.92729421 --0.60625373 0.23357314 - 1.10355120 -0.97369981 --0.57069058 0.19134417 - 0.62561276 -0.20612103 --1.07874556 1.00241800 --1.78907027 0.49861610 --0.58048084 0.13085654 --0.28618126 1.39414984 --1.00879783 0.94861586 - 0.61986832 -0.15618560 --1.39815193 -0.22860293 --0.54338964 -1.87280742 --0.64213279 0.08078113 --0.98223347 -1.12234852 --1.04153758 0.91684102 --0.94304334 -0.97124205 --1.08058407 0.92278703 --0.11756653 -0.73533985 --0.56940084 0.16476350 --0.22505681 -0.52723165 --1.03456666 0.94007974 --0.17447838 -0.55158602 --1.10693390 0.95942289 - 1.13603299 -0.94714545 --1.42952500 -0.28573511 - 1.87111008 -0.48178513 --1.31084628 -0.24015991 --0.56462176 -1.85775904 --0.19703383 -0.61146023 --0.61868298 0.16318906 --0.59144758 0.16667764 - 0.57297697 -0.17306981 --0.57278776 0.18598492 --0.61489651 0.07200587 --1.41691744 -0.30157948 --0.52258875 -1.79810247 --0.61483363 0.18045454 - 0.19011243 0.69030864 --1.10525868 0.88214554 --0.14402120 -0.64617344 --0.57705621 0.17539008 --1.06408245 0.91436297 --0.61439117 0.11344853 --0.11447616 -0.61813997 --1.32877140 -0.28997313 - 1.85165779 -0.57944520 --1.39525456 -0.23531595 --0.51839648 -1.88745963 --1.00905628 0.91241299 - 0.28239740 -1.43967703 --1.11280204 0.97899564 --1.41203920 -0.36456114 --0.59788209 0.23961253 --0.18511511 -0.57291927 --0.67813852 0.16452850 - 1.38241796 0.30450009 --1.06801472 0.94633999 --0.42042667 -1.79945848 --0.60395907 0.14646634 --0.22942230 -0.59576931 --1.14146698 0.98087251 - 0.12866699 0.62143308 --1.36791415 -0.28834668 --0.41297756 -1.78900762 --0.59707277 0.10645707 --1.90441820 0.47667446 --0.62161920 0.15093031 --0.15624054 -0.63886887 --1.31987290 -0.37201837 --0.44619749 -1.86113745 --0.63565890 0.16983864 --1.25751364 -0.30730791 --0.54398107 0.13483527 - 1.77059430 -0.42806550 --0.58893186 0.13348912 - 0.51422233 1.87863353 --0.56930240 0.10906630 - 0.95620448 0.98673411 --0.59677191 0.07271377 - 0.28242743 -1.37453580 --1.32232433 -0.22083278 --0.53134371 -1.77251640 --1.11794773 0.94056372 --1.06498709 0.94693104 --0.58965608 0.21048237 - 1.01324700 -0.91313394 --0.62602758 0.10893117 - 0.54492104 -0.12972554 --1.11750972 1.00444236 --1.80577020 0.54155500 --0.73229597 0.15681230 --0.34363714 1.33505097 --1.09423973 0.97911274 - 0.64955178 -0.12262108 --1.48346411 -0.31563764 --0.43653960 -1.76553124 --0.59916167 0.24174400 --0.89322262 -1.07926369 --1.03253287 0.99584250 --0.92867814 -1.10330393 --1.05705576 0.90692630 --0.18650457 -0.65848881 --0.67505055 0.04378869 --0.12717498 -0.53119077 --1.01041484 0.91938153 --0.04402947 -0.62804841 --1.08412501 0.87169145 - 0.94009604 -0.91649436 --1.42323580 -0.21864212 - 1.82916786 -0.49687722 --1.37756359 -0.31491538 --0.40324920 -1.87192307 --0.26519404 -0.58061929 --0.61773679 0.12425576 --0.59172253 0.11151825 - 0.66017464 -0.10630206 --0.57571053 0.14416096 --0.64134352 0.17026130 --1.44767113 -0.32523369 --0.55092973 -1.90424167 --0.61800044 0.14413664 - 0.20120468 0.70474563 --1.00827681 0.94310994 --0.15705033 -0.71528273 --0.51920376 0.14041553 --1.08034442 0.92666978 --0.61659233 0.18989629 --0.21580944 -0.67816825 --1.37048778 -0.21679544 - 1.85993966 -0.47675534 --1.42584568 -0.32482621 --0.41521898 -1.81579831 --1.01531232 0.86023551 - 0.26954328 -1.32471500 --1.09859400 0.81077879 --1.40911482 -0.38159002 --0.71397609 0.15590050 --0.19239496 -0.60219634 --0.56925139 0.20236771 - 1.36356550 0.19845341 --1.06121329 0.91938167 --0.51561709 -1.79459264 --0.65790280 0.04741164 --0.16255192 -0.55395849 --1.17233739 0.91228284 - 0.06545902 0.62359958 --1.40251548 -0.30734224 --0.54210002 -1.91922269 --0.58398870 0.24003468 --1.89825882 0.40037064 --0.61294601 0.30552388 --0.09339589 -0.58362913 --1.27320231 -0.33232040 --0.46021778 -1.75646283 --0.70017604 0.25165739 --1.42239528 -0.33258125 --0.62993514 0.19062525 - 1.73987849 -0.43952278 --0.61338796 0.23827455 - 0.48284917 1.80479570 --0.59427620 0.05693373 - 1.00496400 1.03151872 --0.66652304 0.13680774 - 0.33580241 -1.35191544 --1.34802931 -0.26159328 --0.51211806 -1.88281771 --1.08408467 0.87267555 --0.94426127 0.93913076 --0.60240531 0.13622525 - 1.14292511 -0.89951984 --0.61200477 0.18368300 - 0.63261984 -0.17347638 --1.08052487 0.90761858 --1.80293720 0.52114116 --0.60290042 0.23263551 --0.38390720 1.47481737 --0.99215789 0.96512083 - 0.56778776 -0.17635955 --1.33119067 -0.34993777 --0.51360061 -1.85454299 --0.58545935 0.18379229 --0.91546676 -1.03305566 --1.07776718 0.97590709 --0.99734301 -1.00719650 --1.02325133 0.91094139 --0.16076018 -0.60975515 --0.58409393 0.20363018 --0.05702941 -0.72794902 --1.01471899 0.94588041 --0.15036349 -0.63284006 --1.03721114 0.97941252 - 1.05191128 -0.93103379 --1.46503772 -0.33818829 - 1.82099894 -0.56709468 --1.39766402 -0.29964684 --0.47566511 -1.81391286 --0.05446676 -0.63107170 --0.57380833 0.17227535 --0.66368949 0.01905049 - 0.61593318 -0.24638493 --0.57882392 0.14763180 --0.55826719 0.13955561 --1.35400466 -0.27885659 --0.51606051 -1.89108240 --0.60833474 0.16768479 - 0.08446198 0.60822110 --1.01026531 0.94380582 --0.07563759 -0.53069872 --0.70215214 0.28612600 --0.96535146 0.96358874 --0.58075617 0.14741050 --0.25044085 -0.59214091 --1.31218572 -0.39045253 - 1.83978631 -0.41297726 --1.31966820 -0.31999665 --0.58386654 -1.78016775 --1.07092222 0.98472945 - 0.28094878 -1.36693264 --1.08776570 0.97720785 --1.38805120 -0.33786148 --0.58390130 0.11524622 --0.18541578 -0.57841823 --0.62706917 0.11752170 - 1.35307704 0.23635402 --1.00786513 0.94633465 --0.62942502 -1.87344791 --0.61322674 0.21839502 --0.17885064 -0.58299838 --0.99887780 1.02646021 - 0.13572842 0.61555958 --1.38882276 -0.32228185 --0.49602113 -1.78281106 --0.54214935 0.17670203 --1.81366986 0.51041170 --0.61622773 0.17611403 --0.19161365 -0.64752914 --1.33760511 -0.24476290 --0.46481196 -1.88468137 --0.68189616 0.22199382 --1.33268994 -0.21457338 --0.60237060 0.20007536 - 1.74932724 -0.52029985 --0.69010295 0.12082798 - 0.59119146 1.85209472 --0.57269550 0.10082064 - 0.97789445 1.02487042 --0.51707726 0.16021642 - 0.22037855 -1.30652642 --1.39118544 -0.23660739 --0.43200721 -1.81096231 --1.12370336 0.92223106 --1.07236600 1.04615230 --0.60738229 0.12720995 - 0.97129753 -0.96895419 --0.59711997 0.14919611 - 0.62371266 -0.20350724 --1.14859136 0.89572155 --1.83641281 0.50024787 --0.67656225 0.11088949 --0.27986225 1.33215708 --1.12124398 0.89433603 - 0.49931955 -0.20632151 --1.30874478 -0.29041760 --0.45772732 -1.83060733 --0.52352984 0.04675798 --0.89806412 -1.05930625 --1.04969815 0.95802318 --0.99432852 -1.06271617 --1.01915265 0.96086240 --0.20478031 -0.60947426 --0.62823610 0.13947310 --0.13070618 -0.55791750 --1.15264135 0.94299528 --0.19151347 -0.62028036 --1.09333832 0.97248858 - 1.07004520 -0.84672991 --1.39908147 -0.30979224 - 1.76418795 -0.40052688 --1.30854618 -0.27387977 --0.45188740 -1.75407610 --0.17766190 -0.57000330 --0.71420667 0.17582195 --0.59191448 0.15647518 - 0.58473001 -0.12184829 --0.57548862 0.15567870 --0.64743394 0.23612999 --1.31033517 -0.30786791 --0.42083612 -1.80810041 --0.67952866 0.17741786 - 0.27804078 0.55474172 --1.10991364 1.02977071 --0.16800216 -0.61103570 --0.62181990 0.16906211 --1.00552977 0.97283581 --0.68037752 0.21908760 --0.26668580 -0.59865488 --1.40552197 -0.34839676 - 1.77276108 -0.49418954 --1.38936254 -0.28926028 --0.50152323 -1.85379979 --1.08202602 0.85850523 - 0.21885109 -1.40709076 --1.10628863 1.01448739 --1.43619097 -0.28676922 --0.65854515 0.11984925 --0.18841219 -0.67025447 --0.60437348 0.21260744 - 1.31643907 0.27020172 --1.02934514 0.92160472 --0.58355228 -1.77904505 --0.65985671 0.14801205 --0.21738269 -0.58121841 --1.04495133 1.01026890 - 0.22018671 0.52016898 --1.39841280 -0.25114435 --0.45010387 -1.85466131 --0.68426660 0.17468023 --1.88902725 0.51337993 --0.70759065 0.18590559 --0.27226638 -0.56156981 --1.37400809 -0.31004318 --0.46269413 -1.83452454 --0.59519191 0.17092665 --1.36789958 -0.25217401 --0.56026179 0.16980207 - 1.85572609 -0.51362478 --0.46117653 0.10707504 - 0.43818493 1.85670812 --0.56987924 0.15478056 - 0.99463593 1.09992271 --0.57378634 0.21635970 - 0.24779254 -1.35098546 --1.39779307 -0.27426301 --0.51073588 -1.77607139 --1.05189838 0.93332842 --1.07772196 0.84506767 --0.56112468 0.12166127 - 1.10069095 -0.99566578 --0.52277621 0.18881185 - 0.55688813 -0.06742460 --1.04963702 0.96828169 --1.82306095 0.53923251 --0.57742364 0.11113081 --0.31072018 1.48809146 --1.03167700 0.90070055 - 0.69041020 -0.13880643 --1.44787594 -0.29448599 --0.50497945 -1.87929328 --0.65241196 0.18077296 --0.94183811 -1.04427155 --1.05631652 0.87546033 --0.94067758 -0.98647279 --1.11838528 0.94620562 --0.20541496 -0.55308438 --0.70366579 0.16491291 --0.22044625 -0.65573943 --1.06068082 0.88962531 --0.17796857 -0.69170105 --1.08381298 0.89247152 - 1.12105405 -0.91228165 --1.41261948 -0.30919885 - 1.81704808 -0.63137756 --1.38587033 -0.32066987 --0.42714990 -1.88664441 --0.16614460 -0.61589180 --0.70480712 0.18101690 --0.53275804 0.14552550 - 0.55549758 -0.09738522 --0.57887617 0.16292705 --0.59672380 0.22585718 --1.31393199 -0.36864247 --0.39999601 -1.84997912 --0.51763463 0.06373677 - 0.13041725 0.51751937 --1.07856268 0.95236371 --0.15629497 -0.58043585 --0.59535988 0.09737557 --1.02604245 0.93815841 --0.46122713 0.10970351 --0.23738825 -0.68875237 --1.41233071 -0.24305549 - 1.87440367 -0.47554851 --1.34077568 -0.25815643 --0.44071516 -1.82832275 --0.95187701 0.98290052 - 0.27546613 -1.32904666 --1.00919198 0.97878060 --1.38106027 -0.40322290 --0.62384863 0.28211170 --0.13136849 -0.61444406 --0.62642176 0.17750208 - 1.41461506 0.38971987 --1.08189816 0.90125681 --0.51818358 -1.89265577 --0.61563341 0.25090453 --0.12653196 -0.57629853 --1.15215039 0.92454728 - 0.21387751 0.59333028 --1.37817688 -0.24577835 --0.51267290 -1.91831689 --0.51888802 0.07669358 --1.83641782 0.47824739 --0.48393591 0.20214806 --0.19872932 -0.58703306 --1.42962176 -0.24895076 --0.49588621 -1.82897535 --0.59144935 0.11600451 --1.39574497 -0.26086815 --0.63509513 0.27210716 - 1.79102129 -0.52294509 --0.66219831 0.21447927 - 0.45990567 1.93929244 --0.55448173 0.09682690 - 0.96166259 1.09306593 --0.63003906 0.17181562 - 0.32486060 -1.43129849 --1.29378238 -0.29308043 --0.47891720 -1.77738730 --0.95406437 0.99193533 --1.06608049 0.90954381 --0.60779758 0.18783466 - 1.02334877 -0.90443193 --0.65778331 0.10418962 - 0.59044220 -0.14586863 --1.08338360 0.97608164 --1.86132801 0.45330818 --0.70819002 0.20599395 --0.20958351 1.43602820 --1.09039733 0.96941013 - 0.62919464 -0.19923559 --1.39059583 -0.22250314 --0.51826953 -1.84474234 --0.59883082 0.21910703 --0.89876425 -1.01434766 --1.03329246 0.94788759 --0.97748586 -1.11625326 --0.95696852 0.90535025 --0.23313128 -0.65775376 --0.56612079 0.13988205 --0.14890013 -0.58281132 --1.03965927 0.98041683 --0.15899234 -0.57528045 --0.97760957 0.97986433 - 1.03519439 -0.92426921 --1.34421530 -0.35904764 - 1.84654319 -0.61478509 --1.41285156 -0.27893472 --0.51249423 -1.78532546 diff --git a/QAM/OLD/constellation_ref.dat b/QAM/OLD/constellation_ref.dat deleted file mode 100644 index 2c119c2..0000000 --- a/QAM/OLD/constellation_ref.dat +++ /dev/null @@ -1,16 +0,0 @@ --1.34164079 -1.34164079 --1.34164079 -0.44721360 --1.34164079 0.44721360 --1.34164079 1.34164079 --0.44721360 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 - 0.44721360 -0.44721360 - 0.44721360 0.44721360 - 0.44721360 1.34164079 - 1.34164079 -1.34164079 - 1.34164079 -0.44721360 - 1.34164079 0.44721360 - 1.34164079 1.34164079 diff --git a/QAM/OLD/debug.py b/QAM/OLD/debug.py deleted file mode 100644 index 41aee08..0000000 --- a/QAM/OLD/debug.py +++ /dev/null @@ -1,32 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt - -def plot_constellations(ref_file, rx_file, title="Constellation comparison"): - # Charger et forcer 2D - ref_data = np.atleast_2d(np.loadtxt(ref_file)) - rx_data = np.atleast_2d(np.loadtxt(rx_file)) - - x_ref, y_ref = ref_data[:,0], ref_data[:,1] - x_rx, y_rx = rx_data[:,0], rx_data[:,1] - - plt.figure(figsize=(6,6)) - plt.scatter(x_ref, y_ref, color='blue', s=50, marker='o', label='Référence') - plt.scatter(x_rx, y_rx, color='red', s=50, marker='x', label='Reçu') - - # Ajustement automatique des limites - all_x = np.concatenate([x_ref, x_rx]) - all_y = np.concatenate([y_ref, y_rx]) - margin = 0.1 * max(np.ptp(all_x), np.ptp(all_y)) - plt.xlim(min(all_x)-margin, max(all_x)+margin) - plt.ylim(min(all_y)-margin, max(all_y)+margin) - - plt.xlabel('In-phase (I)') - plt.ylabel('Quadrature (Q)') - plt.title(title) - plt.grid(False) - plt.gca().set_aspect('equal', adjustable='box') - plt.legend() - plt.show() - -plot_constellations("constellation_ref.dat", "constellation.dat", title="Constellation QAM") - diff --git a/QAM/OLD/debug2.py b/QAM/OLD/debug2.py deleted file mode 100644 index 1e252b8..0000000 --- a/QAM/OLD/debug2.py +++ /dev/null @@ -1,68 +0,0 @@ -import numpy as np -import matplotlib.pyplot as plt -from watchdog.observers import Observer -from watchdog.events import FileSystemEventHandler -import time -import os - -needs_update = True # flag global - -def plot_constellations(ref_file, rx_file, title="Constellation Comparison", save_path=None): - ref_data = np.atleast_2d(np.loadtxt(ref_file)) - rx_data = np.atleast_2d(np.loadtxt(rx_file)) - - x_ref, y_ref = ref_data[:,0], ref_data[:,1] - x_rx, y_rx = rx_data[:,0], rx_data[:,1] - - plt.clf() # efface la figure précédente - plt.scatter(x_ref, y_ref, color='dodgerblue', s=80, marker='o', edgecolors='k', label='Référence') - plt.scatter(x_rx, y_rx, color='tomato', s=80, marker='x', alpha=0.6, label='Reçu') - - all_x = np.concatenate([x_ref, x_rx]) - all_y = np.concatenate([y_ref, y_rx]) - margin = 0.15 * max(np.ptp(all_x), np.ptp(all_y)) - plt.xlim(min(all_x)-margin, max(all_x)+margin) - plt.ylim(min(all_y)-margin, max(all_y)+margin) - - plt.grid(True, which='both', linestyle='--', linewidth=0.5, alpha=0.7) - plt.axhline(0, color='black', linewidth=1) - plt.axvline(0, color='black', linewidth=1) - plt.xlabel('In-phase (I)', fontsize=12) - plt.ylabel('Quadrature (Q)', fontsize=12) - plt.title(title, fontsize=14, fontweight='bold') - plt.gca().set_aspect('equal', adjustable='box') - plt.legend() - if save_path: - plt.savefig(save_path, dpi=300, bbox_inches='tight') - plt.pause(0.1) - -class FileChangeHandler(FileSystemEventHandler): - def on_modified(self, event): - global needs_update - if event.src_path.endswith("constellation_ref.dat") or event.src_path.endswith("constellation.dat"): - print(f"{event.src_path} modifié") - needs_update = True # on ne fait que signaler - -if __name__ == "__main__": - ref_file = "constellation_ref.dat" - rx_file = "constellation.dat" - - plt.ion() - plt.figure(figsize=(7,7)) - plot_constellations(ref_file, rx_file) - - event_handler = FileChangeHandler() - observer = Observer() - observer.schedule(event_handler, path=os.path.dirname(os.path.abspath(ref_file)) or '.', recursive=False) - observer.start() - - try: - while True: - if needs_update: - plot_constellations(ref_file, rx_file) - needs_update = False - time.sleep(0.2) # boucle principale - except KeyboardInterrupt: - observer.stop() - observer.join() - diff --git a/QAM/OLD/old2/constellation.dat b/QAM/OLD/old2/constellation.dat deleted file mode 100644 index 73e4d15..0000000 --- a/QAM/OLD/old2/constellation.dat +++ /dev/null @@ -1,1440 +0,0 @@ --1.52838359 -0.95577318 --0.50310489 0.67662581 --1.59666882 0.88455561 - 1.32167815 -1.15701567 --0.78209692 1.46918654 --0.99299053 1.14232227 --3.11631855 0.05437948 --2.63981059 -2.50210325 --0.68648662 1.17358801 - 0.46179702 0.20770236 --1.63109707 3.17510723 --1.03270185 -0.76960214 --0.90006954 0.21633667 --1.52534921 2.69583177 --0.27987480 0.91571898 --0.47891711 -1.02499529 --3.38623352 0.89684135 - 2.77479207 -3.50995615 --3.06733344 0.99249930 --3.48333667 -3.50785854 --1.63227340 2.29269669 --0.79627236 -3.68834175 --0.41781242 3.15047004 --3.24008147 0.55985147 --0.92832563 0.92761381 --1.01531112 -0.82857568 --0.57308878 1.99463844 - 2.18316061 -0.90232597 --0.20188528 2.64489375 --3.65158495 -3.13446025 --0.97775368 1.24359529 --0.46968154 -1.48028834 --0.39885439 3.49757157 - 1.65751064 0.25203333 --3.46719818 1.18220639 --2.99357577 -3.16124663 --1.14471780 0.55239411 --3.36327479 1.92596342 --0.96723958 0.38247028 --0.71793835 -0.83690618 --3.47132639 1.00440449 --2.70883368 -3.21232234 --0.69892095 0.77134636 --3.19510646 2.10437262 --1.24526750 1.15284470 - 3.01469649 -3.41576277 --1.77579395 1.21803825 - 3.14174458 2.87672548 --1.57637850 1.72308135 - 2.64091236 0.22563715 --1.55871862 1.12162052 --0.77785658 -3.44427645 --3.12093050 1.29240144 --2.46093850 -3.29855272 --1.12587833 2.75494312 --1.20636984 2.61896905 --0.81333690 1.19104489 - 0.93447922 -2.66202982 --1.08144695 1.17428097 - 1.42749784 -1.56479253 --0.93608979 3.17907427 --3.60500632 2.88646069 --0.28799884 0.93494352 - 0.34020232 2.62206455 --0.87624493 3.28174687 - 0.59173812 -0.62770442 --3.51020995 0.41363770 --2.81831334 -3.14928637 --0.66126961 0.84535254 --3.54911649 -0.92046621 --0.77624914 2.17532500 --3.35418118 -0.59526385 --0.60718371 2.37255513 --0.68235016 -1.00066915 --1.05716380 1.58890510 --0.84704916 -1.07036264 --0.79975125 3.25184349 --0.56948923 -1.07745145 --1.11462659 3.35988251 - 0.65659356 -2.95714580 --1.24708311 -1.41006877 --1.38399172 0.53570512 --0.24798575 1.18074218 - 0.42006862 -1.19648400 --1.14474462 0.67525487 --0.73909755 1.55821805 --3.34271356 1.21043578 --2.94308642 -3.55339819 --0.74346198 1.36011759 - 0.68581953 1.43846152 --0.86820552 3.52276325 --0.62399010 -1.67618661 --0.90403694 0.84582059 --0.93555405 1.83778965 --0.22485752 1.06317169 --0.56410019 -0.25611264 --2.82981630 1.10925094 - 3.03853208 -2.39762444 --2.90463801 2.10133918 --2.66939684 -3.26553866 --1.24823868 3.44409900 --1.58616536 -3.27669553 --1.34540777 2.73586548 --2.27580324 0.50298076 --1.17093265 0.95530296 --0.73899312 -1.58455737 --1.48932845 0.29777491 - 2.80306107 -0.71567688 --1.17351365 1.68166714 --2.71105666 -3.65384688 --1.21737334 0.63206435 --1.10995959 -1.69639610 --1.35813869 3.07430462 - 0.27935068 0.75771804 --2.81839822 0.18367497 --3.78724600 -2.49232342 --1.02260995 0.63663906 --2.71523346 3.54668103 --0.91208748 2.25430167 --1.31867016 -0.76012420 --2.62473319 0.70976930 --3.34046214 -3.78785196 --1.45292514 0.91246287 --3.20223657 1.73347124 --1.23395308 1.92249750 - 3.31213952 -2.32946201 --1.61475016 0.98712617 - 2.60218964 2.70612020 --0.88406330 0.51994267 - 2.78564066 1.13838192 --0.87867416 1.29804407 --1.81623138 -2.29182459 --2.66138781 1.13478598 --2.81212023 -2.22491562 --1.56182542 3.34279733 --0.65349034 3.01789410 --1.37538398 0.81124375 - 1.89244294 -3.39344278 --0.41294979 1.16525808 - 1.57193514 -0.50539643 --1.10057568 2.92704092 --2.81766229 2.17788994 --0.79719603 0.79779667 - 0.76123466 2.59927692 --0.44466177 3.65344456 - 0.81669781 -0.21810343 --2.26021979 0.96635443 --2.85160671 -2.90844213 --0.25738137 1.36952529 --2.43017863 -0.85834561 --1.67743159 2.79444651 --2.52893564 -1.18513039 --1.00466390 2.72420293 --1.71047302 -1.17637321 --1.18321918 0.56346090 --1.01618962 -1.05562747 --0.19889822 3.00621795 --0.65691724 -0.49258549 --0.67634037 3.05166669 - 1.21511087 -3.13419047 --0.89954416 -1.42735378 --0.82089644 0.45175772 --1.22154235 0.81702099 - 1.31283094 -0.87563777 --1.18919095 1.08774940 --1.33940523 1.69154643 --3.20722992 0.78085311 --3.53215342 -2.50343124 --1.18092972 0.22269638 - 1.18045132 0.59045112 --1.85642301 2.38056819 - 0.26093829 -1.16290091 --0.80709407 1.59064975 --1.58585996 2.78597053 - 0.08267842 0.66850780 --0.42697665 -1.41101264 --3.08014577 1.18271902 - 2.65099584 -2.57578103 --2.10369036 0.69541910 --3.71406484 -3.38322386 --1.24270829 2.60735206 --0.67679756 -3.09673491 --0.78814607 2.17270977 --3.05660113 0.79494904 --1.00494189 0.99211566 --0.70852120 -0.05879410 --1.29708759 0.64819337 - 2.38202674 0.40736614 --0.61212365 3.26459367 --1.99123810 -3.24982926 --0.65798271 0.87325381 --0.97303418 0.38048871 --1.35552453 2.56059269 - 0.63510970 0.64160016 --3.53007916 2.02829605 --2.87700700 -2.86349887 --0.36677818 0.56851906 --3.80588658 2.96706996 --0.41783447 1.25802059 --1.59674517 -1.10534924 --2.93346242 1.04233163 --3.01015046 -2.70732204 --0.82731128 0.77311007 --2.53373900 0.82841887 --1.43282135 1.59162200 - 3.24685506 -2.79372061 --0.86834668 0.76254409 - 4.25481311 2.33756720 --0.70803477 1.62014875 - 2.07660653 1.81242885 --0.34365724 1.07738505 --1.90331362 -2.66913283 --2.62753890 0.59029856 --3.25064225 -3.86550806 --1.58057490 1.87752986 --1.51355647 3.28155909 --0.34520871 1.11427036 - 1.96764454 -3.90418529 - 0.19637167 0.89840798 - 1.47770165 -1.46526897 --1.38984760 3.30348669 --2.84452144 2.98282584 --0.68293298 1.44450430 - 0.84909518 3.67449891 --1.65865522 4.23221363 - 0.86899561 -0.44544035 --3.66265486 0.36601521 --3.17182773 -1.98360834 --0.85355901 1.40129829 --2.91428621 -0.86437987 --0.03515939 4.23414704 --2.20218102 -0.50549291 --1.62144588 2.94741677 --0.99968740 -1.88543986 --1.55141157 0.30126636 --1.21837766 -1.09756067 --1.65869534 2.91480271 --1.66456284 -1.00022225 --0.39203614 3.51839465 - 2.43783574 -3.27238266 --0.59692361 -0.54710336 --1.10769519 2.07147126 --1.38890315 1.19754390 - 2.02310428 -0.34742750 --1.13298134 1.93375645 --0.90609241 0.37108578 --2.80307903 1.09939623 --3.32178059 -2.98955491 --0.81080886 1.34242698 - 0.74840826 1.64678774 --1.39998843 3.05682043 --1.06071811 -0.86665646 --0.61493445 1.34546786 --1.49347327 2.21132382 --0.69841214 1.86160822 --1.01618351 -1.27299191 --3.55930827 0.83076277 - 3.07049357 -3.09426111 --2.55607717 1.25500003 --3.10940946 -3.32220936 --0.67833355 3.36800814 --1.40298735 -2.74249037 --1.05012782 2.46869071 --3.16821987 1.37104769 --0.45394679 1.39482280 --0.72468704 0.16012961 --1.53542624 0.92424230 - 2.53177635 -1.61183292 --0.69389788 3.28279165 --2.68490452 -2.86311571 --0.58735584 0.48914945 --0.69770197 -0.85600247 --1.75442397 3.13413563 - 0.68300314 1.59913000 --3.52672871 0.79365007 --3.18706276 -3.11171202 --0.57599880 1.13181521 --3.89894380 2.80665669 --1.52349473 0.54833493 - 0.02254370 -0.73924268 --3.21907177 1.12458012 --2.64345688 -3.78470109 --1.51054201 0.97595158 --1.88407934 1.29652449 --0.49376930 1.51700193 - 3.32522812 -2.89985558 --1.30208619 1.10468707 - 3.40629249 3.03059081 --0.84457786 1.84102012 - 2.49218765 0.31536887 --0.01922397 0.39859934 --1.76662123 -3.14183591 --2.76091537 1.58370237 --2.23954031 -3.15642596 --0.41914104 2.25447877 --0.73619743 4.59697745 - 0.03153336 0.31133483 - 1.53183922 -2.78533965 --0.52121741 1.16439390 - 0.44364966 -0.92295486 --0.94583078 3.34453910 --3.75220410 3.32366463 --0.43105921 0.98151326 - 1.55746543 3.48163121 --1.07671591 1.91990314 - 1.38752518 -2.71973914 --2.46720139 1.04541650 --1.95509531 -2.43666981 --1.23939753 0.66616305 --3.69825670 -0.07878960 --1.44572487 3.36252810 --3.49379187 -1.58148397 --0.97841230 3.21226686 --1.80558154 -1.06015996 --1.67440134 1.32012879 --1.04100014 -1.11161915 --1.53999752 3.50423760 --0.74457545 -1.78614652 --0.85959314 2.54795737 - 1.25810999 -2.82745646 --1.08506087 -0.23669740 --1.14461026 0.73332567 --1.32801715 1.65276662 - 1.15539493 -0.67967213 --0.94760790 1.37696973 --1.72714544 1.23333338 --2.84560950 0.43466910 --2.72790705 -2.28741116 --1.80177333 1.80958334 - 0.48454240 0.72743853 --1.63513317 2.51399337 --1.08120337 -0.98728166 --0.90198722 1.05296489 --0.89382843 2.78955802 --1.40948875 1.35749497 --0.49693708 -0.74041709 --2.42745046 0.38833668 - 2.82621315 -2.98604025 --3.04242354 0.73832673 --2.92469247 -3.04929857 --1.55190149 2.50092450 --0.60631134 -3.05470864 --1.05912452 2.52991393 --3.25214124 1.14467614 --1.59386432 0.21613314 --0.33243109 -0.81157512 --1.07941536 0.36791851 - 3.15184127 -0.91927491 --0.13448490 3.18145009 --3.11596753 -2.93611756 --0.95028428 1.01054075 --0.58305403 -1.00707016 --0.93494674 3.07335767 - 0.89536412 1.15642877 --3.43393649 0.66517600 --3.33514577 -3.97976963 --1.55427954 0.81926751 --3.62958015 2.55979525 --1.01830685 1.65401529 --0.21299743 -0.23889749 --3.58027673 1.06871540 --2.11175973 -3.11885111 --0.94333664 0.88905920 --3.84475358 1.68930120 --0.56086713 0.67814994 - 3.69325084 -2.60180080 --0.88073293 0.51745428 - 3.04196092 2.38566581 --0.95425863 0.30677017 - 3.23520741 0.81119025 --1.76398039 -0.00108508 --1.71361429 -2.47420749 --3.12438758 0.91455674 --3.75921167 -2.75441446 --0.60047073 3.49522699 --1.06657650 3.01380323 --0.29329410 0.76895602 - 1.30053093 -3.49474742 --0.53725474 1.42194174 - 1.09583109 -0.74968954 --0.12421518 2.23990959 --2.29577191 2.78109543 --0.60444817 1.56221344 - 0.61742656 2.74556695 --0.54816274 2.73284478 - 1.30951736 -0.92768555 --2.80346595 1.10431395 --2.84434434 -2.51100976 --1.02587932 0.94801983 --3.49095673 -1.30169970 --0.52736016 3.58091177 --2.40493095 -1.18998131 --2.31662911 3.09130544 --0.97029824 -0.72891459 --1.35866716 0.67540817 --1.36396037 -1.22080738 --0.74191072 2.96794732 --0.78369689 -0.92995735 --1.56006594 3.79072598 - 0.99934734 -3.01974834 --1.13880933 -0.66816542 --1.58933776 0.67218214 --0.53946796 0.66518091 - 1.26218254 -0.72384629 --1.23281248 1.65211938 --1.92127560 1.48199873 --2.52917777 0.46374000 --2.84420878 -3.71434912 --0.96795752 0.86097447 - 0.99808412 0.34813137 --0.52309152 4.18739582 --0.62818073 0.18909749 --0.11836781 0.46952717 --0.31208311 3.73072497 --1.03021383 2.06749839 --1.19473852 -0.79221380 --2.74326838 0.59623004 - 3.42390808 -3.82113033 --2.54046783 0.35755837 --2.70988489 -2.94352301 --1.13341514 2.62896805 --1.06635974 -4.00344392 --1.84695671 3.88494902 --1.52409585 1.69733217 --0.99744550 1.55555851 - 0.07970624 0.10264288 --1.09620663 0.85852826 - 1.91127061 -1.21268521 --1.41444506 2.05634957 --3.43534669 -3.15938977 --0.51338319 0.82589421 --1.37748565 -0.84653907 --1.68253362 2.55746190 - 1.25685803 0.92463397 --3.19789431 1.14098352 --3.28365593 -2.84139572 --1.41524699 0.74275201 --2.13202409 2.86587645 --0.82921695 1.60747297 --0.72371611 -1.64683415 --3.82562566 1.90009875 --2.81530528 -2.82803255 --1.29164676 1.02276218 --1.90053250 1.01844047 --1.20213118 1.75551869 - 2.94581926 -2.35854528 --1.05871825 0.67466219 - 2.99926504 3.29645013 --1.45569040 0.64520079 - 3.11102783 0.22015249 --1.11140528 1.34519367 --1.00336665 -4.31024486 --3.83335279 0.45928212 --3.36112201 -2.79834871 --1.26919339 3.01603470 --0.93090653 3.94213246 --1.66837992 1.27153552 - 1.70795129 -2.84572441 --1.23213478 1.38036369 - 0.91344544 -0.83850456 --0.84444814 3.48145369 --3.22923377 4.26023410 --0.78367980 0.84976951 - 0.50740185 3.42363566 --0.74990501 2.89252877 - 0.98654313 -1.15097168 --3.75401239 1.14175915 --3.36002156 -3.28358135 --1.63173057 -0.19680186 --2.90156445 -0.01598211 --0.68895738 3.27003751 --2.87011064 -0.97969437 --2.18324345 2.12252227 --1.36697001 -0.92054614 --1.46568631 0.79727680 --1.05002430 -1.68621081 --1.13137774 3.19373880 --0.48120645 -0.41075576 --0.97227069 2.34507869 - 0.33787584 -2.56709093 --1.40890381 -0.68625568 --0.38823460 1.00230353 --0.89143056 0.93143506 - 0.69660820 -1.00982020 --0.58222126 1.93856714 --0.33297561 0.96066862 --2.67283192 1.24094057 --3.31095059 -3.01065512 --1.15876132 0.10806387 - 0.36179074 1.00744132 --1.23378446 2.37690906 --0.66627609 -0.81225637 --0.89333885 1.46558470 --1.96071496 3.46316896 --1.92867155 0.95058131 --1.01614228 -1.29616093 --3.22874346 0.48170754 - 1.97421403 -2.96190603 --3.30878923 0.56163314 --2.52290020 -2.51137775 --0.99598353 3.50629574 --1.21924249 -2.90364820 --0.45265425 2.66905984 --2.58366164 1.73511381 --1.72318534 1.89612939 --0.73032011 -0.44626415 --1.00893525 0.93464990 - 2.18703598 -1.31306490 --0.80601688 3.22947573 --3.77216355 -3.28617861 --1.03383777 0.73597856 --1.37291473 -0.45398364 --1.68684417 3.51515461 - 1.29796623 1.70736256 --3.01246403 0.92039236 --2.15941331 -2.04527435 --0.17545600 0.91661734 --3.34657402 2.38140053 --0.98144005 0.27926866 --0.48165574 -1.10815834 --3.12002211 1.32948539 --2.61860820 -1.81307309 --1.08516709 1.64748288 --2.56482460 1.01261071 --1.30236767 1.21756325 - 3.27175623 -2.76080872 --1.84408489 1.15226735 - 3.69317331 2.61229665 --1.26864648 1.27039696 - 1.76872917 1.04690379 --1.59782909 1.10528089 --1.18068907 -4.25948714 --3.03075513 0.62029498 --2.54512472 -3.72392913 --0.96644614 3.77538634 --0.77768108 3.19851692 --0.92891152 2.11580619 - 0.55491487 -3.66496478 --0.70753320 1.16770837 - 0.81873123 -0.83634718 --1.82321811 2.62403718 --3.06577345 2.56853680 --0.54611203 0.67078949 - 1.97630067 3.37597805 --1.20187450 3.76042243 - 0.54550116 -1.02375818 --2.66511970 0.78227467 --3.16624953 -2.95051095 --0.79646436 0.77092931 --3.46409078 -1.14297243 --0.48546335 3.21358097 --3.11169568 -0.79398351 --0.48873413 3.44980570 --1.25085001 -1.41104059 --0.64698671 0.30222942 --1.49733360 -0.85902769 --0.12888546 3.06405192 --0.58882897 -1.06703006 --0.38712411 2.79836431 - 1.25535758 -2.55209119 --0.03952546 -0.74314283 --1.24906460 1.36870730 --1.07395764 1.12094716 - 1.11021624 -1.10757014 --1.43614853 1.19285445 --0.81933088 1.12381954 --2.95586645 0.67873214 --2.74650347 -3.16487162 --0.91512650 1.57873433 - 0.25050427 1.87482324 --1.70514492 3.13845069 --0.27048648 -0.46690975 --1.27110053 0.35296471 --0.47714792 3.74106884 --0.18793911 1.14977836 --2.11742930 -1.24763696 --3.46292650 0.35800086 - 2.82292803 -3.50986624 --2.58636772 0.56037371 --2.94730531 -3.33489723 --1.43802867 2.53482573 --0.79004796 -3.42532291 --1.63744059 3.09346001 --2.93534511 0.56377694 --1.69045804 0.88813902 --1.14115697 -1.31393830 --1.94541671 0.49052263 - 2.50133632 -1.52418202 --0.92436421 3.12671932 --2.67722185 -3.16654122 --1.43111353 1.19114551 --0.46800252 -1.68464754 --1.02137724 2.94645920 - 1.36450604 0.71190537 --2.99388029 0.85304697 --1.87634912 -1.73504041 --0.77942843 0.38596171 --2.85501315 2.99929606 --0.42351104 1.97788149 --1.70576538 -1.80273649 --2.86782708 0.52268664 --3.38564634 -2.88588640 --0.97210464 1.68706318 --2.55980951 1.02190685 --1.61304357 1.06375609 - 3.02602174 -2.54469519 --0.79049805 1.24928091 - 2.32897974 3.03725480 --0.88900094 0.96265572 - 3.28638783 -0.24887147 --1.72787236 0.68515205 --1.18295123 -3.16247798 --2.88018796 0.30545479 --2.50836874 -3.35720336 --0.86593103 3.19218149 --0.46086906 3.59346387 --1.62822387 1.20956859 - 1.72734172 -2.81395095 --1.62783161 0.44290379 - 1.13406241 -1.39222714 --1.71276053 2.67053657 --2.48454039 2.77468450 --1.11802949 0.44148104 - 0.61143872 3.38927490 --1.30204536 2.20046217 - 1.36089420 -0.81883051 --4.21798380 0.42390045 --2.39954991 -3.55991226 --1.19473762 0.91639954 --3.15310520 -1.87366155 --2.04515170 2.76740189 --3.08454376 -1.49027960 --1.24925266 3.28666854 --0.74555631 -0.32495620 --0.54913066 0.42081651 --1.14160105 -0.05459948 --1.67992079 2.79107180 --1.30209019 -1.36052400 --0.48305461 3.32864326 - 1.43577893 -2.95110510 --0.73691288 -1.51353504 --0.44262328 1.37829990 --1.41744005 1.03561322 - 1.10284327 -1.10390676 --0.62983711 0.40545241 --0.50127087 1.28823311 --2.65660541 0.65320317 --2.78618856 -2.60510472 --1.02966445 1.67300053 - 0.60445555 0.80069688 --0.55263763 3.01563225 --0.91052214 -0.98659420 --1.29262082 1.41023681 --0.88370200 3.01193981 --0.89116615 0.44703631 --1.24825808 -1.61056630 --3.59299159 1.65824858 - 3.67747359 -3.38300755 --3.07084480 0.73832719 --3.26133486 -3.82989214 --1.18878323 2.80287387 --2.19496073 -2.42274767 --0.91085965 3.40549912 --2.39925905 1.84605263 --1.19339514 1.13560705 --1.03327168 -0.39799977 --0.46829236 1.01570350 - 3.49496081 -0.39178783 --1.01899390 3.44037847 --3.28145142 -2.72281826 --0.13900332 1.06369489 --0.29660422 -0.67004374 --1.25721959 2.78777430 - 1.02081211 1.07511059 --3.07306101 1.18279331 --3.33558079 -2.79991191 --1.42026960 0.86447736 --2.72704239 2.12380746 --0.94913604 1.35876753 --1.37578720 -1.27911208 --2.86756980 1.11002439 --3.63755825 -3.54204944 --1.46132655 0.43026748 --3.35792399 1.18699727 --0.96614651 1.35653119 - 2.75488845 -2.97319275 --0.59270840 1.29625118 - 3.44664922 2.78101588 --1.56540042 0.92051495 - 3.77333089 0.53226406 --0.50818529 1.00357891 --0.39077968 -3.05649933 --2.75978686 0.50003728 --2.94829970 -2.46060298 --1.67386144 3.10318276 --1.57139030 3.63298483 --1.76408125 1.09767061 - 1.19038040 -2.60764203 --0.38467300 0.72893632 - 0.93607591 -0.79783047 --0.87252425 3.00510962 --3.12055914 3.77147965 --1.14659593 0.88595981 - 1.38876859 2.44879982 --1.75087278 3.55877139 - 1.36377379 -0.96226050 --2.85939325 1.11614650 --2.60239369 -3.80178621 --0.56918324 1.40138350 --3.69934539 -0.78603339 --0.90173433 3.13456548 --2.77496408 -1.18195500 --2.06457597 2.71618120 --0.80328712 -0.50656209 --1.12330694 1.22326885 --2.17570563 -0.44108158 --0.27516161 2.92410078 --0.11753307 -0.93542439 --0.66983533 3.17462056 - 1.51366795 -3.02396719 --1.04334787 -0.31473269 --0.83868963 0.28190901 --1.58744594 1.70892701 - 0.89728001 -0.96007839 --0.31736894 0.42890573 --1.23183708 0.31384880 --3.55361742 1.22798344 --2.91479784 -3.07019886 --1.17459593 1.48332880 - 1.34914169 1.37778428 --0.43286272 3.03307497 --1.29927972 -0.32088981 --0.48776849 0.27337415 --0.97422208 3.57163519 --0.41051517 2.06339717 --0.49549172 -1.60115080 --2.84743586 1.52331745 - 2.47433179 -3.20422413 --3.93520088 0.56617780 --3.00132122 -3.86531845 --1.70119289 3.36240599 --1.10066417 -3.48751242 --1.58502592 2.76663775 --3.00027379 0.53804162 --1.11828871 1.29065046 --0.76178945 -1.47087130 --2.13457068 1.74958795 - 2.12391963 -1.03559456 --0.68716892 2.59324570 --4.20052272 -2.85845304 --0.84717538 0.30158030 --0.31945260 -0.01142133 --1.58864530 2.53435757 - 0.93282016 0.98939842 --2.98217023 1.32332293 --2.05046592 -3.15309951 --0.08759670 1.53806999 --2.62496862 2.86022639 --1.41426793 0.62934583 --1.73629722 -1.17311850 --2.66206706 0.78134117 --2.70095221 -2.91318890 --0.94163459 0.25362069 --3.74420892 1.56215423 --0.79921520 1.05439866 - 3.70761832 -2.27847122 --1.48341681 0.86940607 - 3.74568952 2.26663381 --1.47534161 0.18198914 - 3.17397803 0.81936626 --0.86924840 1.23410970 --0.37814972 -2.41917087 --3.12323583 1.67275492 --3.03722448 -3.30534331 --0.60457456 2.57928058 --0.47625757 2.42578725 --1.01215705 1.89011992 - 0.81517702 -2.40427809 --1.43376803 2.26551777 - 1.82867474 -1.57514190 --1.27350263 3.99680917 --2.86668951 2.73129706 --0.49994095 1.27023888 - 0.94949841 3.87706169 --0.87505900 2.85476535 - 1.41085828 -0.80826247 --1.74699209 1.05432117 --2.67810945 -2.53009755 - 0.14663665 1.23967176 --3.90583536 -1.40067439 --1.13712221 3.25861969 --2.08842088 -1.42158505 --0.23251019 3.25736426 --0.07611082 -0.36853841 --1.32567716 2.38057680 --1.30787666 -1.68830063 --0.27085315 3.98366164 --0.17842260 -1.04086946 --0.85051005 1.75566025 - 0.57925147 -3.44694964 --0.71111619 -1.15906827 --1.92767618 0.48323590 --0.25436565 1.03014078 - 1.27945120 -0.91861338 --1.30231654 -0.03729450 --1.69465883 1.18102860 --3.25925836 0.43929145 --2.84598644 -3.60200308 --1.30276378 1.31119121 - 0.50104521 0.78470739 --0.61337498 3.59029336 - 0.06272182 -0.59128810 --1.27026504 1.09808784 --1.31385902 3.87806794 --0.82747909 1.10160366 --1.13775002 -0.80570098 --3.21411624 0.68627977 - 2.92185003 -3.41589233 --3.59928158 1.35013745 --2.26643642 -1.87424286 --1.63421561 3.32380965 --1.44937616 -2.99556201 --1.69916834 3.49723057 --2.99097431 0.68646375 --0.84725023 0.71395752 --1.31795515 -0.88251761 --0.93993542 1.42013862 - 3.55864999 -1.54402616 --0.56274108 2.92814607 --3.00414237 -3.03121494 --1.41400958 1.24492792 --1.33320661 -2.54808963 --1.43043828 3.09402520 - 1.16934519 0.80712708 --2.87829518 0.55500385 --3.08650163 -3.04041489 --1.75252634 1.60426815 --2.41266126 3.49665468 --1.14479891 0.85919494 --1.06646439 -1.23384035 --2.21809090 1.78885517 --2.92742701 -3.37378953 - 0.51559264 1.27147939 --3.33790998 0.24358433 --1.33287819 1.13380600 - 3.56577118 -2.87657954 --1.06832319 0.68900872 - 3.62160585 2.87074706 --0.95336756 1.00898397 - 3.77501750 0.83326499 --0.56250996 1.20159829 --0.94310648 -4.18971412 --4.33097682 0.25158697 --2.37995578 -3.73493772 --1.16492688 3.30033701 --1.86543851 3.19690108 --2.18505336 1.52591441 - 0.32993158 -2.59265783 --1.29245150 0.30651749 - 1.16396205 -2.05369641 --0.96660836 3.48057973 --2.93359213 2.82469011 --1.48495523 1.06470412 - 0.47538683 3.14390370 --0.63414263 3.41685007 - 1.02993042 -0.61033565 --2.79161486 1.44257047 --3.08143330 -3.56655758 --1.19338042 0.52923366 --2.57300531 -2.37756050 --0.55420179 3.31788369 --2.97885759 -1.31687779 --0.52859388 3.95192186 --0.75536020 -0.85678215 --0.64152707 0.84889675 --0.52859435 -0.82892176 --1.58849751 3.37859436 --0.77554733 -0.84740070 --0.90575652 2.90313407 - 1.12650467 -3.44282365 --0.65109205 -1.50783843 --0.66243250 1.47441240 --1.32328891 1.85986767 - 0.49929442 -1.70964447 --1.13568291 1.34821289 --0.93911375 1.88151169 --2.45300371 0.28463091 --2.19446063 -3.62530030 --1.18741839 1.71144002 - 1.47130919 0.78721346 --1.65413613 2.32644194 --1.88567114 -1.48786065 --0.58810885 1.23167797 --1.60775561 3.16385531 --1.66348546 0.87468190 --0.34965557 -1.87224813 --2.66276272 0.85646375 - 2.63834372 -2.15321962 --2.96347641 1.19667441 --3.02921414 -3.41722754 --0.18706093 3.58210977 --1.08934744 -2.95758555 --1.33872211 3.77146532 --2.50103980 1.19220849 --1.76530490 1.07725017 - 0.16601282 -0.74061656 --0.27021215 1.24764594 - 2.83161739 -1.28861029 - 0.19375522 3.84008227 --2.80538894 -3.35222896 --1.16496540 0.86279962 --1.55409429 -1.09562878 --1.17282718 2.58415663 - 0.84331060 0.61989226 --3.27258449 1.11994666 --3.61010967 -3.13167558 --1.90731026 1.26917703 --2.76612717 3.17747953 --1.48761587 0.94308515 --0.10553116 -1.22900155 --2.70446101 0.98952789 --3.09244990 -1.86821235 --1.76989480 0.90631877 --3.08502136 1.87449933 --0.57087208 0.94840223 - 2.99697198 -4.04010881 --0.93732620 0.80675384 - 3.11143362 2.51918610 --0.63689840 1.00327652 - 3.77274538 0.75295167 --0.60265880 1.68293060 --0.52846505 -3.57583768 --2.54148293 0.47130149 --1.91572136 -3.66884045 --0.12587697 2.41597502 --1.02109559 2.96238582 --0.94863896 1.11027046 - 0.42178700 -2.75184015 --1.40540802 1.79066931 - 2.03698374 -0.97870873 --0.73413004 2.37528685 --2.84890407 3.58102699 --0.93470157 0.97721049 - 0.77969992 2.91729328 --0.61545282 3.73879070 - 0.47686825 -1.43723551 --2.10074634 0.93668924 --3.00369012 -3.50791728 --1.61137031 1.21306806 --2.49196004 -0.60599375 --0.95739571 3.49165805 --2.50977448 -0.49563091 --0.73449903 3.20033727 --0.62132968 -0.00006437 --0.55759752 0.73829331 --1.43335760 -0.56571291 --0.92661133 2.27193811 - 0.05350682 -1.18055169 --0.65949945 3.07456785 - 1.04308179 -2.53721877 --1.53882224 -0.49016060 --0.44780974 0.75112017 --1.95044069 0.71571527 - 1.94740096 -0.27565309 --0.74364238 1.13352270 --0.84645339 0.76063438 --3.17270307 0.99005710 --2.88593317 -2.65905631 --1.32829126 0.60957261 - 1.27649428 1.16538176 --1.08829527 1.40168455 --0.75093099 -1.52465373 --0.60603198 0.85494101 --1.34167839 2.38720330 --1.23464071 1.60009812 --0.64728013 -0.65016250 --3.01600635 0.84694993 - 3.07922402 -2.40566463 --3.06667861 1.04339569 --2.58421215 -3.85706244 --1.56521449 2.67596879 --0.52956937 -2.46227049 --0.20320610 2.54734872 --2.69513728 -0.06093110 --1.01734227 1.31121390 --0.68502118 -1.37686540 --0.43972343 1.27286293 - 3.80629260 -0.30983352 --1.02472742 3.45889892 --2.20584078 -2.74831866 --0.53247042 1.42718874 --0.63835559 -1.32480411 --0.88058066 3.43266408 - 0.91509573 0.88499619 --3.18301477 0.39869763 --2.80742090 -3.69050577 --1.47613856 0.62215573 --2.34850283 3.28975819 --0.68798551 0.12635818 --1.72316957 -1.01212552 --2.93120482 1.48242238 --2.75844770 -3.78411343 --1.26347196 1.45444346 --3.27789105 1.62168816 --1.36433593 1.08201176 - 3.71118694 -1.78047080 --0.94958884 0.63193988 - 2.16368333 2.99328329 --0.95957926 0.96186068 - 2.92261879 1.95172863 --1.45166298 1.66309713 --1.42517007 -2.24774817 --3.30015162 0.88796041 --3.42025848 -2.52046840 --1.89531019 2.34030921 --1.28397330 3.88243639 --0.67308193 -0.32746328 - 1.28239721 -2.04970545 --1.24818686 0.99671204 - 1.25335856 -1.18471072 --0.37295782 3.26601554 --2.78616202 2.76091058 --2.29461531 1.92509041 - 0.51499019 2.04401609 --0.51883198 2.93511001 - 0.91171004 -0.56399305 --2.59030623 0.68929899 --3.43994995 -2.75104024 - 0.07907680 1.40416498 --2.64795789 -1.44863624 --1.13048728 3.62154577 --4.18985820 -1.13798269 --1.87161892 2.18798560 --0.71097377 -1.14897713 --0.82091902 0.89473989 --1.51931869 -0.02898824 --1.30018538 3.32181874 --0.34621370 -1.07306139 --0.47811764 3.70034644 - 0.58615042 -3.29423403 --1.79692191 -1.51767962 --1.42107478 0.67527425 --1.37635520 1.07861918 - 0.15694916 -1.26206009 --1.43890804 2.18782954 --1.02360053 0.86859389 --3.76067501 -0.08691413 --3.34238779 -3.25004560 --0.75932631 1.50621212 - 1.00746929 0.93951737 --0.91643378 2.49179268 --0.82817505 -1.17968972 --2.00017735 1.48327587 --1.27241871 3.44855395 --1.23016107 0.31584779 --0.70641524 0.07089906 --3.57134658 1.66257906 - 3.00674614 -2.57961764 --2.84575530 1.13935333 --2.59865561 -2.53144501 --0.48911631 2.23228960 --1.28798827 -3.48781441 --0.12125029 3.77351881 --3.15292473 1.25608008 --1.23048671 1.07829803 --0.80710028 -0.55468051 --0.26772952 1.19386611 - 2.81064186 -0.80562348 --0.60119275 2.78178337 --2.81755255 -3.43727723 --0.61188877 1.98729632 --1.83397940 -0.67371639 --1.17213704 3.41402545 - 0.76501874 1.32337649 --3.43891729 1.42693949 --3.03687068 -2.70493786 --1.56626212 0.96815940 --2.41313959 3.05830765 --1.26116016 0.94857492 --1.14272566 -1.68646727 --3.85564782 0.36794450 --2.57182687 -3.71995482 --0.99130424 0.49287350 --3.26488623 0.82495699 --0.84123795 1.43168488 - 3.16980229 -3.31668161 --1.08325181 1.90227435 - 3.09736101 3.25045278 --0.72136925 1.81439171 - 2.80680703 -0.22972579 --0.72500244 1.03580021 --1.49865762 -2.85234777 --3.44193545 1.70781046 --3.65796861 -3.74738354 --1.13077204 2.74001638 --1.02238865 2.60846762 --0.26205699 1.40793522 - 0.01058189 -3.73588144 --1.12862720 0.65680659 - 0.38973715 -1.85212819 - 0.07321127 3.26601685 --3.39806569 3.14056402 --1.02388826 0.58002982 - 1.29465408 2.72861454 --0.98846421 3.37093120 - 1.15791600 -1.27913530 --2.48915886 0.54990297 --2.42194912 -3.76393726 --1.43505213 1.11686879 --3.27416857 -1.42348479 --1.60744274 3.43153524 --3.62509921 -0.70390585 --0.71389098 3.61446731 --0.69401627 -0.61214832 --0.59100657 0.86932414 --0.97503248 -1.16826674 --1.22472405 3.31329106 --0.81094332 -1.35393680 --0.96294133 3.27478702 - 0.91751457 -2.96328897 --1.55617309 -1.06656762 --0.63946011 0.55750007 --1.37146525 0.63513571 - 0.30060531 -1.50968031 --1.09199255 1.74300263 --1.27938081 0.25082160 --2.97859349 0.60077207 --2.33186398 -3.63348126 --0.72716245 0.49614946 - 0.43064078 1.48515445 --0.65704140 2.32570970 --1.07013774 -1.59276413 --0.16112848 1.95985577 --1.29460217 3.72639149 --1.02694716 -0.36351286 --0.29385118 -0.55839824 --3.23908585 0.62522351 - 3.25620363 -3.60254028 --3.42219496 0.98945677 --1.94614732 -2.51184522 --2.17122318 3.09628517 --1.28262612 -3.24436614 --1.22609125 2.91561143 --3.65132496 0.60597059 --1.51738914 0.60413789 --0.82584840 -1.40972027 --0.55736914 2.18130685 - 2.97573017 -0.42634849 --0.93577465 3.92625327 --3.50759170 -2.85320354 --1.36777650 0.66606559 --0.95007800 -0.13445505 --1.13298125 2.21418134 - 0.65245329 0.93321755 --3.55181834 1.16271050 --3.00101160 -3.31601530 --1.44763310 1.29477838 --2.28359417 2.82310832 --0.39045709 1.50558915 --1.75070582 -1.84599949 --3.83615314 1.01763733 --2.34639011 -2.92986445 --0.23218147 1.22406643 --3.01013043 1.12480471 --0.90787175 0.74947213 - 3.03210387 -2.41823352 --1.11830490 1.91825679 - 2.83700056 3.58701345 --1.10337737 0.56237129 - 3.03864366 0.46922332 --1.54664548 0.47383123 --1.29821973 -2.62921776 --2.07794424 0.72429930 --4.22882358 -2.38637514 --0.62248975 3.85426192 --1.48392153 3.48346832 --0.63337285 1.15045432 - 0.54436935 -3.50382702 --0.38782294 2.10152103 - 1.28635415 -1.26974628 --1.30354114 3.26555155 --3.35280455 3.65153659 --1.56568671 1.49842912 - 1.55429621 2.96910603 --1.17185152 3.86590734 - 0.73969761 -1.03069191 --2.03052562 0.89943003 --2.72758656 -2.63091638 --1.58364574 -0.00588501 --3.12722632 -1.03858898 --1.33017997 3.06142692 --3.27267389 -1.50591801 --1.90973696 2.76531525 --2.45772485 -1.08742866 --0.44144426 1.16312597 --1.72271902 -1.55492037 --0.80721697 2.94308914 --0.55390426 -1.02079953 --0.07438912 3.08562932 - 1.55780829 -3.50961841 --0.20915795 -0.71629409 --0.83208583 1.43746471 --0.01654772 0.82437987 - 1.55690811 -1.55217637 --0.92065534 0.93327392 --0.40778204 0.86534328 --3.10993524 0.44086045 --3.32045237 -3.16393273 - 0.02078002 0.72340412 - 0.50326230 0.82067820 --0.35143717 3.09319605 --0.93431135 -1.08290838 --1.92725722 1.36908537 --1.23671625 3.05712458 --1.05389966 2.08262827 --0.98813468 -1.46383117 --3.22071909 1.20517807 - 2.88092420 -2.90163914 --3.22908561 1.05179778 --2.51206283 -3.30518576 --0.58741952 2.40008190 --1.27742995 -2.79756869 --1.00046722 3.13575659 --3.74071981 0.99248122 --1.16907479 0.88615634 --1.22925241 -1.54952448 --1.10582761 0.50204716 - 2.76057051 -0.56196091 --1.34058810 3.39056721 --2.59028569 -3.00728647 --0.04172703 1.17712789 --0.67551804 -0.38677402 --1.94780642 3.36495439 - 1.00341307 1.18934856 --3.40315370 1.20584926 --2.72240266 -3.68288016 --1.15005108 1.25119103 --1.74945968 3.00767839 --1.01716503 1.31367252 --0.87681436 -0.97334809 --3.25660295 1.31110876 --3.79322746 -2.27389012 - 0.43787758 0.57967714 --3.60190665 0.03260039 --0.89997618 1.17022958 - 3.22461494 -3.55815089 --1.39987774 0.13264132 - 2.56650785 2.89413382 --0.89389309 1.10321296 - 3.28008361 0.87113333 --1.42769703 1.20482484 --0.62317333 -2.44398442 --3.15903545 1.70876059 --3.67621438 -3.08477235 --1.84680753 3.62272720 --1.09698362 2.57832563 --0.39844589 0.86820245 - 1.04464360 -3.24423834 --2.23180277 1.58329563 - 1.01179629 -0.76467531 --0.91945200 3.29424113 --3.06851090 3.24879635 --0.69440542 0.64403843 - 1.57011325 3.65510831 --0.87825614 2.76055931 - 0.09659313 -1.39418680 --2.34072680 0.13057017 --3.59338712 -2.29708769 --1.15615947 1.06936043 --2.76486150 -1.44223951 --1.95259356 3.16285723 --2.10530601 -1.38679860 --1.26290919 2.67192823 --0.73339200 -1.67693394 --1.80093311 1.08375433 --0.55027030 -0.80593523 --1.34235142 2.02272453 --1.61721020 -0.10828825 --0.69626891 2.43505876 - 1.70128436 -3.25939404 --0.55907012 -0.57687371 --1.59584831 1.18952732 --0.48758766 1.42532762 - 1.64828497 -1.33380016 --1.32721439 1.51848811 --0.85703416 1.14208865 --2.85787656 1.57620047 --2.54896843 -2.80876322 --0.69379785 1.17906783 - 0.27715499 0.45500356 --0.41199733 3.10987745 --1.31995119 -1.69340370 --1.26481875 1.22172328 --1.42061042 2.75102434 --1.34732331 1.09651120 --0.22445345 -1.18135570 --2.90649623 1.51324098 - 2.97375351 -3.27428588 --2.59425616 1.17027952 --2.32644712 -2.70472600 --0.30707553 3.78318235 --2.01003210 -2.54887010 --0.72432338 3.54739848 --2.88238170 1.61241918 - 0.45483629 1.85738376 --0.88943513 -1.27245601 --0.85984320 1.49989460 - 3.92392466 -0.77563761 --0.95224286 2.89330320 --1.97052334 -2.56546627 --0.38216776 0.28813604 --1.56922551 -1.04603820 --1.14811046 2.91639859 - 1.60429532 0.70596108 --2.76502663 0.40586603 --3.18805850 -2.55136548 --1.04110607 0.40456963 --3.32989584 3.15420144 --0.50100327 0.46742964 --0.65157890 -0.54453251 --2.53854133 1.57470168 --3.48142419 -2.53846410 --0.98620475 0.77441902 --2.97807469 0.60554179 --1.41129318 0.92479305 - 3.84787863 -3.35518632 --1.76201936 1.57132973 - 2.95637883 2.54648222 --0.94158371 0.42028218 - 3.01047283 1.64517416 --0.57173885 0.92759762 --1.14682957 -1.86056002 --3.37681878 0.02544065 --3.27050756 -3.26312896 --1.05381942 2.92219077 --1.16601223 3.26573092 --0.98199549 0.09341247 - 1.29789232 -3.07395670 --1.07961852 1.31649064 - 0.71492173 -1.24452470 --1.72954450 3.02006048 --3.21953425 2.75934285 --1.37523011 0.84235579 - 0.92732203 2.40214286 --0.90723365 4.11394450 - 1.22220708 -1.32994576 --3.36769149 1.55847837 --3.06537314 -2.26690906 --1.06586832 1.25442935 --1.65357191 -0.43809916 --0.83978204 2.55332579 --2.20850700 -1.16457051 --1.20993494 2.64814895 --1.10016541 -0.68462558 --0.50116611 0.45875549 --0.67068966 -0.74529256 --0.72567869 3.80928687 --1.67182192 -0.42626175 --1.35545759 3.27678653 - 1.41480411 -3.21016413 --1.01982572 0.09594533 --0.80014662 0.66412159 --0.90552880 0.60264496 - 0.24118381 -1.09503614 --1.57162945 0.54532503 --1.02540691 0.13436487 --3.52295481 0.57690693 --3.11373703 -2.93846825 --0.96930961 1.15483898 - 0.49076573 1.01733623 --1.47637919 3.12338740 --0.83258361 -1.06429328 --0.82547552 1.64206414 --0.88388573 3.70417005 --1.32220233 0.01600109 --0.98308202 -0.59469673 --1.86426725 1.03311045 - 2.82417872 -2.63811193 --3.60789326 0.76098849 --3.03190310 -3.41159461 --0.95194205 3.33775301 --0.89045971 -3.42263806 --1.61829843 2.90569783 --3.16113310 0.70948487 --0.51124049 0.27037060 --1.27783015 -0.75101719 --0.79534773 0.24612839 - 2.99624644 -1.17740439 --1.00937581 3.07136081 --1.76073295 -3.26968021 --0.87055246 0.85152107 --1.50339312 -1.15238612 --1.47145206 3.62941497 - 0.95033013 0.29456086 --3.08828188 1.25543018 --2.50911982 -3.55338933 --0.82285722 1.17169477 --3.16235100 2.22904104 --0.29422787 1.11351274 --0.58778134 -1.66915478 --3.32987144 0.37319037 --2.98208507 -3.87076593 --1.42431130 1.07123418 --2.49848388 0.95236758 --1.10071269 1.41122296 - 3.14120984 -3.78091499 --1.10410434 0.58500003 - 3.00782061 3.29532702 --0.94824003 0.99482504 - 2.09788758 0.48690773 --1.90697975 0.95983548 --1.13069015 -3.23276076 --3.25788983 0.29046140 --2.63959157 -3.12181424 --1.35181526 2.60573758 --0.21088905 3.27069499 --0.98108202 1.19912633 - 0.72596017 -2.15412870 --2.01061425 1.07215794 - 1.01969921 -1.17838064 --0.82580801 3.84353701 --3.05903236 2.88451167 --1.33939482 0.22274022 - 0.77398478 2.02028879 --1.41176621 2.46682078 - 0.64192123 -1.25883733 --2.74661783 1.41483660 --2.78102938 -4.09269633 --0.61386357 0.74438457 --2.47067352 -1.64292658 --0.75136373 2.13139270 --3.76045667 -1.10773047 --1.53664955 2.69333971 --1.63909989 -1.79411687 --0.86986736 0.69937540 --1.28652254 -0.48617979 --1.47391358 2.34856991 --1.21896794 -1.47431092 --0.78955192 3.71869355 --0.09915423 -2.94746732 diff --git a/QAM/OLD/old2/constellation_ref.dat b/QAM/OLD/old2/constellation_ref.dat deleted file mode 100644 index ae1078e..0000000 --- a/QAM/OLD/old2/constellation_ref.dat +++ /dev/null @@ -1,16 +0,0 @@ --3.00000000 -3.00000000 --3.00000000 -1.00000000 --3.00000000 1.00000000 --3.00000000 3.00000000 --1.00000000 -3.00000000 --1.00000000 -1.00000000 --1.00000000 1.00000000 --1.00000000 3.00000000 - 1.00000000 -3.00000000 - 1.00000000 -1.00000000 - 1.00000000 1.00000000 - 1.00000000 3.00000000 - 3.00000000 -3.00000000 - 3.00000000 -1.00000000 - 3.00000000 1.00000000 - 3.00000000 3.00000000 diff --git a/QAM/OLD/old2/plot_const.plt b/QAM/OLD/old2/plot_const.plt deleted file mode 100644 index 176aa1b..0000000 --- a/QAM/OLD/old2/plot_const.plt +++ /dev/null @@ -1,16 +0,0 @@ -set terminal qt size 600,600 title "Diagramme de constellation" -set xlabel "I (In-phase)" -set ylabel "Q (Quadrature)" -set grid -set key off -set pointsize 1.5 -set xrange [-5:5] -set yrange [-5:5] - -while (1) { - plot \ - 'constellation_ref.dat' using 1:2 with points pt 7 ps 2.5 lc rgb "red", \ - 'constellation.dat' using 1:2 with points pt 7 ps 1 lc rgb "blue" - pause 0.15 -} - diff --git a/QAM/OLD/old2/qam.c b/QAM/OLD/old2/qam.c deleted file mode 100644 index ce830ef..0000000 --- a/QAM/OLD/old2/qam.c +++ /dev/null @@ -1,226 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat, FILE *fp_constel) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - - if (fp_constel) { - fprintf(fp_constel, "% .8f % .8f\n", creal(r), cimag(r)); - fflush(fp_constel); - } - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { - int errors = 0; - for (int i = 0; i < nb_bits; i++) { - if (bits1[i] != bits2[i]) errors++; - } - return (double)errors / nb_bits; -} - -int main () { - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - //int nb_bits = 1000; - //int nb_symbols = nb_bits / qam.k; - - //uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - //for (int i = 0; i < nb_bits; i++) { - // input_bits[i] = rand() % 2; - //} - char* texte = "Vif juge, trempez ce blond whisky aqueux"; - int nb_chars = strlen(texte); - int nb_bits = nb_chars * 8; - int nb_symbols = (nb_bits + qam.k - 1) / qam.k; - - // Conversion du texte en bits - uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - for(int i = 0; i < nb_chars; i++){ - for(int b = 0; b < 8; b++){ - input_bits[i*8 + b] = (texte[i] >> (7-b)) & 1; - } - } - - // Conversion en symboles - double complex* symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits, nb_bits, symbols); - - // Modulation - int total_samples = qam.N * nb_symbols; - double complex* s = malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne - double snr_dB = 5; // SNR en dB - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - add_noise(s, total_samples, sigma); - - - FILE *fp_ref = fopen("constellation_ref.dat", "w"); - int sm = (int)sqrt(qam.M); - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - fprintf(fp_ref, "% .8f % .8f\n", creal(qam.constellation[i][j]), cimag(qam.constellation[i][j])); - } - } - fclose(fp_ref); - FILE *fp_constel = fopen("constellation.dat", "w"); - - // Démodulation - uint8_t* output_bits = (uint8_t*)malloc(nb_bits * sizeof(uint8_t)); - demodulate(&qam, s, nb_symbols, output_bits, fp_constel); - - fclose(fp_constel); - - // Reconstruction du texte - char* texte_recup = malloc(nb_chars + 1); - for(int i = 0; i < nb_chars; i++){ - char c = 0; - for(int b = 0; b < 8; b++){ - c |= output_bits[i*8 + b] << (7-b); - } - texte_recup[i] = c; - } - texte_recup[nb_chars] = '\0'; - printf("Texte original : %s\n", texte); - printf("Texte demodulé : %s\n", texte_recup); - - // Calcul du BER - double ber = compare_bits(input_bits, output_bits, nb_bits); - printf("Taux d'erreur blind QAM: %.4f\n", ber * 100); - - // Libération mémoire - free(input_bits); - free(output_bits); - free(symbols); - free(s); - free_constellation(&qam); - - return 0; -} diff --git a/QAM/OLD/old3/constellation.dat b/QAM/OLD/old3/constellation.dat deleted file mode 100644 index e9d2a47..0000000 --- a/QAM/OLD/old3/constellation.dat +++ /dev/null @@ -1,880 +0,0 @@ --0.31202845 -0.36308093 --0.21403073 0.38857646 --0.38530118 -0.24484730 --0.44021783 0.07284252 --0.34501041 0.34872590 - 0.35857538 -0.40045539 --0.25176904 0.40377600 --0.10377581 0.43578972 --1.01896226 0.14271390 --1.15718524 -1.07104846 --0.40883880 0.30174936 - 0.26396095 0.48082155 --0.31654178 1.26105861 --0.33255136 -0.17032596 --0.41545553 0.38068746 --0.23973431 1.32252511 --0.49928116 0.40812210 --0.60891702 -0.47180571 --0.98044772 0.33254717 - 1.23532760 -1.08284043 --1.01739273 0.23195386 --0.95909631 -1.27747201 --0.18344231 0.97172160 --0.36005886 -1.19561767 --0.38733224 1.03655789 --1.14703959 0.49592443 --0.34627477 0.37436581 --0.32594570 -0.36576269 --0.33047672 0.45166025 - 1.03227135 -0.26600616 --0.24368430 1.13277766 --1.10409800 -1.13670229 --0.27024330 0.45950443 --0.43012606 -0.49137862 --0.42938643 0.96752310 - 0.29460881 0.46255766 --1.12981200 0.36271133 --1.06546596 -0.99914698 --0.32964627 0.54802267 --0.97768436 1.05949598 --0.40125588 0.35060801 --0.14555788 -0.29516627 --1.16824437 0.33042499 --1.38177121 -1.02828516 --0.36030711 0.53502663 --0.99270774 0.38492966 --0.34180208 0.46901106 - 1.02021653 -1.03189533 --0.38784460 0.27839052 - 0.98525087 1.10441090 --0.37064093 0.37855671 - 0.92249275 0.38692346 --0.37782815 0.26512776 --0.38059680 -1.10559455 --1.08779693 0.25242918 --1.31058915 -0.99926776 --0.32423909 1.22001515 --0.25335804 1.00836191 --0.50573269 0.31900345 - 0.42698256 -0.94413229 --0.39166269 0.41072366 - 0.25755208 -0.39660996 --0.33022334 1.05502122 --1.12361886 0.95444663 --0.37428566 0.38306311 - 0.21248197 1.04776058 --0.47434424 0.99247118 - 0.43507446 -0.36697818 --0.95021817 0.15733583 --0.99554159 -1.14130590 --0.25435034 0.50150512 --1.13525219 -0.27992447 --0.54906403 0.94151150 --1.17729844 -0.37677613 --0.29075006 1.14107781 --0.55423390 -0.31265259 --0.32086652 0.46332639 --0.27004284 -0.25876856 --0.56225634 0.99336544 --0.32896397 -0.32120490 --0.42109267 1.09730148 - 0.16066972 -1.09133678 --0.46397415 -0.26636357 --0.48496755 0.28388862 --0.36968179 0.36567458 - 0.26521387 -0.29984385 --0.33480946 0.46485409 --0.36463789 0.26204947 --1.18759281 0.26015798 --0.96596592 -0.93117220 --0.33784886 0.39164206 - 0.43769194 0.69739352 --0.43032293 0.84413229 --0.23774796 -0.28911962 --0.33130118 0.41821511 --0.50013585 0.97965454 --0.34689709 0.35409852 --0.23010782 -0.12586032 --0.97858139 0.38056045 - 1.08280742 -1.25403467 --1.08716964 0.37903094 --1.06816096 -1.26485276 --0.29749093 1.08244304 --0.36919521 -1.24051895 --0.41806929 1.02179014 --0.87352398 0.31284450 --0.32826699 0.34535817 --0.52300831 -0.18727837 --0.25032100 0.44847978 - 0.91304423 -0.42961637 --0.13446642 1.15022408 --1.15680622 -1.21068591 --0.36015459 0.38355671 --0.41281658 -0.28563836 --0.28095750 1.17150443 - 0.44841940 0.22784693 --1.20991785 0.43888552 --1.26949348 -1.09066654 --0.49699144 0.41646383 --1.10251223 1.15954894 --0.35344943 0.42981020 --0.35460879 -0.40159958 --0.96881406 0.42432504 --1.12683149 -0.94337597 --0.34090486 0.45009494 --1.30640116 0.33027100 --0.21513225 0.30060400 - 1.23753084 -1.09859072 --0.17778666 0.45746800 - 0.98283097 1.00470073 --0.44060208 0.46320487 - 1.21931561 0.58300444 --0.34443300 0.35025224 --0.20455252 -1.20751826 --1.05565774 0.30209405 --0.90794063 -0.99564640 --0.37062355 1.18006149 --0.36830585 1.05842914 --0.28829158 0.37278172 - 0.51701024 -1.17362256 --0.28685147 0.17704574 - 0.43894598 -0.41798899 --0.61389745 1.18724310 --1.14959160 1.08955659 --0.43773208 0.40961614 - 0.00657211 1.11721014 --0.45242309 1.04238246 - 0.28752062 -0.13222957 --1.29550622 0.31509320 --1.06884344 -1.03394430 --0.42241401 0.35919199 --1.08379928 -0.57802668 --0.41458484 0.83139690 --1.05365813 -0.42116548 --0.41745035 1.19305593 --0.44639650 -0.27576769 --0.44621577 0.17412965 --0.23004430 -0.32898997 --0.36165151 1.20449839 --0.55117142 -0.48984181 --0.16798699 1.04071241 - 0.31011770 -1.36217467 --0.46631118 -0.32516904 --0.15805322 0.44809717 --0.35860554 0.16913916 - 0.41178134 -0.34124789 --0.30074668 0.40714965 --0.38017496 0.39131278 --0.96741058 0.67253560 --1.24569648 -0.72436186 --0.27101990 0.38548867 - 0.28420613 0.25890492 --0.42278819 1.11012306 --0.28250890 -0.32853298 --0.28400818 0.27501319 --0.17076321 1.11189064 --0.45023807 0.37402836 --0.22213671 -0.41960172 --0.94141884 0.30789514 - 1.05357821 -1.01149325 --1.05482103 0.52764631 --0.99859625 -0.87049613 --0.28261505 1.09640290 --0.49015364 -1.08402523 --0.14498054 1.09090615 --0.94911979 0.42267368 --0.34357322 0.44569840 --0.34921322 -0.35138845 --0.31748827 0.31627969 - 1.11463777 -0.28394406 --0.46326050 0.89279233 --1.06477639 -1.08022949 --0.42836832 0.39212624 --0.16028271 -0.37561196 --0.45372092 1.09581520 --0.04101846 0.41543315 --1.24776237 0.50372052 --1.01046209 -1.20203071 --0.34264731 0.39036274 --1.19551204 1.04588443 --0.35012639 0.43429116 --0.36476204 -0.24929817 --1.23662846 0.23121207 --1.08869701 -1.09800513 --0.35657338 0.32142876 --1.16706471 0.40350355 --0.47757543 0.33968056 - 1.12643846 -1.03342793 --0.40429544 0.51235936 - 0.92993726 1.04386743 --0.27921326 0.12895368 - 1.07057147 0.41675044 --0.45781543 0.34530738 --0.15550368 -1.15290701 --1.24474912 0.22373701 --1.01636406 -1.15984020 --0.45241277 0.94067451 --0.39666102 1.01551504 --0.30415407 0.52966388 - 0.42242219 -1.04720736 --0.48521314 0.34940459 - 0.23494422 -0.47659414 --0.39947228 1.05426259 --1.18041855 1.15411420 --0.24193544 0.39310208 - 0.33862100 1.02349548 --0.54773004 1.23503633 - 0.10818630 -0.25533904 --0.96224435 0.40891113 --0.97643294 -1.01562261 --0.42844287 0.45214473 --1.00810432 -0.28926920 --0.40737767 0.96829636 --0.89918110 -0.45258226 --0.33496466 1.06184687 --0.38077794 -0.20763689 --0.40201285 0.36673030 --0.45952525 -0.25742302 --0.25045162 1.07737031 --0.50752572 -0.27866299 --0.23083068 1.29397369 - 0.39199302 -1.20171519 --0.38433807 -0.37865898 --0.55990357 0.41664491 --0.29794709 0.51366410 - 0.37475812 -0.43001268 --0.27729731 0.29944694 --0.47488383 0.35239836 --0.96654000 0.69215033 --1.11110431 -0.82416572 --0.20368948 0.49057982 - 0.52308494 0.33483727 --0.24850933 1.07443686 --0.34791805 -0.32007730 --0.25853676 0.51115807 --0.17941734 1.20519231 --0.11342097 0.25102777 --0.27670160 -0.19012193 --1.03994582 0.54908843 - 0.86407132 -1.35562044 --0.94185647 0.43008755 --1.22186569 -0.88452692 --0.32106283 1.09166980 --0.53694980 -0.85871688 --0.24383048 1.07474394 --1.05491406 0.53824228 --0.27060332 0.34516662 --0.32232377 -0.58146394 --0.30486319 0.32528566 - 0.90500008 -0.34391269 --0.45103429 1.14989139 --0.99391132 -1.09294192 --0.38275270 0.33166196 --0.35915102 -0.54143680 --0.32318896 1.00574008 - 0.40764212 0.45276816 --1.11114012 0.15238414 --0.92815560 -1.22164919 --0.43174187 0.15685803 --1.14341183 0.99562192 --0.41415278 0.22841552 --0.35771155 -0.46436053 --1.16822694 0.23892475 --0.67346115 -1.18765414 --0.42589250 0.14605392 --1.09038520 0.17955477 --0.49389893 0.24608462 - 1.22544028 -0.75196104 --0.41209167 0.21904591 - 0.72389705 1.31839934 --0.49661047 0.29730266 - 1.22685896 0.67502585 --0.35135181 0.25325888 --0.00620830 -1.14363823 --1.05333122 0.10254708 --0.69867409 -1.13965865 --0.53128392 1.07896460 --0.45948404 1.13887059 --0.29932935 0.38962638 - 0.31620505 -1.34874423 --0.35708404 0.43969553 - 0.54695336 -0.41951872 --0.36976770 0.99489550 --1.00577935 1.04650656 --0.31839248 0.32966467 - 0.27710048 1.14046577 --0.34954991 0.89579091 - 0.46003161 -0.38668754 --1.09483649 0.45558599 --1.32749255 -1.08655702 --0.41384999 0.53388335 --0.92586659 -0.23732743 --0.11461978 1.22614317 --1.13476543 -0.15516704 --0.03625266 0.88792143 --0.36426959 -0.31917900 --0.17525306 0.13101065 --0.29878850 -0.40565286 - 0.06367635 1.21715588 --0.30032239 -0.25475547 - 0.09898865 1.02720529 --0.06611431 -1.15194721 --0.39215060 -0.30150449 --0.38680782 0.31314671 --0.06247327 0.36132059 - 0.20109728 -0.64570689 --0.23945673 0.64085696 --0.13446949 0.70075405 --0.75243730 0.91726734 --1.45028028 -0.43988942 --0.07926376 0.54618428 - 0.35151647 0.12328557 --0.00043103 1.20547449 --0.41878158 -0.11462993 --0.13188202 0.60069882 - 0.33204624 1.19833977 --0.15340704 0.41633354 --0.41617623 -0.17790618 --0.56285739 0.88577465 - 0.39265124 -1.47117966 --0.57457171 0.94599611 --1.57813091 -0.27615434 - 0.25275661 1.03110215 --0.84474420 -0.90311830 - 0.25303978 1.04767460 --0.63961834 1.02757341 --0.15838839 0.44901836 --0.48000317 -0.10596114 --0.25937394 0.42590391 - 0.84493295 -0.70805225 - 0.24423362 1.01963863 --1.48665793 -0.14370221 - 0.07376786 0.42983815 --0.59202645 -0.01731182 - 0.18705556 1.24782046 - 0.56661178 -0.02647487 --0.60722140 0.86222403 --1.48738136 -0.43921204 --0.15651173 0.61619336 --0.19885992 1.58694503 - 0.07385597 0.42852972 --0.41682070 -0.14784924 --0.77195688 0.87679915 --1.40503884 -0.15440256 --0.14103875 0.68667030 --0.76379382 0.85984795 --0.12619804 0.52072503 - 0.12570952 -1.63658614 - 0.09358821 0.46519043 - 1.51702274 0.10571578 --0.15718465 0.55544646 - 1.12819516 -0.37212082 --0.01459698 0.53777689 --1.07351142 -0.64113878 --0.57369112 0.88411436 --1.46870106 -0.19352991 - 0.35927911 1.03440056 - 0.30424108 1.10045036 - 0.02981222 0.51366749 --0.16684004 -1.23339544 - 0.05097045 0.26090896 - 0.09668531 -0.54237611 - 0.38772762 1.03212178 --0.30759050 1.47875603 --0.02502066 0.42910717 - 0.94844497 0.80507692 - 0.28830246 1.24135339 - 0.14865732 -0.40934806 --0.64849870 1.02545190 --1.64220884 -0.23073861 --0.04115289 0.50218823 --1.06285152 0.11311046 - 0.16416052 1.04673165 --1.11102027 0.08544000 - 0.30091542 1.08688638 --0.54551043 -0.18095572 --0.23788564 0.53265900 --0.49872342 -0.26678921 - 0.22270801 0.99856952 --0.60363472 -0.05824273 - 0.13204250 1.13170488 --0.26664132 -1.21950767 --0.56062165 -0.26617337 - 0.00727415 0.21197638 --0.10690293 0.56904332 --0.12173691 -0.55223481 --0.13609125 0.38164037 --0.22226458 0.71446498 --0.74245911 0.85892687 --1.55972244 -0.41484829 --0.20334295 0.61970357 - 0.31700129 0.07079464 - 0.13449857 1.02302289 --0.54238275 -0.31894746 --0.28133418 0.52067079 - 0.28060094 1.12630923 --0.12162546 0.36634303 --0.34561133 -0.17827835 --1.03931702 0.70751582 - 0.59423681 -1.29911937 --0.75843257 0.81139880 --1.57730446 -0.68556803 - 0.10310968 1.03335362 --0.67400306 -0.84700429 - 0.06054034 1.15025742 --0.77286167 0.47557829 --0.29028847 0.54276291 --0.27482760 -0.19772142 --0.11994968 0.36408189 - 0.78035295 -0.81713160 - 0.21737616 1.09857289 --1.18254850 -0.66539897 --0.35210721 0.39493518 --0.50975569 -0.29188620 - 0.07661012 1.15470996 - 0.35848649 0.26022851 --0.77485063 0.69526899 --1.22207178 -0.46175769 --0.18692438 0.60206436 --0.62741906 1.33494975 --0.17855601 0.34009484 --0.42621663 -0.13057148 --0.83850938 0.63075363 --1.47199973 -0.51955942 --0.23964524 0.59891281 --1.01720429 0.84543467 --0.25567097 0.34493172 - 0.65782207 -1.35499684 --0.13645103 0.42344955 - 1.42139339 0.70402143 --0.14134279 0.58163801 - 1.26429849 -0.05123437 --0.15573860 0.66425208 --0.84664093 -0.89746670 --0.66765526 0.65188491 --1.33946979 -0.68336950 --0.13547805 1.33391456 --0.01311918 1.08381016 --0.26885915 0.39044922 --0.09629192 -1.12985380 --0.18477312 0.41780574 - 0.11788432 -0.36930565 --0.11400622 1.14616969 --0.71164575 1.14762749 --0.19434913 0.51072915 - 0.57606657 0.96776987 --0.02115547 1.18705119 --0.03177567 -0.52325305 --1.03661648 0.39131082 --1.19200246 -1.02791732 --0.44145789 0.43868764 --0.96775095 -0.11064332 --0.35379494 1.18148992 --1.00698678 -0.48198386 --0.26498858 1.12476012 --0.26143369 -0.37768083 --0.51512946 0.36354685 --0.19957862 -0.31824547 --0.66653588 0.85918826 --0.37520507 -0.35376709 --0.44493040 0.93295373 - 0.55064254 -1.23389527 --0.28115978 -0.30295983 --0.54907227 0.21053437 --0.50793530 0.37345227 - 0.37024987 -0.25310419 --0.35959453 0.11118461 --0.50281000 0.16548987 --1.26322433 0.05900470 --0.64710033 -1.49218071 --0.51790185 0.28396723 - 0.31222570 0.27090413 --0.71499001 0.96604950 --0.16468815 -0.42049513 --0.52287459 0.23433390 --0.87932719 0.71816438 --0.43828506 0.00462493 - 0.02218342 -0.60768376 --1.20981804 -0.13172407 - 1.39808402 -0.43885489 --0.97813323 -0.26248931 --0.25206935 -1.34281904 --0.75325400 0.81961764 - 0.14422066 -1.34191266 --0.79582225 0.96136586 --1.16155513 -0.26329434 --0.86013035 0.06741854 --0.00965300 -0.55094971 --0.49391380 0.00109182 - 1.11157602 0.40557103 --1.11950886 0.76793436 --0.11150682 -1.78154507 --0.43682487 0.08305273 --0.12393961 -0.55946423 --0.98192766 0.78343527 --0.06091643 0.58229269 --1.03669652 -0.42149417 --0.21401098 -1.64487810 --0.50680768 0.13930195 --1.33574727 0.14706836 --0.55714862 0.12537793 - 0.13380015 -0.61643711 --1.09488278 -0.08747533 --0.21066788 -1.44769192 --0.50229181 -0.04011964 --1.13638894 -0.23384381 --0.43836050 0.11383238 - 1.39228950 -0.10799639 --0.48802878 0.20264974 - 0.47588619 1.62192837 --0.27340939 0.19361598 - 0.68448629 0.80864114 --0.47195792 0.05420133 - 0.34477091 -1.07786560 --0.92004004 -0.25424321 --0.37760272 -1.39721129 --0.87787868 0.89426868 --0.79267036 0.75520147 --0.48065034 0.07817515 - 0.85184258 -0.83563910 --0.47239528 0.12627174 - 0.48277009 -0.18180439 --0.71997171 0.75293982 --1.29153937 0.42384830 --0.32613062 0.17402085 - 0.10202947 1.04593394 --0.71125374 0.74980584 - 0.50484731 -0.16738092 --1.16256423 -0.00470142 --0.58952940 -1.43917961 --0.71851513 0.20431374 --0.82581369 -0.70146519 --0.43309512 1.05489748 --0.87632697 -0.63470868 --0.56174046 0.94078784 --0.36343466 -0.74030249 --0.47009920 0.32511040 --0.28949047 -0.46301691 --0.61098971 0.83197266 --0.30513604 -0.52105098 --0.75061540 0.87475951 - 0.50974994 -1.08883784 --0.28154826 -0.52078296 --0.34873231 0.28167771 --0.41149750 0.26937057 - 0.19007326 -0.31381309 --0.39222476 0.35812278 --0.40291930 0.24467795 --1.10924908 0.34485345 --0.98085212 -1.05744586 --0.27406176 0.26544570 - 0.35012828 0.35381774 --0.40087355 1.19550172 --0.44650037 -0.43294378 --0.29257517 0.33133304 --0.13780562 1.23531423 --0.51645492 0.53254651 --0.45365730 -0.41872486 --1.03611147 0.47877429 - 0.79832435 -1.32896077 --1.11551489 0.40800484 --1.11975639 -0.79847563 --0.20611406 1.00724166 --0.69838131 -1.03603068 --0.23096181 1.08306487 --1.07023457 0.66243075 --0.15173137 0.52598993 --0.38361285 -0.38311364 --0.34378062 0.47000297 - 1.03804857 -0.51402522 --0.09490212 1.19969154 --1.27634648 -0.70130648 --0.42548178 0.45803214 --0.33217760 -0.25636176 --0.36035026 1.01323624 - 0.58868663 0.21384701 --1.12508238 0.78429355 --1.32778013 -0.87805779 --0.31778980 0.37782146 --0.88447401 1.32004993 --0.31173481 0.18936826 --0.46230529 -0.38937533 --0.93875591 0.40586591 --1.19880808 -0.88001421 --0.33507246 0.41148662 --1.02904286 0.47779753 --0.30145877 0.41586993 - 0.86851117 -1.10918688 --0.50406166 0.13349449 - 1.00458594 0.99686515 --0.38307432 0.36008430 - 1.00433321 0.37749771 --0.50953245 0.15792285 --0.39888021 -1.18812231 --1.08444469 0.41794647 --1.00859605 -1.36982347 --0.39929721 1.00858598 --0.57043925 0.94134680 --0.45270563 0.30986828 - 0.64740169 -0.87173231 --0.34851350 0.43318799 - 0.50373214 -0.46736993 --0.49324614 0.90839987 --1.16083187 0.85756541 --0.37995838 0.30665239 - 0.14942910 1.19252524 --0.45750199 1.00124895 - 0.39533489 -0.24618649 --1.09194749 0.30059665 --0.53064464 -1.29745411 --0.32829564 0.19645699 --1.00491093 -0.49180643 --0.69388058 0.98571285 --1.07327052 -0.52013451 --0.49550616 0.92068615 --0.28149445 -0.44098059 --0.42975495 0.38440311 --0.34010936 -0.33895185 --0.54740262 1.13529512 --0.25928445 -0.47033113 --0.58739701 1.01800468 - 0.48617337 -1.07609991 --0.40499489 -0.57781754 --0.40174748 0.55155045 --0.32286706 0.26588019 - 0.53629286 -0.42122792 --0.39920489 0.51713042 --0.45359370 0.40737035 --0.84548899 0.27785657 --1.00667459 -0.96613366 --0.26828484 0.25976331 - 0.25295097 0.37607576 --0.46126431 1.03260901 --0.40279099 -0.24657659 --0.37987717 0.12352906 --0.44628748 0.86769292 --0.29637438 0.45896986 --0.39936855 -0.08745092 --0.95340646 0.37842294 - 0.90178683 -1.14345809 --0.80646092 0.53265844 --1.27088485 -0.89749663 --0.24802130 0.91333138 --0.36572702 -0.99916742 --0.36641645 1.05426660 --1.10837220 0.52275107 --0.44607592 0.15779324 --0.23228534 -0.24406293 --0.36384164 0.45002486 - 1.03058155 -0.56498483 --0.14187980 1.07303759 --1.15376965 -1.13637382 --0.36264501 0.52815460 --0.39051068 -0.24438521 --0.07492065 1.14349287 - 0.51684344 0.08621823 --0.96172276 0.52619069 --1.04576540 -1.11777830 --0.34938487 0.45655008 --1.02766240 1.18495194 --0.52997885 0.55748157 --0.15364100 -0.44508072 --1.14329676 0.23788243 --1.21779719 -1.11349751 --0.38546200 0.42075026 --1.17918179 0.52604491 --0.28574420 0.52199428 - 1.08330303 -0.98066820 --0.24802582 0.27160918 - 1.04853566 1.08102404 --0.29313743 0.42485423 - 0.96260308 0.26803572 --0.51912360 0.34420975 --0.11292000 -1.14400559 --1.04739492 0.17540820 --1.11441406 -1.22883010 --0.52639594 0.84986367 --0.52710069 1.01735010 --0.30885479 0.27388498 - 0.44574757 -0.74425968 --0.46382300 0.44814634 - 0.44904213 -0.30813329 --0.63767229 1.21418607 --1.22556632 0.86395503 --0.34214451 0.30574735 - 0.17259234 0.86496400 --0.32480619 1.05612537 - 0.43889334 -0.51933604 --1.02674349 0.35609282 --0.89393514 -1.21049417 --0.36846369 0.37941633 --0.98641807 -0.47559413 --0.44755679 1.21960269 --1.03122128 -0.33682392 --0.35318795 1.12940664 --0.36331006 -0.32896336 --0.28306541 0.38647142 --0.21812509 -0.27670337 --0.44729084 1.10887448 --0.52859975 -0.36404097 --0.24010453 0.91605871 - 0.41984611 -1.15062846 --0.34248795 -0.24005071 --0.33397378 0.35878522 --0.39831462 0.50795634 - 0.41702786 -0.62163274 --0.33805101 0.45650539 --0.27859581 0.40216109 --1.05774569 0.53779507 --1.42415680 -0.87055713 --0.27654375 0.38928806 - 0.25901039 0.35652859 --0.33082657 1.15409645 --0.40685393 -0.20407365 --0.23686438 0.56633035 --0.26193902 1.21365439 --0.20260600 0.49133397 --0.45165163 -0.45751703 --1.18346583 0.31810438 - 0.89802934 -0.95013768 --1.16309863 0.26604245 --1.18386506 -1.10311721 --0.16784287 1.05364788 --0.49077470 -0.99025124 - 0.00171671 1.15509224 --0.86606100 0.28942709 --0.30559667 0.49226883 --0.39902748 -0.41785924 --0.33112115 0.32495728 - 0.94443664 -0.36892219 --0.38348413 1.14426380 --1.18058683 -1.05089383 --0.39125284 0.36801023 --0.35680139 -0.41245427 --0.25121134 1.15931919 - 0.36056736 0.40619567 --1.09116775 0.36957303 --1.13642958 -1.11281056 --0.34056852 0.38007119 --1.21838730 0.91970197 --0.17884434 0.42245022 --0.27551533 -0.38898298 --1.25507508 0.38253654 --1.21026313 -0.87005343 --0.39228963 0.62309083 --1.16448806 0.36472580 --0.24315635 0.34112968 - 1.07454905 -0.99510410 --0.35416482 0.42511567 - 1.03604010 1.07082031 --0.39485070 0.40169023 - 1.02018178 0.32303944 --0.24714138 0.27513322 --0.25443819 -1.04224213 --1.00335985 0.33336367 --0.95167241 -1.13384472 --0.47178371 1.10380719 --0.44347102 0.89865945 --0.35612593 0.24575863 - 0.59544992 -0.97082846 --0.33079820 0.18842791 - 0.24063116 -0.40954664 --0.54597573 1.11706897 --1.09356272 0.86551165 --0.25644651 0.42451965 - 0.31590044 1.01547745 --0.57685164 1.03765963 - 0.26467495 -0.26793133 --1.02806397 0.49413336 --1.07742309 -1.17025750 --0.33545549 0.24268994 --1.03818129 -0.41749668 --0.37066685 0.90622096 --1.13805168 -0.46375121 --0.41169235 1.07307811 --0.47517936 -0.31180552 --0.36701432 0.38670108 --0.41929830 -0.47138018 --0.34942081 1.04098519 --0.47106518 -0.32153553 --0.37195463 1.05910723 - 0.14637113 -1.06527293 --0.10291353 0.42424225 - 0.26947551 -0.43055636 --0.40148014 0.38862774 --0.40945108 0.39705641 --1.04244368 0.49395299 --1.27365240 -0.86786814 --0.26467394 0.31488035 - 0.31891504 0.35451162 --0.04344638 1.10074605 --0.39683701 -0.29984324 --0.21146179 0.57934039 --0.18430679 1.20083875 --0.34647055 0.21374240 --0.36800694 -0.20463353 --0.96803254 0.36613104 - 1.00439662 -1.14286191 --1.08184906 0.38984420 --0.86737954 -0.96935370 --0.21922013 1.04052779 --0.45758990 -1.02426336 --0.21924203 1.16949224 --0.91730740 0.13145528 --0.35857284 0.25584683 --0.30528757 -0.35552063 --0.45500790 0.29050995 - 1.09478106 -0.29988615 --0.36959306 0.95649714 --0.91490210 -1.26214271 --0.38509185 0.39302859 --0.35739352 -0.34429725 --0.31262994 0.82016967 - 0.38738991 0.37644184 --0.98502444 0.18314526 --1.05050547 -1.20645447 --0.33670658 0.36506942 --1.21343766 0.93698166 --0.09855738 0.24705256 --0.33113277 -0.38521955 --0.89739483 0.08841987 --0.89465442 -0.94690980 --0.42145584 0.28343312 --1.06849193 0.47108899 --0.39732226 0.44606233 - 1.06930625 -1.11142101 --0.29206820 0.39997851 - 0.78073372 0.90899737 --0.25421280 0.32608096 - 0.91519669 0.45997640 --0.38956838 0.39409618 --0.26364644 -1.24426066 --1.05191054 0.38146703 --1.01747304 -1.08036571 --0.38768865 1.09525211 --0.38096670 1.04466527 --0.36889228 0.35087106 - 0.39210062 -1.23945201 --0.24018273 0.20336419 - 0.40875677 -0.57228107 --0.41285536 1.16986380 --0.98056291 0.94739535 --0.26388705 0.51398988 - 0.27895279 1.06031029 --0.27752604 1.15191683 - 0.33890427 -0.48476732 --1.09037791 0.46464290 --1.33508329 -0.81219355 --0.39158408 0.44958947 --1.24108745 -0.16653263 --0.17524396 1.04890332 --1.13377063 -0.37194277 --0.44164358 1.11606653 --0.50379533 -0.21441051 --0.42550406 0.40402679 --0.41738928 -0.50437718 --0.20289748 0.96368079 --0.29945932 -0.41636288 --0.37797060 0.94457881 - 0.39310239 -1.29272896 diff --git a/QAM/OLD/old3/constellation_ref.dat b/QAM/OLD/old3/constellation_ref.dat deleted file mode 100644 index ffaf6b5..0000000 --- a/QAM/OLD/old3/constellation_ref.dat +++ /dev/null @@ -1,16 +0,0 @@ --1.02899151 -1.02899151 --1.02899151 -0.34299717 --1.02899151 0.34299717 --1.02899151 1.02899151 --0.34299717 -1.02899151 --0.34299717 -0.34299717 --0.34299717 0.34299717 --0.34299717 1.02899151 - 0.34299717 -1.02899151 - 0.34299717 -0.34299717 - 0.34299717 0.34299717 - 0.34299717 1.02899151 - 1.02899151 -1.02899151 - 1.02899151 -0.34299717 - 1.02899151 0.34299717 - 1.02899151 1.02899151 diff --git a/QAM/OLD/old3/qam.c b/QAM/OLD/old3/qam.c deleted file mode 100644 index a9f1b64..0000000 --- a/QAM/OLD/old3/qam.c +++ /dev/null @@ -1,361 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - //double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - double norm_factor = sqrt((double)(1.7*(qam->M - 1)/3.0)); - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp) / norm_factor; - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - //s[k * qam->N + n] = A * iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - int idx = k * qam->N + n; - s[idx] = A * iq * cexp(2 * I * M_PI * qam->Fc * ((double)idx / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat, FILE *fp_constel) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - //r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)(k * qam->N + n) / qam->Fs)); - - - } - r /= qam->N; - r /= A; - - if (fp_constel) { - fprintf(fp_constel, "% .8f % .8f\n", creal(r), cimag(r)); - fflush(fp_constel); - } - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { - int errors = 0; - for (int i = 0; i < nb_bits; i++) { - if (bits1[i] != bits2[i]) errors++; - } - return (double)errors / nb_bits; -} - -// ---------- Helpers ---------- -static inline double complex interp_linear(double complex *x, int N, double t) { - // t: position en échantillons (peut être fractionnaire). On suppose 0 <= t <= N-2 - int i = (int)floor(t); - double mu = t - (double)i; - if (i < 0) i = 0; - if (i >= N-1) return x[N-1]; - return (1.0 - mu) * x[i] + mu * x[i+1]; -} - -static int nearest_constellation_index(qam_system* qam, double complex z, int *out_i, int *out_j) { - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int best_i = 0, best_j = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(z - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; best_i = i; best_j = j; - } - } - } - if (out_i) *out_i = best_i; - if (out_j) *out_j = best_j; - return best_i * sm + best_j; -} - -// --- Démodulation avec M&M + PLL et écriture dans fichier --- -void demodulate_real(qam_system* qam, double complex* rx_samples, int total_samples, - uint8_t* bits_hat, const char* filename) -{ - double sps = (double) qam->N; // échantillons par symbole - double Kp_t = 0.005, Ki_t = 0.001; - double Kp_c = 0.01, Ki_c = 0.01; // PLL porteur - double timing_integrator = 0.0; - double phase_integrator = 0.0, phase_est = 0.0; - double t = sps/2.0; - - int max_symbols = (int)(total_samples / sps) + 10; - double complex* syms = malloc(sizeof(double complex) * max_symbols); - int sym_count = 0; - - double power = 0.0; - for(int i = 0; i < total_samples; i++) power += pow(cabs(rx_samples[i]), 2); - power /= total_samples; - double agc_gain = 1.0; - if(power > 0) agc_gain = 1.0 / sqrt(power); - - // Ouverture du fichier pour écrire les symboles reçus - FILE* fp = fopen(filename, "w"); - if(!fp) { - perror("Erreur ouverture fichier .dat"); - free(syms); - return; - } - - while((int)floor(t) + 1 < total_samples) { - double complex yk = interp_linear(rx_samples, total_samples, t) * agc_gain; - double complex z = yk * cexp(-I * phase_est); - syms[sym_count++] = z; - - // Écriture de chaque symbole reçu dans le fichier - fprintf(fp, "% .8f % .8f\n", creal(z), cimag(z)); - - if(sym_count >= 3){ - double complex y_k = syms[sym_count-1]; - double complex y_k_1 = syms[sym_count-2]; - double complex y_k_2 = syms[sym_count-3]; - double e_t = creal((y_k - y_k_2) * conj(y_k_1)); - timing_integrator += Ki_t * e_t; - double timing_adjust = Kp_t * e_t + timing_integrator; - t += sps + timing_adjust; - } else t += sps; - - // PLL carrier - if(sym_count >= 1) { - int ii, jj; - int idx = nearest_constellation_index(qam, z, &ii, &jj); - double complex d = qam->constellation[ii][jj]; - double e_phase = cimag(z * conj(d)); - phase_integrator += Ki_c * e_phase; - double phase_adj = Kp_c * e_phase + phase_integrator; - phase_est += phase_adj; - if(phase_est > M_PI) phase_est -= 2*M_PI; - if(phase_est < -M_PI) phase_est += 2*M_PI; - } - } - - // Décision finale et reconstruction bits - int nb_symbols = sym_count; - int sm = (int)sqrt(qam->M); - int nb_bits = nb_symbols * qam->k; - for(int k = 0; k < nb_symbols; k++) { - double complex z = syms[k]; - int ii, jj; - int id = nearest_constellation_index(qam, z, &ii, &jj); - for(int b = 0; b < qam->k; b++) { - int bit = (id >> (qam->k - 1 - b)) & 1; - if(k * qam->k + b < nb_bits) bits_hat[k * qam->k + b] = (uint8_t)bit; - } - } - - fclose(fp); - free(syms); -} - - -int main () { - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - //qam.Ts = 0.0003; - //qam.N = (int)(qam.Fs * qam.Ts); - qam.N = 100; - qam.Ts = qam.N / qam.Fs; - qam.Fc = 2000; - init_constellation(&qam); - - //int nb_bits = 1000; - //int nb_symbols = nb_bits / qam.k; - - //uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - //for (int i = 0; i < nb_bits; i++) { - // input_bits[i] = rand() % 2; - //} - char* texte = "VVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxVif juge, trempez ce blond whisky aqueuxif juge, trempez ce blond whisky aqueux"; - int nb_chars = strlen(texte); - int nb_bits = nb_chars * 8; - int nb_symbols = (nb_bits + qam.k - 1) / qam.k; - - // Conversion du texte en bits - uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - for(int i = 0; i < nb_chars; i++){ - for(int b = 0; b < 8; b++){ - input_bits[i*8 + b] = (texte[i] >> (7-b)) & 1; - } - } - - // Conversion en symboles - double complex* symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits, nb_bits, symbols); - - // Modulation - int total_samples = qam.N * nb_symbols; - double complex* s = malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - //double phase_offset = M_PI / 6.0; // 30 degrés - //for (int i = 0; i < total_samples; i++) { - // s[i] *= cexp(I * phase_offset); - //} - //double freq_offset = 0; // Hz de décalage - //for (int i = 0; i < total_samples; i++) { - // double t = (double)i / qam.Fs; - // s[i] *= cexp(I * 2 * M_PI * freq_offset * t); - //} - //int offset_samples = (int)(0.3 * qam.N); // décalage de 30% d’un symbole - //memmove(s + offset_samples, s, (total_samples - offset_samples) * sizeof(double complex)); - - - - // Ajout du bruit - //double snr_dB = 5; // SNR en dB - //double signal_power = 1.0; // puissance moyenne unitaire après normalisation - //double snr_lin = pow(10.0, snr_dB / 10.0); - //double sigma = sqrt(signal_power / (2.0 * snr_lin)); // /2 car bruit sur I et Q - add_noise(s, total_samples, 0.1); - - FILE *fp_ref = fopen("constellation_ref.dat", "w"); - int sm = (int)sqrt(qam.M); - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - fprintf(fp_ref, "% .8f % .8f\n", creal(qam.constellation[i][j]), cimag(qam.constellation[i][j])); - } - } - fclose(fp_ref); - FILE *fp_constel = fopen("constellation.dat", "w"); - - // Démodulation - uint8_t* output_bits = (uint8_t*)malloc(nb_bits * sizeof(uint8_t)); - //demodulate(&qam, s, nb_symbols, output_bits, fp_constel); - for (int i = 0; i < total_samples; i++) { - s[i] *= cexp(-2 * I * M_PI * qam.Fc * (i / qam.Fs)); - } - - demodulate_real(&qam, s, total_samples, output_bits, "constellation.dat"); - - - fclose(fp_constel); - - // Reconstruction du texte - char* texte_recup = malloc(nb_chars + 1); - for(int i = 0; i < nb_chars; i++){ - char c = 0; - for(int b = 0; b < 8; b++){ - c |= output_bits[i*8 + b] << (7-b); - } - texte_recup[i] = c; - } - texte_recup[nb_chars] = '\0'; - printf("Texte original : %s\n\n", texte); - printf("Texte demodulé : %s\n", texte_recup); - - // Calcul du BER - double ber = compare_bits(input_bits, output_bits, nb_bits); - printf("Taux d'erreur blind QAM: %.4f\n", ber * 100); - - // Libération mémoire - free(input_bits); - free(output_bits); - free(symbols); - free(s); - free_constellation(&qam); - - return 0; -} diff --git a/QAM/OLD/qam b/QAM/OLD/qam deleted file mode 100755 index da3f956..0000000 Binary files a/QAM/OLD/qam and /dev/null differ diff --git a/QAM/OLD/qamold/qam.c b/QAM/OLD/qamold/qam.c deleted file mode 100644 index af82ffd..0000000 --- a/QAM/OLD/qamold/qam.c +++ /dev/null @@ -1,238 +0,0 @@ -#include -#include -#include -#include -#include -#include "../wav/wav.h" -#include "../files/files.h" -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -// Compare deux tableaux de bits (0/1) et retourne le pourcentage de fiabilité. -double compare_bits(const uint8_t *in_bits, size_t nb_bits_in, const uint8_t *out_bits, size_t nb_bits_out, size_t *erreurs) { - if (!in_bits || !out_bits) { - if (erreurs) *erreurs = (nb_bits_in < nb_bits_out) ? nb_bits_out : nb_bits_in; - return 0.0; - } - - size_t n_min = (nb_bits_in < nb_bits_out) ? nb_bits_in : nb_bits_out; - size_t n_max = (nb_bits_in > nb_bits_out) ? nb_bits_in : nb_bits_out; - - size_t err = 0; - for (size_t i = 0; i < n_min; ++i) { - if ((in_bits[i] & 1) != (out_bits[i] & 1)) err++; - } - - if (n_max != n_min) { - err += (n_max - n_min); - } - - if (erreurs) *erreurs = err; - - double total_compared = (double)n_max; - if (total_compared == 0.0) return 0.0; - - double ber = (double)err / total_compared; - double reliability_percent = (1.0 - ber) * 100.0; - return reliability_percent; -} - - -int main (int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "Utilisation: %s \n", argv[0]); - return 1; - } - - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - printf("Lecture du fichier...\n"); - // Lecture du fichier et conversion en bits - const char *input_filename = argv[1]; - bit_array input_bits = file_to_bits(input_filename); - size_t nb_symbols = input_bits.nb_bits / qam.k; - - printf("Mise en forme des symboles...\n"); - // Mise en forme des symboles - double complex *symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits.bits, input_bits.nb_bits, symbols); - - printf("Modulation...\n"); - // Modulation QAM - int total_samples = qam.N * nb_symbols; - double complex* s = (double complex*)malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne avant échelle - double snr_dB = 10; // Signal to noise ratio - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - printf("Ajout du bruit... \n puissance du signal : %f\n SNR db : %f\n sigma : %f\n", signal_power, snr_dB, sigma); - add_noise(s, total_samples, 0); - - printf("Demodulation...\n"); - - // Demodulation QAM - bit_array output_bits; - output_bits.nb_bits = input_bits.nb_bits; - output_bits.bits = (uint8_t*)malloc(output_bits.nb_bits * sizeof(uint8_t)); - demodulate(&qam, s, nb_symbols, output_bits.bits); - - printf("Ecriture...\n"); - // Ecriture du fichier de Demodulation - char *output_filename = make_output_filename(input_filename); - bits_to_file(output_filename, &output_bits); - - // Affichage du signal dans un .wav - /* - double* si = (double*)malloc(sizeof(double) * total_samples); - for (int i = 0; i < total_samples; i++) { - si[i] = cimag(s[i]); - } - write_wav("output.wav", si, total_samples); - */ - - size_t erreurs = 0; - double fiabilite = compare_bits( input_bits.bits, input_bits.nb_bits, output_bits.bits, output_bits.nb_bits, &erreurs); - - printf("Comparaison :\n"); - printf(" Bits d'entrée : %zu\n", input_bits.nb_bits); - printf(" Bits de sortie: %zu\n", output_bits.nb_bits); - printf(" Erreurs : %zu\n", erreurs); - printf(" Fiabilité : %.4f %%\n", fiabilite); - - // Libération mémoire - free_bit_array(&input_bits); - free_bit_array(&output_bits); - free(symbols); - free(s); - free_constellation(&qam); - free(output_filename); - - return 0; -} diff --git a/QAM/OLD/qamold/qambis.c b/QAM/OLD/qamold/qambis.c deleted file mode 100644 index 96daebb..0000000 --- a/QAM/OLD/qamold/qambis.c +++ /dev/null @@ -1,237 +0,0 @@ -#include -#include -#include -#include -#include -#include "../wav/wav.h" -#include "../files/files.h" -#include "../plot/plot_constellation.h" -#include -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation - - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - /* - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); - double Ir = creal(r) * norm_factor / A; - double Qr = cimag(r) * norm_factor / A; - - int i = (int)round((Ir + (sm - 1)) / 2.0); - int j = (int)round((Qr + (sm - 1)) / 2.0); - - i = (i < 0) ? 0 : ((i >= sm) ? sm - 1 : i); - j = (j < 0) ? 0 : ((j >= sm) ? sm - 1 : j); - - int id = i * sm + j; - */ - - int id = i_cl * sm + j_cl; - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + (qam->k - 1 - b)] = (id >> b) & 1; - } - } -} - -double complex* demodulate_points(qam_system* qam, double complex* s, int nb_symbols) { - double complex* points = malloc(sizeof(double complex) * nb_symbols); - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); - double Ir = creal(r); - double Qr = cimag(r); - - points[k] = Ir + I * Qr; - } - return points; -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -int main (int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "Utilisation: %s \n", argv[0]); - return 1; - } - - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - printf("Lecture du fichier...\n"); - // Lecture du fichier et conversion en bits - const char *input_filename = argv[1]; - bit_array input_bits = file_to_bits(input_filename); - size_t nb_symbols = input_bits.nb_bits / qam.k; - - printf("Mise en forme des symboles...\n"); - // Mise en forme des symboles - double complex *symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits.bits, input_bits.nb_bits, symbols); - - printf("Modulation...\n"); - // Modulation QAM - int total_samples = qam.N * nb_symbols; - double complex* s = (double complex*)malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne avant échelle - double snr_dB = 10; // Signal to noise ratio - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - printf("Ajout du bruit... \n puissance du signal : %f\n SNR db : %f\n sigma : %f\n", signal_power, snr_dB, sigma); - add_noise(s, total_samples, sigma); - - printf("Demodulation...\n"); - - // Demodulation QAM - bit_array output_bits; - output_bits.nb_bits = input_bits.nb_bits; - output_bits.bits = (uint8_t*)malloc(output_bits.nb_bits); - demodulate(&qam, s, nb_symbols, output_bits.bits); - - printf("Ecriture...\n"); - // Ecriture du fichier de Demodulation - char *output_filename = make_output_filename(input_filename); - bits_to_file(output_filename, &output_bits); - - - // Affichage du signal dans un .wav - double* si = (double*)malloc(sizeof(double) * total_samples); - for (int i = 0; i < total_samples; i++) { - si[i] = cimag(s[i]); - } - write_wav("output.wav", si, total_samples); - - // Plot - printf("Ploting..."); - plot_t plot; - plot_init(&plot, 1400, 1400, 0.04); - plot_draw_constellation(&plot, qam.constellation, qam.M); - SDL_Color red = {255, 0, 0, 255}; - plot_draw_points_animated(&plot, demodulate_points(&qam, s, nb_symbols), nb_symbols, red, 5); - - // Libération mémoire - plot_close(&plot); - free_bit_array(&input_bits); - free_bit_array(&output_bits); - free(symbols); - free(s); - free_constellation(&qam); - free(output_filename); - - return 0; -} diff --git a/QAM/OLD/qamold/qambisbis.c b/QAM/OLD/qamold/qambisbis.c deleted file mode 100644 index 0e1c174..0000000 --- a/QAM/OLD/qamold/qambisbis.c +++ /dev/null @@ -1,324 +0,0 @@ -#include -#include -#include -#include -#include -#include "../wav/wav.h" -#include "../files/files.h" -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - //int i = k * qam->N + n; - //r += s[i] * cexp(-2 * I * M_PI * qam->Fc * ((double)i / qam->Fs)); - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation - - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - - /* - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); - double Ir = creal(r) * norm_factor / A; - double Qr = cimag(r) * norm_factor / A; - - int i = (int)round((Ir + (sm - 1)) / 2.0); - int j = (int)round((Qr + (sm - 1)) / 2.0); - - i = (i < 0) ? 0 : ((i >= sm) ? sm - 1 : i); - j = (j < 0) ? 0 : ((j >= sm) ? sm - 1 : j); - - int id = i * sm + j; - - int id = i_cl * sm + j_cl; - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + (qam->k - 1 - b)] = (id >> b) & 1; - } - */ - } -} - -double complex* demodulate_points(qam_system* qam, double complex* s, int nb_symbols) { - double complex* points = malloc(sizeof(double complex) * nb_symbols); - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - int i = k * qam->N + n; - r += s[i] * cexp(-2 * I * M_PI * qam->Fc * ((double)i / qam->Fs)); - } - r /= qam->N; - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); - double Ir = creal(r); - double Qr = cimag(r); - - - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - double complex p = qam->constellation[i_cl][j_cl]; - points[k] = creal(p) + I * cimag(p); - - //points[k] = (int)Ir + I * (int)Qr; - } - return points; -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -#include // pour size_t - -// Compare deux tableaux de bits (0/1) et retourne le pourcentage de fiabilité. -double compare_bits_and_get_reliability(const uint8_t *in_bits, size_t nb_bits_in, const uint8_t *out_bits, size_t nb_bits_out, size_t *erreurs) { - if (!in_bits || !out_bits) { - if (erreurs) *erreurs = (nb_bits_in < nb_bits_out) ? nb_bits_out : nb_bits_in; - return 0.0; - } - - size_t n_min = (nb_bits_in < nb_bits_out) ? nb_bits_in : nb_bits_out; - size_t n_max = (nb_bits_in > nb_bits_out) ? nb_bits_in : nb_bits_out; - - size_t err = 0; - for (size_t i = 0; i < n_min; ++i) { - if ((in_bits[i] & 1) != (out_bits[i] & 1)) err++; - } - - if (n_max != n_min) { - err += (n_max - n_min); - } - - if (erreurs) *erreurs = err; - - double total_compared = (double)n_max; - if (total_compared == 0.0) return 0.0; - - double ber = (double)err / total_compared; - double reliability_percent = (1.0 - ber) * 100.0; - return reliability_percent; -} - - -void affiche_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double complex p = qam->constellation[i][j]; - printf("(%d,%d) ", (int)creal(p), (int)cimag(p)); - } - printf("\n"); - } -} - -void affiche_points(double complex* r, int len, int len_samples) { - for (int i = 0; i < len; i += len_samples) { - for (int j = 0; j < len_samples; j++) { - double complex p = r[i + j]; - printf("(%f,%f) ", (float)creal(p), (float)cimag(p)); - } - printf("\n"); - } -} - -int main (int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "Utilisation: %s \n", argv[0]); - return 1; - } - - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - printf("Lecture du fichier...\n"); - // Lecture du fichier et conversion en bits - const char *input_filename = argv[1]; - bit_array input_bits = file_to_bits(input_filename); - size_t nb_symbols = input_bits.nb_bits / qam.k; - - printf("Mise en forme des symboles...\n"); - // Mise en forme des symboles - double complex *symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits.bits, input_bits.nb_bits, symbols); - - printf("Modulation...\n"); - // Modulation QAM - int total_samples = qam.N * nb_symbols; - double complex* s = (double complex*)malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne avant échelle - double snr_dB = 10; // Signal to noise ratio - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - printf("Ajout du bruit... \n puissance du signal : %f\n SNR db : %f\n sigma : %f\n", signal_power, snr_dB, sigma); - add_noise(s, total_samples, 5); - - printf("Demodulation...\n"); - - // Demodulation QAM - bit_array output_bits; - output_bits.nb_bits = input_bits.nb_bits; - output_bits.bits = (uint8_t*)malloc(output_bits.nb_bits); - demodulate(&qam, s, nb_symbols, output_bits.bits); - - printf("Ecriture...\n"); - // Ecriture du fichier de Demodulation - char *output_filename = make_output_filename(input_filename); - bits_to_file(output_filename, &output_bits); - - //printf("Constelattion :\n"); - //affiche_constellation(&qam); - //printf("Points de demodulation :\n"); - //affiche_points(demodulate_points(&qam, s, nb_symbols), nb_symbols, qam.N); - - // Affichage du signal dans un .wav - /* - double* si = (double*)malloc(sizeof(double) * total_samples); - for (int i = 0; i < total_samples; i++) { - si[i] = cimag(s[i]); - } - write_wav("output.wav", si, total_samples); - */ - - - size_t erreurs = 0; - double fiabilite = compare_bits_and_get_reliability( input_bits.bits, input_bits.nb_bits, output_bits.bits, output_bits.nb_bits, &erreurs); - - printf("Résultat de la comparaison :\n"); - printf(" Bits d'entrée : %zu\n", input_bits.nb_bits); - printf(" Bits de sortie: %zu\n", output_bits.nb_bits); - printf(" Erreurs : %zu\n", erreurs); - printf(" Fiabilité : %.4f %%\n", fiabilite); - - // Libération mémoire - free_bit_array(&input_bits); - free_bit_array(&output_bits); - free(symbols); - free(s); - free_constellation(&qam); - free(output_filename); - - return 0; -} diff --git a/QAM/OLD/qamold/qamclean.c b/QAM/OLD/qamold/qamclean.c deleted file mode 100644 index a63deb4..0000000 --- a/QAM/OLD/qamold/qamclean.c +++ /dev/null @@ -1,184 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { - int errors = 0; - for (int i = 0; i < nb_bits; i++) { - if (bits1[i] != bits2[i]) errors++; - } - return (double)errors / nb_bits; -} - -int main () { - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - int nb_bits = 1000; - int nb_symbols = nb_bits / qam.k; - - uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - for (int i = 0; i < nb_bits; i++) { - input_bits[i] = rand() % 2; - } - - // Conversion en symboles - double complex* symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits, nb_bits, symbols); - - // Modulation - int total_samples = qam.N * nb_symbols; - double complex* s = malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne - double snr_dB = 10; // SNR en dB - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - add_noise(s, total_samples, sigma); - - // Démodulation - uint8_t* output_bits = malloc(nb_bits * sizeof(uint8_t)); - demodulate(&qam, s, nb_symbols, output_bits); - - // Calcul du taux d'erreur - double ber = compare_bits(input_bits, output_bits, nb_bits); - printf("Taux d'erreur : %.4f\n", ber); - - // Libération mémoire - free(input_bits); - free(output_bits); - free(symbols); - free(s); - free_constellation(&qam); - - return 0; -} diff --git a/QAM/OLD/qamold/qamtest.c b/QAM/OLD/qamold/qamtest.c deleted file mode 100644 index 09bd9d4..0000000 --- a/QAM/OLD/qamold/qamtest.c +++ /dev/null @@ -1,328 +0,0 @@ -#include -#include -#include -#include -#include -#include "../files/files.h" -#include - -#define A 1 - -struct qam_system_s { - int M; // Nombre de symboles M-QAM - int k; // Nombre de bits/symboles - double Fs; // Fréquence d'échantillionage - double Ts; // Temps d'échantillionage - int N; // Nombre d'échantillions - double Fc; // Fréquence de la porteuse - double complex** constellation; // Tableau de symboles I + j Q -}; -typedef struct qam_system_s qam_system; - -// Initialisation de la constellation (double tableau de taille sqrt(M)), -// ToDo : changer à un tableau à 1 dimension pour éviter de calculer sqrt(M) -void init_constellation (qam_system* qam) { - int sm = (int)sqrt(qam->M); - qam->constellation = (double complex**)malloc(sizeof(double complex*) * sm); - - for (int i = 0; i < sm; i++) { - qam->constellation[i] = (double complex*)malloc(sizeof(double complex) * sm); - } - - double norm_factor = sqrt((double)(qam->M - 1) / 3.0); // Pour puissance unitaire - - for (int i = 0; i < sm; i++) { - double complex ip = -(sm - 1) + 2 * i; - for (int j = 0; j < sm; j++) { - double complex qp = -(sm - 1) + 2 * j; - qam->constellation[i][j] = (ip + I * qp); - } - } -} - -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - -// Modulation QAM -void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { - for (int k = 0; k < nb_symbols; k++) { - double complex iq = symbols[k]; - for (int n = 0; n < qam->N; n++) { - s[k * qam->N + n] = iq * cexp(2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - } -} - -// Demodulation QAM -void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n] * cexp(-2 * I * M_PI * qam->Fc * ((double)n / qam->Fs)); - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} - -// Demodulation QAM avec porteuse estimé -void demodulate2(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bits_hat) { - for (int k = 0; k < nb_symbols; k++) { - double complex r = 0; - for (int n = 0; n < qam->N; n++) { - r += s[k * qam->N + n]; - } - r /= qam->N; - - // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) - int sm = (int)sqrt(qam->M); - double min_d = INFINITY; - int i_cl, j_cl = 0; - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - double d = cabs(r - qam->constellation[i][j]); - if (d < min_d) { - min_d = d; - i_cl = i; - j_cl = j; - } - } - } - - // index du symbole (id) : même mappage que dans bits_to_symbols() - int id = i_cl * sm + j_cl; - - for (int b = 0; b < qam->k; b++) { - bits_hat[k * qam->k + b] = (id >> (qam->k - 1 - b)) & 1; - } - } -} -/* -// Pour j = 1 dans la def de wiki sur l'autocorrelation -double fc_autocorrelation_1_rad(double complex* s, int N) { - double complex r = 0; - for (int n = 0; n < N - 1; n++) { - r += s[n] * conj(s[n + 1]); - } - r /= (N - 1); - double om = -carg(r); // rad / sample - return om; -} - -// Autocorrelation pour trouver la Fc (fréquence de la porteuse) -double fc_autocorrelation_multilag_rad(double complex* s, int N, int max_lag) { - double sum_phase = 0; - for (int k = 1; k <= max_lag; k++) { - double complex rk = 0; - for (int n = 0; n < N - k; n++) { - rk += s[n] * conj(s[n + k]); - } - rk /= (double)(N - k); - sum_phase += -carg(rk) / k; - } - return sum_phase / max_lag; // rad/sample -} - -// Correction du signal pour enlever l'offset de la porteuse -void signal_correction(double complex* s, int total_samples, double om_hat) { - for (int n = 0; n < total_samples; n++) { - s[n] *= cexp(-I * om_hat * n); - } -} -*/ - -void blind_carrier(double complex* s, int N, int M) { - int k = (int)sqrt(M); // puissance à élever - double complex sum = 0; - for(int n = 0; n < N; n++) - sum += cpow(s[n], k); - - double phi_hat = carg(sum) / k; - - for(int n = 0; n < N; n++) - s[n] *= cexp(-I * phi_hat); -} - -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); -} - -// Compare deux tableaux de bits (0/1) et retourne le pourcentage de fiabilité. -double taux_erreur_bits(const uint8_t *in_bits, size_t nb_bits_in, - const uint8_t *out_bits, size_t nb_bits_out) { - if (!in_bits || !out_bits) - return 1.0; - - size_t n_min = nb_bits_in < nb_bits_out ? nb_bits_in : nb_bits_out; - size_t n_max = nb_bits_in > nb_bits_out ? nb_bits_in : nb_bits_out; - size_t err = n_max - n_min; - - for (size_t i = 0; i < n_min; i++) - err += ((in_bits[i] ^ out_bits[i]) & 1); - - return n_max ? (double)err / n_max : 0.0; -} - - -int main (int argc, char *argv[]) { - if (argc < 2) { - fprintf(stderr, "Utilisation: %s \n", argv[0]); - return 1; - } - - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.3; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); - - printf("Lecture du fichier...\n"); - // Lecture du fichier et conversion en bits - const char *input_filename = argv[1]; - bit_array input_bits = file_to_bits(input_filename); - size_t nb_symbols = input_bits.nb_bits / qam.k; - - printf("Mise en forme des symboles...\n"); - // Mise en forme des symboles - double complex *symbols = malloc(sizeof(double complex) * nb_symbols); - bits_to_symbols(&qam, input_bits.bits, input_bits.nb_bits, symbols); - - printf("Modulation...\n"); - // Modulation QAM - int total_samples = qam.N * nb_symbols; - double complex* s = (double complex*)malloc(sizeof(double complex) * total_samples); - modulate(&qam, symbols, nb_symbols, s); - - // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne avant échelle - double snr_dB = 10; // Signal to noise ratio - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - printf("Ajout du bruit... \n puissance du signal : %f\n SNR db : %f\n sigma : %f\n", signal_power, snr_dB, sigma); - add_noise(s, total_samples, 0); - - - // Demodulation QAM - //printf("Demodulation...\n"); - //bit_array output_bits; - //output_bits.nb_bits = input_bits.nb_bits; - //output_bits.bits = (uint8_t*)malloc(output_bits.nb_bits * sizeof(uint8_t)); - //demodulate(&qam, s, nb_symbols, output_bits.bits); - - //printf("Ecriture...\n"); - // Ecriture du fichier de Demodulation - //char *output_filename = make_output_filename(input_filename); - //bits_to_file(output_filename, &output_bits); - - //double erreurs = taux_erreur_bits(input_bits.bits, input_bits.nb_bits, output_bits.bits, output_bits.nb_bits); - - //printf("Comparaison :\n"); - //printf(" Erreurs : %f\n", erreurs * 100); - - /* - double om_hat = fc_autocorrelation_1_rad(s, total_samples); - printf("Estimation de fc 1: %f\n", (om_hat * qam.Fs) / (2 * M_PI)); - - om_hat = fc_autocorrelation_multilag_rad(s, total_samples, 10); - printf("Estimation de fc multilag: %f\n", (om_hat * qam.Fs) / (2 * M_PI)); - - // Correction du signal avec Fc (en rad/sample) trouvé - signal_correction(s, total_samples, om_hat); - - printf("Demodulation...\n"); - demodulate2(&qam, s, nb_symbols, output_bits.bits); - */ - - // Avant la demodulation - printf("Test de blind carrier correction...\n"); - - // Paramètres CMA simples - double mu = 0.001; // pas d'adaptation - int num_iter = 100; // nombre d'itérations - - // Appel de la fonction blind carrier correction - blind_carrier(s, total_samples, qam.M); - - // Ensuite, utilise ton démodulateur actuel - bit_array output_bits; - output_bits.nb_bits = input_bits.nb_bits; - output_bits.bits = (uint8_t*)malloc(output_bits.nb_bits * sizeof(uint8_t)); - - demodulate2(&qam, s, nb_symbols, output_bits.bits); - - // Comparaison avec bits originaux - double erreurs = taux_erreur_bits(input_bits.bits, input_bits.nb_bits, output_bits.bits, output_bits.nb_bits); - printf("Taux d'erreur après blind carrier correction: %f %%\n", erreurs * 100); - - // Ecriture du fichier de Demodulation - printf("Ecriture...\n"); - char *output_filename = make_output_filename(input_filename); - bits_to_file(output_filename, &output_bits); - - // Libération mémoire - free_bit_array(&input_bits); - free_bit_array(&output_bits); - free(symbols); - free(s); - free_constellation(&qam); - free(output_filename); - - return 0; -} diff --git a/QAM/constellation.dat b/QAM/constellation.dat deleted file mode 100644 index 46fab40..0000000 --- a/QAM/constellation.dat +++ /dev/null @@ -1,416 +0,0 @@ --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 - 0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 -1.34164079 --0.44721360 1.34164079 --1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 0.44721360 - 1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 0.44721360 --0.44721360 0.44721360 - 1.34164079 -1.34164079 --0.44721360 0.44721360 - 1.34164079 1.34164079 --0.44721360 0.44721360 - 1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 1.34164079 --0.44721360 0.44721360 - 0.44721360 -1.34164079 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 1.34164079 --1.34164079 1.34164079 --0.44721360 0.44721360 - 0.44721360 1.34164079 --0.44721360 1.34164079 - 0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 - 0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 -1.34164079 --0.44721360 1.34164079 --1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 0.44721360 - 1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 0.44721360 --0.44721360 0.44721360 - 1.34164079 -1.34164079 --0.44721360 0.44721360 - 1.34164079 1.34164079 --0.44721360 0.44721360 - 1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 1.34164079 --0.44721360 0.44721360 - 0.44721360 -1.34164079 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 1.34164079 --1.34164079 1.34164079 --0.44721360 0.44721360 - 0.44721360 1.34164079 --0.44721360 1.34164079 - 0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 - 0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 -1.34164079 --0.44721360 1.34164079 --1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 0.44721360 - 1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 0.44721360 --0.44721360 0.44721360 - 1.34164079 -1.34164079 --0.44721360 0.44721360 - 1.34164079 1.34164079 --0.44721360 0.44721360 - 1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 1.34164079 --0.44721360 0.44721360 - 0.44721360 -1.34164079 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 1.34164079 --1.34164079 1.34164079 --0.44721360 0.44721360 - 0.44721360 1.34164079 --0.44721360 1.34164079 - 0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 - 0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 -1.34164079 --0.44721360 1.34164079 --1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 0.44721360 - 1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 0.44721360 --0.44721360 0.44721360 - 1.34164079 -1.34164079 --0.44721360 0.44721360 - 1.34164079 1.34164079 --0.44721360 0.44721360 - 1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 1.34164079 --0.44721360 0.44721360 - 0.44721360 -1.34164079 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 1.34164079 --1.34164079 1.34164079 --0.44721360 0.44721360 - 0.44721360 1.34164079 --0.44721360 1.34164079 - 0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 - 0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 - 1.34164079 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 -1.34164079 --0.44721360 1.34164079 --1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 0.44721360 - 1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 1.34164079 --0.44721360 0.44721360 --0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 0.44721360 --0.44721360 0.44721360 - 1.34164079 -1.34164079 --0.44721360 0.44721360 - 1.34164079 1.34164079 --0.44721360 0.44721360 - 1.34164079 0.44721360 --0.44721360 0.44721360 --0.44721360 -1.34164079 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 1.34164079 --0.44721360 1.34164079 --0.44721360 0.44721360 - 0.44721360 -1.34164079 --0.44721360 0.44721360 - 0.44721360 -0.44721360 --0.44721360 1.34164079 --1.34164079 1.34164079 --0.44721360 0.44721360 - 0.44721360 1.34164079 --0.44721360 1.34164079 - 0.44721360 -0.44721360 --1.34164079 0.44721360 --1.34164079 -1.34164079 --0.44721360 0.44721360 --1.34164079 -0.44721360 --0.44721360 1.34164079 --1.34164079 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 -0.44721360 --0.44721360 1.34164079 --0.44721360 -0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 diff --git a/QAM/constellation_ref.dat b/QAM/constellation_ref.dat deleted file mode 100644 index 2c119c2..0000000 --- a/QAM/constellation_ref.dat +++ /dev/null @@ -1,16 +0,0 @@ --1.34164079 -1.34164079 --1.34164079 -0.44721360 --1.34164079 0.44721360 --1.34164079 1.34164079 --0.44721360 -1.34164079 --0.44721360 -0.44721360 --0.44721360 0.44721360 --0.44721360 1.34164079 - 0.44721360 -1.34164079 - 0.44721360 -0.44721360 - 0.44721360 0.44721360 - 0.44721360 1.34164079 - 1.34164079 -1.34164079 - 1.34164079 -0.44721360 - 1.34164079 0.44721360 - 1.34164079 1.34164079 diff --git a/QAM/pll_error.dat b/QAM/pll_error.dat deleted file mode 100644 index 8b71215..0000000 --- a/QAM/pll_error.dat +++ /dev/null @@ -1,1340 +0,0 @@ -0 0.12505052 -0.43290723 -0.46093357 -1 0.20027190 -0.46910233 0.42404178 -2 0.14703704 -0.46332838 0.43034317 -3 0.12763405 0.46121534 -0.43260702 -4 0.10595176 -0.45884729 0.43511790 -5 0.08902921 -0.45699349 0.43706449 -6 0.93644565 -1.34953022 0.42203116 -7 -0.91031593 -1.66537963 -0.90847483 -8 0.03543158 -0.45108398 0.44316099 -9 0.07287669 0.43891240 0.45521899 -10 -0.97301043 -0.46418438 1.33561783 -11 0.99575235 -0.25539153 -0.57848387 -12 0.33780842 -0.48395397 0.40700980 -13 -0.93894614 -0.42445859 1.34876871 -14 0.94591762 -0.56226018 0.28936467 -15 0.09709783 -0.43613775 -0.45787803 -16 0.97203526 -1.33610320 0.46278544 -17 -0.99080382 0.78501060 -1.72701308 -18 0.99990257 -1.30822851 0.53654476 -19 -0.99249072 -1.77407874 -0.67190806 -20 -0.68845745 -0.26682073 1.38857798 -21 0.76819156 -0.30719649 -1.38020739 -22 -0.67059341 -0.25836231 1.39017662 -23 0.80833575 -1.37500805 0.32968922 -24 -0.63886602 -0.36336315 0.51752840 -25 0.13229712 -0.43206445 -0.46172365 -26 0.00654034 -0.44787056 0.44640832 -27 0.95117092 1.34473532 -0.43706868 -28 -0.01665964 -0.00588936 1.41396868 -29 -0.98644354 -1.72125169 -0.79756406 -30 -0.17954931 -0.42651122 0.46685823 -31 0.11229260 -0.43438560 -0.45954061 -32 -0.96869564 -0.45816445 1.33769483 -33 0.99200165 0.26035122 0.57626874 -34 0.83199334 -1.37152465 0.34389281 -35 -0.72428728 -1.58379560 -1.04422570 -36 0.08796886 -0.45687716 0.43718610 -37 -0.00613552 -1.33936094 1.34347612 -38 0.01379809 -0.44867984 0.44559491 -39 0.00705261 -0.44635096 -0.44792772 -40 0.95801912 -1.34219953 0.44479493 -41 -0.97014660 -1.70493328 -0.83187638 -42 -0.15026057 -0.42996544 0.46367892 -43 0.93794025 -1.34907736 0.42347657 -44 -0.93271781 -0.29476770 0.55944653 -45 -0.04276875 1.32699657 -1.35569020 -46 0.05689815 -0.45345833 0.44073117 -47 0.02565687 1.33278746 1.34999755 -48 0.02674545 -0.45012011 0.44413996 -49 -0.96571521 1.33903346 0.45423729 -50 0.98540067 -0.57333526 0.26674915 -51 0.86601683 -0.36595934 -1.36580228 -52 0.78616547 -1.19856313 0.75019233 -53 -0.80775735 -1.84487540 -0.44187168 -54 0.09111117 0.03224929 1.41361314 -55 0.35703085 0.12887751 1.40809542 -56 -0.73464531 -0.12952203 0.61894464 -57 0.23465695 -0.08368195 -1.41150255 -58 -0.93211579 -0.18690462 0.60409857 -59 -0.69781577 0.35302977 -0.52463169 -60 -0.99958827 -0.53172113 1.31019646 -61 0.96275419 -1.79819730 0.60440241 -62 0.77499398 -0.53450921 0.33788805 -63 0.96023977 0.44742762 1.34132421 -64 0.01576077 0.00557157 1.41396997 -65 -0.99536200 0.25599110 -0.57821880 -66 0.99874609 -1.31302060 0.52470852 -67 -0.99988964 -1.75533418 -0.71945654 -68 -0.33278481 -0.40765458 0.48341097 -69 -0.99388785 -1.32081094 -0.50477775 -70 -0.17596470 -0.95465833 1.04305780 -71 0.37215532 -0.90012304 -1.09046808 -72 0.20588765 -1.05030314 0.94668127 -73 0.88904145 -0.17098986 -0.60879462 -74 0.85890972 -0.54651768 0.31809881 -75 -0.11543753 -0.45988423 -0.43402180 -76 -0.93729224 -0.42284790 1.34927453 -77 0.91068212 -0.30270203 -0.55519357 -78 -0.94879043 -0.43450523 1.34556580 -79 -0.60807420 0.82386116 -1.14917140 -80 -0.76128104 -1.38102611 -0.30349465 -81 -0.29373436 1.89178775 0.14126191 -82 -0.20233826 -1.04944461 -0.94763291 -83 -0.97403460 0.82480125 -1.70836726 -84 0.47445416 0.49884936 -0.38861002 -85 0.47769349 -0.38815047 -0.49920701 -86 0.39152200 -0.39998695 -0.48977429 -87 0.32559798 0.40857366 0.48263442 -88 0.27153960 -0.41536798 -0.47679961 -89 0.22690907 -0.42083416 -0.47198203 -90 0.88939234 -0.38260598 -1.36123282 -91 -0.73099923 1.04034822 -1.58634529 -92 0.25718824 -0.41713891 -0.47525105 -93 0.10256472 -0.45847667 0.43550840 -94 -0.98500739 -1.32856795 -0.48399310 -95 0.99878127 0.58715913 -0.23476068 -96 0.52236877 -0.38167869 -0.50417239 -97 -0.94358816 -1.34730165 -0.42909251 -98 0.96106865 -0.28225282 -0.56586374 -99 0.15693264 0.46440407 -0.42918211 -100 0.97093374 -0.46123325 -1.33663982 -101 -0.98753994 1.72260926 0.79462769 -102 0.99884687 -0.52538308 -1.31275083 -103 -0.99745223 0.69457331 -1.76532822 -104 -0.74024075 -1.38339947 -0.29248592 -105 0.65377377 1.39160462 -0.25055679 -106 -0.88471694 -1.36219719 -0.37915819 -107 0.23822990 -0.08497952 -1.41142502 -108 0.78261300 -0.33626335 -0.53553280 -109 -0.05850357 0.44054883 -0.45363548 -110 0.00511424 -0.44656797 -0.44771137 -111 0.96237212 0.45002262 1.34045580 -112 0.07641874 -1.41372241 0.02703837 -113 -0.99503051 0.68204975 -1.77020449 -114 -0.47311517 -0.49870160 -0.38879961 -115 0.15261123 0.46393447 -0.42968970 -116 -0.96484461 -1.33941148 -0.45312141 -117 0.98810525 -0.57444347 0.26435416 -118 0.84853116 -0.35434475 -1.36886154 -119 -0.76498876 1.01994284 -1.59954131 -120 0.07330905 -0.43886306 -0.45526656 -121 -0.00284555 -1.34237404 -1.34046550 -122 0.01288829 -0.44569696 -0.44857847 -123 0.00716452 0.44794021 -0.44633843 -124 0.95805200 -0.44483343 -1.34218677 -125 -0.97020795 0.83176850 -1.70498592 -126 -0.15052368 -0.46370753 -0.42993459 -127 0.93793485 -0.42347132 -1.34907900 -128 -0.93272175 -0.55944734 -0.29476618 -129 -0.04280706 1.35570292 1.32698357 -130 0.05688131 -0.44073308 -0.45345647 -131 0.02563908 -1.34999162 1.33279347 -132 0.02673143 -0.44414154 -0.45011856 -133 -0.96571210 -0.45423328 1.33903482 -134 0.98539538 -0.26675360 -0.57333318 -135 0.86603637 1.36579871 -0.36597268 -136 0.78611556 -0.75021653 -1.19854799 -137 -0.80774018 0.44185825 -1.84487861 -138 0.09117233 -1.41361264 0.03227100 -139 0.35717911 -1.40809030 0.12893339 -140 -0.73438050 -0.61895727 -0.12946165 -141 0.23544866 1.41148548 -0.08396938 -142 -0.93137888 -0.60419332 -0.18659810 -143 -0.70019425 0.52492505 0.35259341 -144 -0.99957646 -1.31025074 -0.53158736 -145 0.96285186 -0.60456491 -1.79814268 -146 0.77471763 -0.33794646 -0.53447227 -147 0.96024221 -1.34132323 0.44743055 -148 0.01567613 -1.41397009 0.00554165 -149 -0.99533314 0.57819963 0.25603439 -150 0.99872738 -0.52458629 -1.31306943 -151 -0.99989703 0.71967859 -1.75524316 -152 -0.33219294 -0.48334700 -0.40773042 -153 -0.99387810 0.50474858 -1.32082209 -154 -0.17607070 -1.04308350 -0.95463025 -155 0.37218604 1.09047553 -0.90011402 -156 0.20589124 -0.94668031 -1.05030401 -157 0.88903867 0.60879488 -0.17098894 -158 0.85891826 -0.31809653 -0.54651900 -159 -0.11542562 0.43402318 -0.45988293 -160 -0.93729254 -1.34927444 -0.42284820 -161 0.91068397 0.55519391 -0.30270141 -162 -0.94879205 -1.34556524 -0.43450696 -163 -0.60806605 1.14916928 0.82386411 -164 -0.76128237 0.30349535 -1.38102595 -165 -0.29373959 -0.14126450 1.89178755 -166 -0.20232393 0.94763675 -1.04944114 -167 -0.97403518 1.70836779 0.82480016 -168 0.47445263 0.38861023 0.49884919 -169 0.47769396 0.49920706 -0.38815040 -170 0.39152229 0.48977433 -0.39998692 -171 0.32559821 -0.48263445 0.40857363 -172 0.27153979 0.47679963 -0.41536795 -173 0.22690923 0.47198205 -0.42083414 -174 0.88939228 1.36123283 -0.38260594 -175 -0.73099896 1.58634519 1.04034838 -176 0.25718842 0.47525107 -0.41713888 -177 0.10256477 -0.43550840 -0.45847667 -178 -0.98500740 0.48399312 -1.32856794 -179 0.99878127 0.23476066 0.58715914 -180 0.52236897 0.50417241 -0.38167866 -181 -0.94358817 0.42909252 -1.34730165 -182 0.96106868 0.56586374 -0.28225281 -183 0.15693273 0.42918210 0.46440408 -184 0.97093374 1.33663982 -0.46123325 -185 -0.98753994 -0.79462769 1.72260925 -186 0.99884687 1.31275083 -0.52538307 -187 -0.99745223 1.76532821 0.69457333 -188 -0.74024080 0.29248595 -1.38339947 -189 0.65377365 0.25055674 1.39160463 -190 -0.88471710 0.37915831 -1.36219716 -191 0.23822930 1.41142504 -0.08497930 -192 0.78261395 0.53553293 -0.33626315 -193 -0.05850317 0.45363544 0.44054888 -194 0.00511410 0.44771135 -0.44656799 -195 0.96237212 -1.34045580 0.45002262 -196 0.07641879 -0.02703839 -1.41372241 -197 -0.99503050 1.77020452 0.68204967 -198 -0.47311539 0.38879958 -0.49870163 -199 0.15261124 0.42968970 0.46393447 -200 -0.96484461 0.45312141 -1.33941148 -201 0.98810525 -0.26435417 -0.57444347 -202 0.84853117 1.36886154 -0.35434476 -203 -0.76498881 1.59954133 1.01994281 -204 0.07330903 0.45526656 -0.43886306 -205 -0.00284555 1.34046550 -1.34237404 -206 0.01288829 0.44857847 -0.44569696 -207 0.00716452 0.44633843 0.44794021 -208 0.95805200 1.34218677 -0.44483343 -209 -0.97020796 1.70498592 0.83176850 -210 -0.15052369 0.42993459 -0.46370753 -211 0.93793485 1.34907900 -0.42347132 -212 -0.93272175 0.29476618 -0.55944734 -213 -0.04280706 -1.32698357 1.35570292 -214 0.05688131 0.45345647 -0.44073308 -215 0.02563908 -1.33279347 -1.34999162 -216 0.02673143 0.45011856 -0.44414154 -217 -0.96571210 -1.33903482 -0.45423328 -218 0.98539538 0.57333318 -0.26675360 -219 0.86603637 0.36597269 1.36579871 -220 0.78611556 1.19854799 -0.75021653 -221 -0.80774018 1.84487861 0.44185825 -222 0.09117233 -0.03227100 -1.41361264 -223 0.35717911 -0.12893339 -1.40809030 -224 -0.73438050 0.12946164 -0.61895727 -225 0.23544867 0.08396938 1.41148548 -226 -0.93137887 0.18659810 -0.60419332 -227 -0.70019429 -0.35259341 0.52492506 -228 -0.99957646 0.53158736 -1.31025074 -229 0.96285186 1.79814267 -0.60456491 -230 0.77471763 0.53447227 -0.33794646 -231 0.96024221 -0.44743055 -1.34132323 -232 0.01567612 -0.00554165 -1.41397009 -233 -0.99533314 -0.25603439 0.57819963 -234 0.99872738 1.31306943 -0.52458629 -235 -0.99989703 1.75524315 0.71967860 -236 -0.33219293 0.40773042 -0.48334700 -237 -0.99387810 1.32082209 0.50474858 -238 -0.17607070 0.95463025 -1.04308350 -239 0.37218604 0.90011401 1.09047553 -240 0.20589124 1.05030401 -0.94668031 -241 0.88903867 0.17098894 0.60879488 -242 0.85891826 0.54651900 -0.31809653 -243 -0.11542562 0.45988293 0.43402318 -244 -0.93729254 0.42284820 -1.34927444 -245 0.91068397 0.30270141 0.55519391 -246 -0.94879205 0.43450696 -1.34556524 -247 -0.60806605 -0.82386411 1.14916928 -248 -0.76128237 1.38102595 0.30349535 -249 -0.29373959 -1.89178755 -0.14126450 -250 -0.20232393 1.04944114 0.94763675 -251 -0.97403518 -0.82480016 1.70836779 -252 0.47445263 -0.49884919 0.38861023 -253 0.47769396 0.38815040 0.49920706 -254 0.39152229 0.39998692 0.48977433 -255 0.32559821 -0.40857363 -0.48263445 -256 0.27153979 0.41536795 0.47679963 -257 0.22690923 0.42083414 0.47198205 -258 0.88939228 0.38260594 1.36123283 -259 -0.73099896 -1.04034838 1.58634519 -260 0.25718842 0.41713888 0.47525107 -261 0.10256477 0.45847667 -0.43550840 -262 -0.98500740 1.32856794 0.48399312 -263 0.99878127 -0.58715914 0.23476066 -264 0.52236897 0.38167866 0.50417241 -265 -0.94358817 1.34730165 0.42909252 -266 0.96106868 0.28225281 0.56586374 -267 0.15693273 -0.46440408 0.42918210 -268 0.97093374 0.46123325 1.33663982 -269 -0.98753994 -1.72260925 -0.79462769 -270 0.99884687 0.52538307 1.31275083 -271 -0.99745223 -0.69457333 1.76532821 -272 -0.74024080 1.38339947 0.29248595 -273 0.65377365 -1.39160463 0.25055674 -274 -0.88471710 1.36219716 0.37915831 -275 0.23822930 0.08497930 1.41142504 -276 0.78261395 0.33626315 0.53553293 -277 -0.05850317 -0.44054888 0.45363544 -278 0.00511410 0.44656799 0.44771135 -279 0.96237212 -0.45002262 -1.34045580 -280 0.07641879 1.41372241 -0.02703839 -281 -0.99503050 -0.68204967 1.77020452 -282 -0.47311539 0.49870163 0.38879958 -283 0.15261124 -0.46393447 0.42968970 -284 -0.96484461 1.33941148 0.45312141 -285 0.98810525 0.57444347 -0.26435417 -286 0.84853117 0.35434476 1.36886154 -287 -0.76498881 -1.01994281 1.59954133 -288 0.07330903 0.43886306 0.45526656 -289 -0.00284555 1.34237404 1.34046550 -290 0.01288829 0.44569696 0.44857847 -291 0.00716452 -0.44794021 0.44633843 -292 0.95805200 0.44483343 1.34218677 -293 -0.97020796 -0.83176850 1.70498592 -294 -0.15052369 0.46370753 0.42993459 -295 0.93793485 0.42347132 1.34907900 -296 -0.93272175 0.55944734 0.29476618 -297 -0.04280706 -1.35570292 -1.32698357 -298 0.05688131 0.44073308 0.45345647 -299 0.02563908 1.34999162 -1.33279347 -300 0.02673143 0.44414154 0.45011856 -301 -0.96571210 0.45423328 -1.33903482 -302 0.98539538 0.26675360 0.57333318 -303 0.86603637 -1.36579871 0.36597269 -304 0.78611556 0.75021653 1.19854799 -305 -0.80774018 -0.44185825 1.84487861 -306 0.09117233 1.41361264 -0.03227100 -307 0.35717911 1.40809030 -0.12893339 -308 -0.73438050 0.61895727 0.12946164 -309 0.23544867 -1.41148548 0.08396938 -310 -0.93137887 0.60419332 0.18659810 -311 -0.70019429 -0.52492506 -0.35259341 -312 -0.99957646 1.31025074 0.53158736 -313 0.96285186 0.60456491 1.79814267 -314 0.77471763 0.33794646 0.53447227 -315 0.96024221 1.34132323 -0.44743055 -316 0.01567612 1.41397009 -0.00554165 -317 -0.99533314 -0.57819963 -0.25603439 -318 0.99872738 0.52458629 1.31306943 -319 -0.99989703 -0.71967860 1.75524315 -320 -0.33219293 0.48334700 0.40773042 -321 -0.99387810 -0.50474858 1.32082209 -322 -0.17607070 1.04308350 0.95463025 -323 0.37218604 -1.09047553 0.90011401 -324 0.20589124 0.94668031 1.05030401 -325 0.88903867 -0.60879488 0.17098894 -326 0.85891826 0.31809653 0.54651900 -327 -0.11542562 -0.43402318 0.45988293 -328 -0.93729254 1.34927444 0.42284820 -329 0.91068397 -0.55519391 0.30270141 -330 -0.94879205 1.34556524 0.43450696 -331 -0.60806605 -1.14916928 -0.82386411 -332 -0.76128237 -0.30349535 1.38102595 -333 -0.29373959 0.14126450 -1.89178755 -334 -0.20232393 -0.94763675 1.04944114 -335 -0.97403518 -1.70836779 -0.82480016 -336 0.47445263 -0.38861023 -0.49884919 -337 0.47769396 -0.49920706 0.38815040 -338 0.39152229 -0.48977433 0.39998692 -339 0.32559821 0.48263445 -0.40857363 -340 0.27153979 -0.47679963 0.41536795 -341 0.22690923 -0.47198205 0.42083414 -342 0.88939228 -1.36123283 0.38260594 -343 -0.73099896 -1.58634519 -1.04034838 -344 0.25718842 -0.47525107 0.41713888 -345 0.10256477 0.43550840 0.45847667 -346 -0.98500740 -0.48399312 1.32856794 -347 0.99878127 -0.23476066 -0.58715914 -348 0.52236897 -0.50417241 0.38167866 -349 -0.94358817 -0.42909252 1.34730165 -350 0.96106868 -0.56586374 0.28225281 -351 0.15693273 -0.42918210 -0.46440408 -352 0.97093374 -1.33663982 0.46123325 -353 -0.98753994 0.79462769 -1.72260925 -354 0.99884687 -1.31275083 0.52538307 -355 -0.99745223 -1.76532821 -0.69457333 -356 -0.74024080 -0.29248595 1.38339947 -357 0.65377365 -0.25055674 -1.39160463 -358 -0.88471710 -0.37915831 1.36219716 -359 0.23822930 -1.41142504 0.08497930 -360 0.78261395 -0.53553293 0.33626315 -361 -0.05850317 -0.45363544 -0.44054888 -362 0.00511410 -0.44771135 0.44656799 -363 0.96237212 1.34045580 -0.45002262 -364 0.07641879 0.02703839 1.41372241 -365 -0.99503050 -1.77020452 -0.68204967 -366 -0.47311539 -0.38879958 0.49870163 -367 0.15261124 -0.42968970 -0.46393447 -368 -0.96484461 -0.45312141 1.33941148 -369 0.98810525 0.26435417 0.57444347 -370 0.84853117 -1.36886154 0.35434476 -371 -0.76498881 -1.59954133 -1.01994281 -372 0.07330903 -0.45526656 0.43886306 -373 -0.00284555 -1.34046550 1.34237404 -374 0.01288829 -0.44857847 0.44569696 -375 0.00716452 -0.44633843 -0.44794021 -376 0.95805200 -1.34218677 0.44483343 -377 -0.97020796 -1.70498592 -0.83176850 -378 -0.15052369 -0.42993459 0.46370753 -379 0.93793485 -1.34907900 0.42347132 -380 -0.93272175 -0.29476618 0.55944734 -381 -0.04280706 1.32698357 -1.35570292 -382 0.05688131 -0.45345647 0.44073308 -383 0.02563908 1.33279347 1.34999162 -384 0.02673143 -0.45011856 0.44414154 -385 -0.96571210 1.33903482 0.45423328 -386 0.98539538 -0.57333318 0.26675360 -387 0.86603637 -0.36597269 -1.36579871 -388 0.78611556 -1.19854799 0.75021653 -389 -0.80774018 -1.84487861 -0.44185825 -390 0.09117233 0.03227100 1.41361264 -391 0.35717911 0.12893339 1.40809030 -392 -0.73438050 -0.12946164 0.61895727 -393 0.23544867 -0.08396938 -1.41148548 -394 -0.93137887 -0.18659810 0.60419332 -395 -0.70019429 0.35259341 -0.52492505 -396 -0.99957646 -0.53158736 1.31025074 -397 0.96285186 -1.79814267 0.60456491 -398 0.77471763 -0.53447227 0.33794646 -399 0.96024221 0.44743055 1.34132323 -400 0.01567612 0.00554165 1.41397009 -401 -0.99533314 0.25603439 -0.57819963 -402 0.99872738 -1.31306943 0.52458629 -403 -0.99989703 -1.75524315 -0.71967860 -404 -0.33219293 -0.40773042 0.48334700 -405 -0.99387810 -1.32082209 -0.50474858 -406 -0.17607070 -0.95463025 1.04308350 -407 0.37218604 -0.90011401 -1.09047553 -408 0.20589124 -1.05030401 0.94668031 -409 0.88903867 -0.17098894 -0.60879488 -410 0.85891826 -0.54651900 0.31809653 -411 -0.11542562 -0.45988293 -0.43402318 -412 -0.93729254 -0.42284820 1.34927444 -413 0.91068397 -0.30270141 -0.55519391 -414 -0.94879205 -0.43450696 1.34556524 -415 -0.60806605 0.82386411 -1.14916928 -416 -0.76128237 -1.38102595 -0.30349535 -417 -0.29373959 1.89178755 0.14126450 -418 -0.20232393 -1.04944114 -0.94763675 -419 -0.97403518 0.82480016 -1.70836779 -420 0.47445263 0.49884919 -0.38861023 -421 0.47769396 -0.38815040 -0.49920706 -422 0.39152229 -0.39998692 -0.48977433 -423 0.32559821 0.40857363 0.48263445 -424 0.27153979 -0.41536795 -0.47679963 -425 0.22690923 -0.42083414 -0.47198205 -426 0.88939228 -0.38260594 -1.36123283 -427 -0.73099896 1.04034838 -1.58634519 -428 0.25718842 -0.41713888 -0.47525107 -429 0.10256477 -0.45847667 0.43550840 -430 -0.98500740 -1.32856794 -0.48399312 -431 0.99878127 0.58715914 -0.23476066 -432 0.52236897 -0.38167866 -0.50417241 -433 -0.94358817 -1.34730165 -0.42909252 -434 0.96106868 -0.28225281 -0.56586374 -435 0.15693273 0.46440408 -0.42918210 -436 0.97093374 -0.46123325 -1.33663982 -437 -0.98753994 1.72260925 0.79462769 -438 0.99884687 -0.52538307 -1.31275083 -439 -0.99745223 0.69457333 -1.76532821 -440 -0.74024080 -1.38339947 -0.29248595 -441 0.65377365 1.39160463 -0.25055674 -442 -0.88471710 -1.36219716 -0.37915831 -443 0.23822930 -0.08497930 -1.41142504 -444 0.78261395 -0.33626315 -0.53553293 -445 -0.05850317 0.44054888 -0.45363544 -446 0.00511410 -0.44656799 -0.44771135 -447 0.96237212 0.45002262 1.34045580 -448 0.07641879 -1.41372241 0.02703839 -449 -0.99503050 0.68204967 -1.77020452 -450 -0.47311539 -0.49870163 -0.38879958 -451 0.15261124 0.46393447 -0.42968970 -452 -0.96484461 -1.33941148 -0.45312141 -453 0.98810525 -0.57444347 0.26435417 -454 0.84853117 -0.35434476 -1.36886154 -455 -0.76498881 1.01994281 -1.59954133 -456 0.07330903 -0.43886306 -0.45526656 -457 -0.00284555 -1.34237404 -1.34046550 -458 0.01288829 -0.44569696 -0.44857847 -459 0.00716452 0.44794021 -0.44633843 -460 0.95805200 -0.44483343 -1.34218677 -461 -0.97020796 0.83176850 -1.70498592 -462 -0.15052369 -0.46370753 -0.42993459 -463 0.93793485 -0.42347132 -1.34907900 -464 -0.93272175 -0.55944734 -0.29476618 -465 -0.04280706 1.35570292 1.32698357 -466 0.05688131 -0.44073308 -0.45345647 -467 0.02563908 -1.34999162 1.33279347 -468 0.02673143 -0.44414154 -0.45011856 -469 -0.96571210 -0.45423328 1.33903482 -470 0.98539538 -0.26675360 -0.57333318 -471 0.86603637 1.36579871 -0.36597269 -472 0.78611556 -0.75021653 -1.19854799 -473 -0.80774018 0.44185825 -1.84487861 -474 0.09117233 -1.41361264 0.03227100 -475 0.35717911 -1.40809030 0.12893339 -476 -0.73438050 -0.61895727 -0.12946164 -477 0.23544867 1.41148548 -0.08396938 -478 -0.93137887 -0.60419332 -0.18659810 -479 -0.70019429 0.52492505 0.35259341 -480 -0.99957646 -1.31025074 -0.53158736 -481 0.96285186 -0.60456491 -1.79814267 -482 0.77471763 -0.33794646 -0.53447227 -483 0.96024221 -1.34132323 0.44743055 -484 0.01567612 -1.41397009 0.00554165 -485 -0.99533314 0.57819963 0.25603439 -486 0.99872738 -0.52458629 -1.31306943 -487 -0.99989703 0.71967860 -1.75524315 -488 -0.33219293 -0.48334700 -0.40773042 -489 -0.99387810 0.50474858 -1.32082209 -490 -0.17607070 -1.04308350 -0.95463025 -491 0.37218604 1.09047553 -0.90011401 -492 0.20589124 -0.94668031 -1.05030401 -493 0.88903867 0.60879488 -0.17098894 -494 0.85891826 -0.31809653 -0.54651900 -495 -0.11542562 0.43402318 -0.45988293 -496 -0.93729254 -1.34927444 -0.42284820 -497 0.91068397 0.55519391 -0.30270141 -498 -0.94879205 -1.34556524 -0.43450696 -499 -0.60806605 1.14916928 0.82386411 -500 -0.76128237 0.30349535 -1.38102595 -501 -0.29373959 -0.14126450 1.89178755 -502 -0.20232393 0.94763675 -1.04944114 -503 -0.97403518 1.70836779 0.82480016 -504 0.47445263 0.38861023 0.49884919 -505 0.47769396 0.49920706 -0.38815040 -506 0.39152229 0.48977433 -0.39998692 -507 0.32559821 -0.48263445 0.40857363 -508 0.27153979 0.47679963 -0.41536795 -509 0.22690923 0.47198205 -0.42083414 -510 0.88939228 1.36123283 -0.38260594 -511 -0.73099896 1.58634519 1.04034838 -512 0.25718842 0.47525107 -0.41713888 -513 0.10256477 -0.43550840 -0.45847667 -514 -0.98500740 0.48399312 -1.32856794 -515 0.99878127 0.23476066 0.58715914 -516 0.52236897 0.50417241 -0.38167866 -517 -0.94358817 0.42909252 -1.34730165 -518 0.96106868 0.56586374 -0.28225281 -519 0.15693273 0.42918210 0.46440408 -520 0.97093374 1.33663982 -0.46123325 -521 -0.98753994 -0.79462769 1.72260925 -522 0.99884687 1.31275083 -0.52538307 -523 -0.99745223 1.76532821 0.69457333 -524 -0.74024080 0.29248595 -1.38339947 -525 0.65377365 0.25055674 1.39160463 -526 -0.88471710 0.37915831 -1.36219716 -527 0.23822930 1.41142504 -0.08497930 -528 0.78261395 0.53553293 -0.33626315 -529 -0.05850317 0.45363544 0.44054888 -530 0.00511410 0.44771135 -0.44656799 -531 0.96237212 -1.34045580 0.45002262 -532 0.07641879 -0.02703839 -1.41372241 -533 -0.99503050 1.77020452 0.68204967 -534 -0.47311539 0.38879958 -0.49870163 -535 0.15261124 0.42968970 0.46393447 -536 -0.96484461 0.45312141 -1.33941148 -537 0.98810525 -0.26435417 -0.57444347 -538 0.84853117 1.36886154 -0.35434476 -539 -0.76498881 1.59954133 1.01994281 -540 0.07330903 0.45526656 -0.43886306 -541 -0.00284555 1.34046550 -1.34237404 -542 0.01288829 0.44857847 -0.44569696 -543 0.00716452 0.44633843 0.44794021 -544 0.95805200 1.34218677 -0.44483343 -545 -0.97020796 1.70498592 0.83176850 -546 -0.15052369 0.42993459 -0.46370753 -547 0.93793485 1.34907900 -0.42347132 -548 -0.93272175 0.29476618 -0.55944734 -549 -0.04280706 -1.32698357 1.35570292 -550 0.05688131 0.45345647 -0.44073308 -551 0.02563908 -1.33279347 -1.34999162 -552 0.02673143 0.45011856 -0.44414154 -553 -0.96571210 -1.33903482 -0.45423328 -554 0.98539538 0.57333318 -0.26675360 -555 0.86603637 0.36597269 1.36579871 -556 0.78611556 1.19854799 -0.75021653 -557 -0.80774018 1.84487861 0.44185825 -558 0.09117233 -0.03227100 -1.41361264 -559 0.35717911 -0.12893339 -1.40809030 -560 -0.73438050 0.12946164 -0.61895727 -561 0.23544867 0.08396938 1.41148548 -562 -0.93137887 0.18659810 -0.60419332 -563 -0.70019429 -0.35259341 0.52492505 -564 -0.99957646 0.53158736 -1.31025074 -565 0.96285186 1.79814267 -0.60456491 -566 0.77471763 0.53447227 -0.33794646 -567 0.96024221 -0.44743055 -1.34132323 -568 0.01567612 -0.00554165 -1.41397009 -569 -0.99533314 -0.25603439 0.57819963 -570 0.99872738 1.31306943 -0.52458629 -571 -0.99989703 1.75524315 0.71967860 -572 -0.33219293 0.40773042 -0.48334700 -573 -0.99387810 1.32082209 0.50474858 -574 -0.17607070 0.95463025 -1.04308350 -575 0.37218604 0.90011401 1.09047553 -576 0.20589124 1.05030401 -0.94668031 -577 0.88903867 0.17098894 0.60879488 -578 0.85891826 0.54651900 -0.31809653 -579 -0.11542562 0.45988293 0.43402318 -580 -0.93729254 0.42284820 -1.34927444 -581 0.91068397 0.30270141 0.55519391 -582 -0.94879205 0.43450696 -1.34556524 -583 -0.60806605 -0.82386411 1.14916928 -584 -0.76128237 1.38102595 0.30349535 -585 -0.29373959 -1.89178755 -0.14126450 -586 -0.20232393 1.04944114 0.94763675 -587 -0.97403518 -0.82480016 1.70836779 -588 0.47445263 -0.49884919 0.38861023 -589 0.47769396 0.38815040 0.49920706 -590 0.39152229 0.39998692 0.48977433 -591 0.32559821 -0.40857363 -0.48263445 -592 0.27153979 0.41536795 0.47679963 -593 0.22690923 0.42083414 0.47198205 -594 0.88939228 0.38260594 1.36123283 -595 -0.73099897 -1.04034838 1.58634519 -596 0.25718842 0.41713888 0.47525107 -597 0.10256477 0.45847667 -0.43550840 -598 -0.98500740 1.32856794 0.48399312 -599 0.99878127 -0.58715914 0.23476066 -600 0.52236897 0.38167866 0.50417241 -601 -0.94358817 1.34730165 0.42909252 -602 0.96106868 0.28225281 0.56586374 -603 0.15693273 -0.46440408 0.42918210 -604 0.97093374 0.46123325 1.33663982 -605 -0.98753994 -1.72260925 -0.79462769 -606 0.99884687 0.52538307 1.31275083 -607 -0.99745223 -0.69457333 1.76532821 -608 -0.74024080 1.38339947 0.29248595 -609 0.65377365 -1.39160463 0.25055674 -610 -0.88471710 1.36219716 0.37915831 -611 0.23822930 0.08497930 1.41142504 -612 0.78261395 0.33626315 0.53553293 -613 -0.05850317 -0.44054888 0.45363544 -614 0.00511410 0.44656799 0.44771135 -615 0.96237212 -0.45002262 -1.34045580 -616 0.07641879 1.41372241 -0.02703839 -617 -0.99503050 -0.68204967 1.77020452 -618 -0.47311539 0.49870163 0.38879958 -619 0.15261124 -0.46393447 0.42968970 -620 -0.96484461 1.33941148 0.45312141 -621 0.98810525 0.57444347 -0.26435417 -622 0.84853117 0.35434476 1.36886154 -623 -0.76498881 -1.01994281 1.59954133 -624 0.07330903 0.43886306 0.45526656 -625 -0.00284555 1.34237404 1.34046550 -626 0.01288829 0.44569696 0.44857847 -627 0.00716452 -0.44794021 0.44633843 -628 0.95805200 0.44483343 1.34218677 -629 -0.97020796 -0.83176850 1.70498592 -630 -0.15052369 0.46370753 0.42993459 -631 0.93793485 0.42347132 1.34907900 -632 -0.93272175 0.55944734 0.29476618 -633 -0.04280706 -1.35570292 -1.32698357 -634 0.05688131 0.44073308 0.45345647 -635 0.02563908 1.34999162 -1.33279347 -636 0.02673143 0.44414154 0.45011856 -637 -0.96571210 0.45423328 -1.33903482 -638 0.98539538 0.26675360 0.57333318 -639 0.86603637 -1.36579871 0.36597269 -640 0.78611556 0.75021653 1.19854799 -641 -0.80774018 -0.44185825 1.84487861 -642 0.09117233 1.41361264 -0.03227100 -643 0.35717911 1.40809030 -0.12893339 -644 -0.73438050 0.61895727 0.12946164 -645 0.23544867 -1.41148548 0.08396938 -646 -0.93137887 0.60419332 0.18659810 -647 -0.70019429 -0.52492506 -0.35259341 -648 -0.99957646 1.31025074 0.53158736 -649 0.96285186 0.60456491 1.79814267 -650 0.77471763 0.33794646 0.53447227 -651 0.96024221 1.34132323 -0.44743055 -652 0.01567612 1.41397009 -0.00554165 -653 -0.99533314 -0.57819963 -0.25603439 -654 0.99872738 0.52458629 1.31306943 -655 -0.99989703 -0.71967860 1.75524315 -656 -0.33219293 0.48334700 0.40773042 -657 -0.99387810 -0.50474858 1.32082209 -658 -0.17607070 1.04308350 0.95463025 -659 0.37218604 -1.09047553 0.90011401 -660 0.20589124 0.94668031 1.05030401 -661 0.88903867 -0.60879488 0.17098894 -662 0.85891826 0.31809653 0.54651900 -663 -0.11542562 -0.43402318 0.45988293 -664 -0.93729254 1.34927444 0.42284820 -665 0.91068397 -0.55519391 0.30270141 -666 -0.94879205 1.34556524 0.43450696 -667 -0.60806605 -1.14916928 -0.82386411 -668 -0.76128237 -0.30349535 1.38102595 -669 -0.29373959 0.14126450 -1.89178755 -670 -0.20232393 -0.94763675 1.04944114 -671 -0.97403518 -1.70836779 -0.82480016 -672 0.47445263 -0.38861023 -0.49884919 -673 0.47769396 -0.49920706 0.38815040 -674 0.39152229 -0.48977433 0.39998692 -675 0.32559821 0.48263445 -0.40857363 -676 0.27153979 -0.47679963 0.41536795 -677 0.22690923 -0.47198205 0.42083414 -678 0.88939228 -1.36123283 0.38260594 -679 -0.73099897 -1.58634519 -1.04034838 -680 0.25718842 -0.47525107 0.41713888 -681 0.10256477 0.43550840 0.45847667 -682 -0.98500740 -0.48399312 1.32856794 -683 0.99878127 -0.23476066 -0.58715914 -684 0.52236897 -0.50417241 0.38167866 -685 -0.94358817 -0.42909252 1.34730165 -686 0.96106868 -0.56586374 0.28225281 -687 0.15693273 -0.42918210 -0.46440408 -688 0.97093374 -1.33663982 0.46123325 -689 -0.98753994 0.79462769 -1.72260925 -690 0.99884687 -1.31275083 0.52538307 -691 -0.99745223 -1.76532821 -0.69457333 -692 -0.74024080 -0.29248595 1.38339947 -693 0.65377365 -0.25055674 -1.39160463 -694 -0.88471710 -0.37915831 1.36219716 -695 0.23822930 -1.41142504 0.08497930 -696 0.78261395 -0.53553293 0.33626315 -697 -0.05850317 -0.45363544 -0.44054888 -698 0.00511410 -0.44771135 0.44656799 -699 0.96237212 1.34045580 -0.45002262 -700 0.07641879 0.02703839 1.41372241 -701 -0.99503050 -1.77020452 -0.68204967 -702 -0.47311539 -0.38879958 0.49870163 -703 0.15261123 -0.42968970 -0.46393447 -704 -0.96484461 -0.45312141 1.33941148 -705 0.98810525 0.26435417 0.57444347 -706 0.84853117 -1.36886154 0.35434476 -707 -0.76498881 -1.59954133 -1.01994281 -708 0.07330903 -0.45526656 0.43886306 -709 -0.00284555 -1.34046550 1.34237404 -710 0.01288829 -0.44857847 0.44569696 -711 0.00716452 -0.44633843 -0.44794021 -712 0.95805200 -1.34218677 0.44483343 -713 -0.97020796 -1.70498592 -0.83176850 -714 -0.15052369 -0.42993459 0.46370753 -715 0.93793485 -1.34907900 0.42347132 -716 -0.93272175 -0.29476618 0.55944734 -717 -0.04280706 1.32698357 -1.35570292 -718 0.05688131 -0.45345647 0.44073308 -719 0.02563908 1.33279347 1.34999162 -720 0.02673143 -0.45011856 0.44414154 -721 -0.96571210 1.33903482 0.45423328 -722 0.98539538 -0.57333318 0.26675360 -723 0.86603637 -0.36597269 -1.36579871 -724 0.78611556 -1.19854799 0.75021653 -725 -0.80774018 -1.84487861 -0.44185825 -726 0.09117233 0.03227100 1.41361264 -727 0.35717911 0.12893339 1.40809030 -728 -0.73438050 -0.12946164 0.61895727 -729 0.23544867 -0.08396938 -1.41148548 -730 -0.93137887 -0.18659810 0.60419332 -731 -0.70019429 0.35259341 -0.52492505 -732 -0.99957646 -0.53158736 1.31025074 -733 0.96285186 -1.79814267 0.60456491 -734 0.77471763 -0.53447227 0.33794646 -735 0.96024221 0.44743055 1.34132323 -736 0.01567612 0.00554165 1.41397009 -737 -0.99533314 0.25603439 -0.57819963 -738 0.99872738 -1.31306943 0.52458629 -739 -0.99989703 -1.75524315 -0.71967860 -740 -0.33219293 -0.40773042 0.48334700 -741 -0.99387810 -1.32082209 -0.50474858 -742 -0.17607070 -0.95463025 1.04308350 -743 0.37218604 -0.90011401 -1.09047553 -744 0.20589124 -1.05030401 0.94668031 -745 0.88903867 -0.17098894 -0.60879488 -746 0.85891826 -0.54651900 0.31809653 -747 -0.11542562 -0.45988293 -0.43402318 -748 -0.93729254 -0.42284820 1.34927444 -749 0.91068397 -0.30270141 -0.55519391 -750 -0.94879205 -0.43450696 1.34556524 -751 -0.60806605 0.82386411 -1.14916928 -752 -0.76128237 -1.38102595 -0.30349535 -753 -0.29373959 1.89178755 0.14126450 -754 -0.20232393 -1.04944114 -0.94763675 -755 -0.97403518 0.82480016 -1.70836779 -756 0.47445263 0.49884919 -0.38861023 -757 0.47769396 -0.38815040 -0.49920706 -758 0.39152229 -0.39998692 -0.48977433 -759 0.32559821 0.40857363 0.48263445 -760 0.27153979 -0.41536795 -0.47679963 -761 0.22690923 -0.42083414 -0.47198205 -762 0.88939228 -0.38260594 -1.36123283 -763 -0.73099896 1.04034838 -1.58634519 -764 0.25718842 -0.41713888 -0.47525107 -765 0.10256477 -0.45847667 0.43550840 -766 -0.98500740 -1.32856794 -0.48399312 -767 0.99878127 0.58715914 -0.23476066 -768 0.52236897 -0.38167866 -0.50417241 -769 -0.94358817 -1.34730165 -0.42909252 -770 0.96106868 -0.28225281 -0.56586374 -771 0.15693273 0.46440408 -0.42918210 -772 0.97093374 -0.46123325 -1.33663982 -773 -0.98753994 1.72260925 0.79462769 -774 0.99884687 -0.52538307 -1.31275083 -775 -0.99745223 0.69457333 -1.76532821 -776 -0.74024080 -1.38339947 -0.29248595 -777 0.65377365 1.39160463 -0.25055674 -778 -0.88471710 -1.36219716 -0.37915831 -779 0.23822930 -0.08497930 -1.41142504 -780 0.78261395 -0.33626315 -0.53553293 -781 -0.05850317 0.44054888 -0.45363544 -782 0.00511410 -0.44656799 -0.44771135 -783 0.96237212 0.45002262 1.34045580 -784 0.07641879 -1.41372241 0.02703839 -785 -0.99503050 0.68204967 -1.77020452 -786 -0.47311539 -0.49870163 -0.38879958 -787 0.15261124 0.46393447 -0.42968970 -788 -0.96484461 -1.33941148 -0.45312141 -789 0.98810525 -0.57444347 0.26435417 -790 0.84853117 -0.35434476 -1.36886154 -791 -0.76498881 1.01994281 -1.59954133 -792 0.07330903 -0.43886306 -0.45526656 -793 -0.00284555 -1.34237404 -1.34046550 -794 0.01288829 -0.44569696 -0.44857847 -795 0.00716452 0.44794021 -0.44633843 -796 0.95805200 -0.44483343 -1.34218677 -797 -0.97020796 0.83176850 -1.70498592 -798 -0.15052369 -0.46370753 -0.42993459 -799 0.93793485 -0.42347132 -1.34907900 -800 -0.93272175 -0.55944734 -0.29476618 -801 -0.04280706 1.35570292 1.32698357 -802 0.05688131 -0.44073308 -0.45345647 -803 0.02563908 -1.34999162 1.33279347 -804 0.02673143 -0.44414154 -0.45011856 -805 -0.96571210 -0.45423328 1.33903482 -806 0.98539538 -0.26675360 -0.57333318 -807 0.86603637 1.36579871 -0.36597269 -808 0.78611556 -0.75021653 -1.19854799 -809 -0.80774018 0.44185825 -1.84487861 -810 0.09117233 -1.41361264 0.03227100 -811 0.35717911 -1.40809030 0.12893339 -812 -0.73438050 -0.61895727 -0.12946164 -813 0.23544867 1.41148548 -0.08396938 -814 -0.93137887 -0.60419332 -0.18659810 -815 -0.70019429 0.52492505 0.35259341 -816 -0.99957646 -1.31025074 -0.53158736 -817 0.96285186 -0.60456491 -1.79814267 -818 0.77471763 -0.33794646 -0.53447227 -819 0.96024221 -1.34132323 0.44743055 -820 0.01567612 -1.41397009 0.00554165 -821 -0.99533314 0.57819963 0.25603439 -822 0.99872738 -0.52458629 -1.31306943 -823 -0.99989703 0.71967860 -1.75524315 -824 -0.33219293 -0.48334700 -0.40773042 -825 -0.99387810 0.50474858 -1.32082209 -826 -0.17607070 -1.04308350 -0.95463025 -827 0.37218604 1.09047553 -0.90011401 -828 0.20589124 -0.94668031 -1.05030401 -829 0.88903867 0.60879488 -0.17098894 -830 0.85891826 -0.31809653 -0.54651900 -831 -0.11542562 0.43402318 -0.45988293 -832 -0.93729254 -1.34927444 -0.42284820 -833 0.91068397 0.55519391 -0.30270141 -834 -0.94879205 -1.34556524 -0.43450696 -835 -0.60806605 1.14916928 0.82386411 -836 -0.76128237 0.30349535 -1.38102595 -837 -0.29373959 -0.14126450 1.89178755 -838 -0.20232393 0.94763675 -1.04944114 -839 -0.97403518 1.70836779 0.82480016 -840 0.47445263 0.38861023 0.49884919 -841 0.47769396 0.49920706 -0.38815040 -842 0.39152229 0.48977433 -0.39998692 -843 0.32559821 -0.48263445 0.40857363 -844 0.27153979 0.47679963 -0.41536795 -845 0.22690923 0.47198205 -0.42083414 -846 0.88939228 1.36123283 -0.38260594 -847 -0.73099897 1.58634519 1.04034838 -848 0.25718842 0.47525107 -0.41713888 -849 0.10256477 -0.43550840 -0.45847667 -850 -0.98500740 0.48399312 -1.32856794 -851 0.99878127 0.23476066 0.58715914 -852 0.52236897 0.50417241 -0.38167866 -853 -0.94358817 0.42909252 -1.34730165 -854 0.96106868 0.56586374 -0.28225281 -855 0.15693273 0.42918210 0.46440408 -856 0.97093374 1.33663982 -0.46123325 -857 -0.98753994 -0.79462769 1.72260925 -858 0.99884687 1.31275083 -0.52538307 -859 -0.99745223 1.76532821 0.69457333 -860 -0.74024080 0.29248595 -1.38339947 -861 0.65377365 0.25055674 1.39160463 -862 -0.88471710 0.37915831 -1.36219716 -863 0.23822930 1.41142504 -0.08497930 -864 0.78261395 0.53553293 -0.33626315 -865 -0.05850317 0.45363544 0.44054888 -866 0.00511410 0.44771135 -0.44656799 -867 0.96237212 -1.34045580 0.45002262 -868 0.07641879 -0.02703839 -1.41372241 -869 -0.99503050 1.77020452 0.68204967 -870 -0.47311539 0.38879958 -0.49870163 -871 0.15261124 0.42968970 0.46393447 -872 -0.96484461 0.45312141 -1.33941148 -873 0.98810525 -0.26435417 -0.57444347 -874 0.84853117 1.36886154 -0.35434476 -875 -0.76498881 1.59954133 1.01994281 -876 0.07330903 0.45526656 -0.43886306 -877 -0.00284555 1.34046550 -1.34237404 -878 0.01288829 0.44857847 -0.44569696 -879 0.00716452 0.44633843 0.44794021 -880 0.95805200 1.34218677 -0.44483343 -881 -0.97020796 1.70498592 0.83176850 -882 -0.15052369 0.42993459 -0.46370753 -883 0.93793485 1.34907900 -0.42347132 -884 -0.93272175 0.29476618 -0.55944734 -885 -0.04280706 -1.32698357 1.35570292 -886 0.05688131 0.45345647 -0.44073308 -887 0.02563908 -1.33279347 -1.34999162 -888 0.02673143 0.45011856 -0.44414154 -889 -0.96571210 -1.33903482 -0.45423328 -890 0.98539538 0.57333318 -0.26675360 -891 0.86603637 0.36597269 1.36579871 -892 0.78611556 1.19854799 -0.75021653 -893 -0.80774018 1.84487861 0.44185825 -894 0.09117233 -0.03227100 -1.41361264 -895 0.35717911 -0.12893339 -1.40809030 -896 -0.73438050 0.12946164 -0.61895727 -897 0.23544867 0.08396938 1.41148548 -898 -0.93137887 0.18659810 -0.60419332 -899 -0.70019429 -0.35259341 0.52492506 -900 -0.99957646 0.53158736 -1.31025074 -901 0.96285186 1.79814267 -0.60456491 -902 0.77471763 0.53447227 -0.33794646 -903 0.96024221 -0.44743055 -1.34132323 -904 0.01567612 -0.00554165 -1.41397009 -905 -0.99533314 -0.25603439 0.57819963 -906 0.99872738 1.31306943 -0.52458629 -907 -0.99989703 1.75524315 0.71967860 -908 -0.33219293 0.40773042 -0.48334700 -909 -0.99387810 1.32082209 0.50474858 -910 -0.17607070 0.95463025 -1.04308350 -911 0.37218604 0.90011401 1.09047553 -912 0.20589124 1.05030401 -0.94668031 -913 0.88903867 0.17098894 0.60879488 -914 0.85891826 0.54651900 -0.31809653 -915 -0.11542562 0.45988293 0.43402318 -916 -0.93729254 0.42284820 -1.34927444 -917 0.91068397 0.30270141 0.55519391 -918 -0.94879205 0.43450696 -1.34556524 -919 -0.60806605 -0.82386411 1.14916928 -920 -0.76128237 1.38102595 0.30349535 -921 -0.29373959 -1.89178755 -0.14126450 -922 -0.20232393 1.04944114 0.94763675 -923 -0.97403518 -0.82480016 1.70836779 -924 0.47445263 -0.49884919 0.38861023 -925 0.47769396 0.38815040 0.49920706 -926 0.39152229 0.39998692 0.48977433 -927 0.32559821 -0.40857363 -0.48263445 -928 0.27153979 0.41536795 0.47679963 -929 0.22690923 0.42083414 0.47198205 -930 0.88939228 0.38260594 1.36123283 -931 -0.73099896 -1.04034838 1.58634519 -932 0.25718842 0.41713888 0.47525107 -933 0.10256477 0.45847667 -0.43550840 -934 -0.98500740 1.32856794 0.48399312 -935 0.99878127 -0.58715914 0.23476066 -936 0.52236897 0.38167866 0.50417241 -937 -0.94358817 1.34730165 0.42909252 -938 0.96106868 0.28225281 0.56586374 -939 0.15693273 -0.46440408 0.42918210 -940 0.97093374 0.46123325 1.33663982 -941 -0.98753994 -1.72260925 -0.79462769 -942 0.99884687 0.52538307 1.31275083 -943 -0.99745223 -0.69457333 1.76532821 -944 -0.74024080 1.38339947 0.29248595 -945 0.65377365 -1.39160463 0.25055674 -946 -0.88471710 1.36219716 0.37915831 -947 0.23822930 0.08497930 1.41142504 -948 0.78261395 0.33626315 0.53553293 -949 -0.05850317 -0.44054888 0.45363544 -950 0.00511410 0.44656799 0.44771135 -951 0.96237212 -0.45002262 -1.34045580 -952 0.07641879 1.41372241 -0.02703839 -953 -0.99503050 -0.68204967 1.77020452 -954 -0.47311539 0.49870163 0.38879958 -955 0.15261124 -0.46393447 0.42968970 -956 -0.96484461 1.33941148 0.45312141 -957 0.98810525 0.57444347 -0.26435417 -958 0.84853117 0.35434476 1.36886154 -959 -0.76498881 -1.01994281 1.59954133 -960 0.07330903 0.43886306 0.45526656 -961 -0.00284555 1.34237404 1.34046550 -962 0.01288829 0.44569696 0.44857847 -963 0.00716452 -0.44794021 0.44633843 -964 0.95805200 0.44483343 1.34218677 -965 -0.97020796 -0.83176850 1.70498592 -966 -0.15052369 0.46370753 0.42993459 -967 0.93793485 0.42347132 1.34907900 -968 -0.93272175 0.55944734 0.29476618 -969 -0.04280706 -1.35570292 -1.32698357 -970 0.05688131 0.44073308 0.45345647 -971 0.02563908 1.34999162 -1.33279347 -972 0.02673143 0.44414154 0.45011856 -973 -0.96571210 0.45423328 -1.33903482 -974 0.98539538 0.26675360 0.57333318 -975 0.86603637 -1.36579871 0.36597269 -976 0.78611556 0.75021653 1.19854799 -977 -0.80774018 -0.44185825 1.84487861 -978 0.09117233 1.41361264 -0.03227100 -979 0.35717911 1.40809030 -0.12893339 -980 -0.73438050 0.61895727 0.12946164 -981 0.23544867 -1.41148548 0.08396938 -982 -0.93137887 0.60419332 0.18659810 -983 -0.70019429 -0.52492505 -0.35259341 -984 -0.99957646 1.31025074 0.53158736 -985 0.96285186 0.60456491 1.79814267 -986 0.77471763 0.33794646 0.53447227 -987 0.96024221 1.34132323 -0.44743055 -988 0.01567612 1.41397009 -0.00554165 -989 -0.99533314 -0.57819963 -0.25603439 -990 0.99872738 0.52458629 1.31306943 -991 -0.99989703 -0.71967860 1.75524315 -992 -0.33219293 0.48334700 0.40773042 -993 -0.99387810 -0.50474858 1.32082209 -994 -0.17607070 1.04308350 0.95463025 -995 0.37218604 -1.09047553 0.90011401 -996 0.20589124 0.94668031 1.05030401 -997 0.88903867 -0.60879488 0.17098894 -998 0.85891826 0.31809653 0.54651900 -999 -0.11542562 -0.43402318 0.45988293 -1000 -0.93729254 1.34927444 0.42284820 -1001 0.91068397 -0.55519391 0.30270141 -1002 -0.94879205 1.34556524 0.43450696 -1003 -0.60806605 -1.14916928 -0.82386411 -1004 -0.76128237 -0.30349535 1.38102595 -1005 -0.29373959 0.14126450 -1.89178755 -1006 -0.20232393 -0.94763675 1.04944114 -1007 -0.97403518 -1.70836779 -0.82480016 -1008 0.47445263 -0.38861023 -0.49884919 -1009 0.47769396 -0.49920706 0.38815040 -1010 0.39152229 -0.48977433 0.39998692 -1011 0.32559821 0.48263445 -0.40857363 -1012 0.27153979 -0.47679963 0.41536795 -1013 0.22690923 -0.47198205 0.42083414 -1014 0.88939228 -1.36123283 0.38260594 -1015 -0.73099896 -1.58634519 -1.04034838 -1016 0.25718842 -0.47525107 0.41713888 -1017 0.10256477 0.43550840 0.45847667 -1018 -0.98500740 -0.48399312 1.32856794 -1019 0.99878127 -0.23476066 -0.58715914 -1020 0.52236897 -0.50417241 0.38167866 -1021 -0.94358817 -0.42909252 1.34730165 -1022 0.96106868 -0.56586374 0.28225281 -1023 0.15693273 -0.42918210 -0.46440408 -1024 0.97093374 -1.33663982 0.46123325 -1025 -0.98753994 0.79462769 -1.72260925 -1026 0.99884687 -1.31275083 0.52538307 -1027 -0.99745223 -1.76532821 -0.69457333 -1028 -0.74024080 -0.29248595 1.38339947 -1029 0.65377365 -0.25055674 -1.39160463 -1030 -0.88471710 -0.37915831 1.36219716 -1031 0.23822930 -1.41142504 0.08497930 -1032 0.78261395 -0.53553293 0.33626315 -1033 -0.05850317 -0.45363544 -0.44054888 -1034 0.00511410 -0.44771135 0.44656799 -1035 0.96237212 1.34045580 -0.45002262 -1036 0.07641879 0.02703839 1.41372241 -1037 -0.99503050 -1.77020452 -0.68204967 -1038 -0.47311539 -0.38879958 0.49870163 -1039 0.15261124 -0.42968970 -0.46393447 -1040 -0.96484461 -0.45312141 1.33941148 -1041 0.98810525 0.26435417 0.57444347 -1042 0.84853117 -1.36886154 0.35434476 -1043 -0.76498881 -1.59954133 -1.01994281 -1044 0.07330903 -0.45526656 0.43886306 -1045 -0.00284555 -1.34046550 1.34237404 -1046 0.01288829 -0.44857847 0.44569696 -1047 0.00716452 -0.44633843 -0.44794021 -1048 0.95805200 -1.34218677 0.44483343 -1049 -0.97020796 -1.70498592 -0.83176850 -1050 -0.15052369 -0.42993459 0.46370753 -1051 0.93793485 -1.34907900 0.42347132 -1052 -0.93272175 -0.29476618 0.55944734 -1053 -0.04280706 1.32698357 -1.35570292 -1054 0.05688131 -0.45345647 0.44073308 -1055 0.02563908 1.33279347 1.34999162 -1056 0.02673143 -0.45011856 0.44414154 -1057 -0.96571210 1.33903482 0.45423328 -1058 0.98539538 -0.57333318 0.26675360 -1059 0.86603637 -0.36597269 -1.36579871 -1060 0.78611556 -1.19854799 0.75021653 -1061 -0.80774018 -1.84487861 -0.44185825 -1062 0.09117233 0.03227100 1.41361264 -1063 0.35717911 0.12893339 1.40809030 -1064 -0.73438050 -0.12946164 0.61895727 -1065 0.23544868 -0.08396938 -1.41148548 -1066 -0.93137887 -0.18659810 0.60419332 -1067 -0.70019430 0.35259340 -0.52492506 -1068 -0.99957646 -0.53158736 1.31025074 -1069 0.96285186 -1.79814267 0.60456491 -1070 0.77471763 -0.53447227 0.33794646 -1071 0.96024221 0.44743055 1.34132323 -1072 0.01567612 0.00554165 1.41397009 -1073 -0.99533314 0.25603439 -0.57819963 -1074 0.99872738 -1.31306943 0.52458629 -1075 -0.99989703 -1.75524315 -0.71967860 -1076 -0.33219293 -0.40773042 0.48334700 -1077 -0.99387810 -1.32082209 -0.50474858 -1078 -0.17607070 -0.95463025 1.04308350 -1079 0.37218604 -0.90011401 -1.09047553 -1080 0.20589124 -1.05030401 0.94668031 -1081 0.88903867 -0.17098894 -0.60879488 -1082 0.85891826 -0.54651900 0.31809653 -1083 -0.11542562 -0.45988293 -0.43402318 -1084 -0.93729254 -0.42284820 1.34927444 -1085 0.91068397 -0.30270141 -0.55519391 -1086 -0.94879205 -0.43450696 1.34556524 -1087 -0.60806605 0.82386411 -1.14916928 -1088 -0.76128237 -1.38102595 -0.30349535 -1089 -0.29373959 1.89178755 0.14126450 -1090 -0.20232393 -1.04944114 -0.94763675 -1091 -0.97403518 0.82480016 -1.70836779 -1092 0.47445263 0.49884919 -0.38861023 -1093 0.47769396 -0.38815040 -0.49920706 -1094 0.39152229 -0.39998692 -0.48977433 -1095 0.32559821 0.40857363 0.48263445 -1096 0.27153979 -0.41536795 -0.47679963 -1097 0.22690923 -0.42083414 -0.47198205 -1098 0.88939228 -0.38260594 -1.36123283 -1099 -0.73099896 1.04034838 -1.58634519 -1100 0.25718842 -0.41713888 -0.47525107 -1101 0.10256477 -0.45847667 0.43550840 -1102 -0.98500740 -1.32856794 -0.48399312 -1103 0.99878127 0.58715914 -0.23476066 -1104 0.52236897 -0.38167866 -0.50417241 -1105 -0.94358817 -1.34730165 -0.42909252 -1106 0.96106868 -0.28225281 -0.56586374 -1107 0.15693273 0.46440408 -0.42918210 -1108 0.97093374 -0.46123325 -1.33663982 -1109 -0.98753994 1.72260925 0.79462769 -1110 0.99884687 -0.52538307 -1.31275083 -1111 -0.99745223 0.69457333 -1.76532821 -1112 -0.74024080 -1.38339947 -0.29248595 -1113 0.65377365 1.39160463 -0.25055674 -1114 -0.88471710 -1.36219716 -0.37915831 -1115 0.23822930 -0.08497930 -1.41142504 -1116 0.78261395 -0.33626315 -0.53553293 -1117 -0.05850317 0.44054888 -0.45363544 -1118 0.00511410 -0.44656799 -0.44771135 -1119 0.96237212 0.45002262 1.34045580 -1120 0.07641879 -1.41372241 0.02703839 -1121 -0.99503050 0.68204967 -1.77020452 -1122 -0.47311539 -0.49870163 -0.38879958 -1123 0.15261124 0.46393447 -0.42968970 -1124 -0.96484461 -1.33941148 -0.45312141 -1125 0.98810525 -0.57444347 0.26435417 -1126 0.84853117 -0.35434476 -1.36886154 -1127 -0.76498881 1.01994281 -1.59954133 -1128 0.07330903 -0.43886306 -0.45526656 -1129 -0.00284555 -1.34237404 -1.34046550 -1130 0.01288829 -0.44569696 -0.44857847 -1131 0.00716452 0.44794021 -0.44633843 -1132 0.95805200 -0.44483343 -1.34218677 -1133 -0.97020796 0.83176850 -1.70498592 -1134 -0.15052369 -0.46370753 -0.42993459 -1135 0.93793485 -0.42347132 -1.34907900 -1136 -0.93272175 -0.55944734 -0.29476618 -1137 -0.04280706 1.35570292 1.32698357 -1138 0.05688131 -0.44073308 -0.45345647 -1139 0.02563908 -1.34999162 1.33279347 -1140 0.02673143 -0.44414154 -0.45011856 -1141 -0.96571210 -0.45423328 1.33903482 -1142 0.98539538 -0.26675360 -0.57333318 -1143 0.86603637 1.36579871 -0.36597269 -1144 0.78611556 -0.75021653 -1.19854799 -1145 -0.80774018 0.44185825 -1.84487861 -1146 0.09117233 -1.41361264 0.03227100 -1147 0.35717911 -1.40809030 0.12893339 -1148 -0.73438050 -0.61895727 -0.12946164 -1149 0.23544867 1.41148548 -0.08396938 -1150 -0.93137887 -0.60419332 -0.18659810 -1151 -0.70019429 0.52492506 0.35259341 -1152 -0.99957646 -1.31025074 -0.53158736 -1153 0.96285186 -0.60456491 -1.79814267 -1154 0.77471763 -0.33794646 -0.53447227 -1155 0.96024221 -1.34132323 0.44743055 -1156 0.01567612 -1.41397009 0.00554165 -1157 -0.99533314 0.57819963 0.25603439 -1158 0.99872738 -0.52458629 -1.31306943 -1159 -0.99989703 0.71967860 -1.75524315 -1160 -0.33219293 -0.48334700 -0.40773042 -1161 -0.99387810 0.50474858 -1.32082209 -1162 -0.17607070 -1.04308350 -0.95463025 -1163 0.37218604 1.09047553 -0.90011401 -1164 0.20589124 -0.94668031 -1.05030401 -1165 0.88903867 0.60879488 -0.17098894 -1166 0.85891826 -0.31809653 -0.54651900 -1167 -0.11542562 0.43402318 -0.45988293 -1168 -0.93729254 -1.34927444 -0.42284820 -1169 0.91068397 0.55519391 -0.30270141 -1170 -0.94879205 -1.34556524 -0.43450696 -1171 -0.60806605 1.14916928 0.82386411 -1172 -0.76128237 0.30349535 -1.38102595 -1173 -0.29373959 -0.14126450 1.89178755 -1174 -0.20232393 0.94763675 -1.04944114 -1175 -0.97403518 1.70836779 0.82480016 -1176 0.47445263 0.38861023 0.49884919 -1177 0.47769396 0.49920706 -0.38815040 -1178 0.39152229 0.48977433 -0.39998692 -1179 0.32559821 -0.48263445 0.40857363 -1180 0.27153979 0.47679963 -0.41536795 -1181 0.22690923 0.47198205 -0.42083414 -1182 0.88939228 1.36123283 -0.38260594 -1183 -0.73099897 1.58634519 1.04034838 -1184 0.25718842 0.47525107 -0.41713888 -1185 0.10256477 -0.43550840 -0.45847667 -1186 -0.98500740 0.48399312 -1.32856794 -1187 0.99878127 0.23476066 0.58715914 -1188 0.52236897 0.50417241 -0.38167866 -1189 -0.94358817 0.42909252 -1.34730165 -1190 0.96106868 0.56586374 -0.28225281 -1191 0.15693273 0.42918210 0.46440408 -1192 0.97093374 1.33663982 -0.46123325 -1193 -0.98753994 -0.79462769 1.72260925 -1194 0.99884687 1.31275083 -0.52538307 -1195 -0.99745223 1.76532821 0.69457333 -1196 -0.74024080 0.29248595 -1.38339947 -1197 0.65377365 0.25055674 1.39160463 -1198 -0.88471710 0.37915831 -1.36219716 -1199 0.23822930 1.41142504 -0.08497930 -1200 0.78261395 0.53553293 -0.33626315 -1201 -0.05850317 0.45363544 0.44054888 -1202 0.00511410 0.44771135 -0.44656799 -1203 0.96237212 -1.34045580 0.45002262 -1204 0.07641879 -0.02703839 -1.41372241 -1205 -0.99503050 1.77020452 0.68204967 -1206 -0.47311539 0.38879958 -0.49870163 -1207 0.15261123 0.42968970 0.46393447 -1208 -0.96484461 0.45312141 -1.33941148 -1209 0.98810525 -0.26435417 -0.57444347 -1210 0.84853117 1.36886154 -0.35434476 -1211 -0.76498881 1.59954133 1.01994281 -1212 0.07330903 0.45526656 -0.43886306 -1213 -0.00284555 1.34046550 -1.34237404 -1214 0.01288829 0.44857847 -0.44569696 -1215 0.00716452 0.44633843 0.44794021 -1216 0.95805200 1.34218677 -0.44483343 -1217 -0.97020796 1.70498592 0.83176850 -1218 -0.15052369 0.42993459 -0.46370753 -1219 0.93793485 1.34907900 -0.42347132 -1220 -0.93272175 0.29476618 -0.55944734 -1221 -0.04280706 -1.32698357 1.35570292 -1222 0.05688131 0.45345647 -0.44073308 -1223 0.02563908 -1.33279347 -1.34999162 -1224 0.02673143 0.45011856 -0.44414154 -1225 -0.96571210 -1.33903482 -0.45423328 -1226 0.98539538 0.57333318 -0.26675360 -1227 0.86603637 0.36597269 1.36579871 -1228 0.78611556 1.19854799 -0.75021653 -1229 -0.80774018 1.84487861 0.44185825 -1230 0.09117233 -0.03227100 -1.41361264 -1231 0.35717911 -0.12893339 -1.40809030 -1232 -0.73438050 0.12946164 -0.61895727 -1233 0.23544867 0.08396938 1.41148548 -1234 -0.93137887 0.18659810 -0.60419332 -1235 -0.70019429 -0.35259341 0.52492505 -1236 -0.99957646 0.53158736 -1.31025074 -1237 0.96285186 1.79814267 -0.60456491 -1238 0.77471763 0.53447227 -0.33794646 -1239 0.96024221 -0.44743055 -1.34132323 -1240 0.01567612 -0.00554165 -1.41397009 -1241 -0.99533314 -0.25603439 0.57819963 -1242 0.99872738 1.31306943 -0.52458629 -1243 -0.99989703 1.75524315 0.71967860 -1244 -0.33219293 0.40773042 -0.48334700 -1245 -0.99387810 1.32082209 0.50474858 -1246 -0.17607070 0.95463025 -1.04308350 -1247 0.37218604 0.90011401 1.09047553 -1248 0.20589124 1.05030401 -0.94668031 -1249 0.88903867 0.17098894 0.60879488 -1250 0.85891826 0.54651900 -0.31809653 -1251 -0.11542562 0.45988293 0.43402318 -1252 -0.93729254 0.42284820 -1.34927444 -1253 0.91068397 0.30270141 0.55519391 -1254 -0.94879205 0.43450696 -1.34556524 -1255 -0.60806605 -0.82386411 1.14916928 -1256 -0.76128237 1.38102595 0.30349535 -1257 -0.29373959 -1.89178755 -0.14126450 -1258 -0.20232393 1.04944114 0.94763675 -1259 -0.97403518 -0.82480016 1.70836779 -1260 0.47445263 -0.49884919 0.38861023 -1261 0.47769396 0.38815040 0.49920706 -1262 0.39152229 0.39998692 0.48977433 -1263 0.32559821 -0.40857363 -0.48263445 -1264 0.27153979 0.41536795 0.47679963 -1265 0.22690923 0.42083414 0.47198205 -1266 0.88939228 0.38260594 1.36123283 -1267 -0.73099896 -1.04034838 1.58634519 -1268 0.25718842 0.41713888 0.47525107 -1269 0.10256477 0.45847667 -0.43550840 -1270 -0.98500740 1.32856794 0.48399312 -1271 0.99878127 -0.58715914 0.23476066 -1272 0.52236897 0.38167866 0.50417241 -1273 -0.94358817 1.34730165 0.42909252 -1274 0.96106868 0.28225281 0.56586374 -1275 0.15693273 -0.46440408 0.42918210 -1276 0.97093374 0.46123325 1.33663982 -1277 -0.98753994 -1.72260925 -0.79462769 -1278 0.99884687 0.52538307 1.31275083 -1279 -0.99745223 -0.69457333 1.76532821 -1280 -0.74024080 1.38339947 0.29248595 -1281 0.65377365 -1.39160463 0.25055674 -1282 -0.88471710 1.36219716 0.37915831 -1283 0.23822930 0.08497930 1.41142504 -1284 0.78261395 0.33626315 0.53553293 -1285 -0.05850317 -0.44054888 0.45363544 -1286 0.00511410 0.44656799 0.44771135 -1287 0.96237212 -0.45002262 -1.34045580 -1288 0.07641879 1.41372241 -0.02703839 -1289 -0.99503050 -0.68204967 1.77020452 -1290 -0.47311539 0.49870163 0.38879958 -1291 0.15261124 -0.46393447 0.42968970 -1292 -0.96484461 1.33941148 0.45312141 -1293 0.98810525 0.57444347 -0.26435417 -1294 0.84853117 0.35434476 1.36886154 -1295 -0.76498881 -1.01994281 1.59954133 -1296 0.07330903 0.43886306 0.45526656 -1297 -0.00284555 1.34237404 1.34046550 -1298 0.01288829 0.44569696 0.44857847 -1299 0.00716452 -0.44794021 0.44633843 -1300 0.95805200 0.44483343 1.34218677 -1301 -0.97020796 -0.83176850 1.70498592 -1302 -0.15052369 0.46370753 0.42993459 -1303 0.93793485 0.42347132 1.34907900 -1304 -0.93272175 0.55944734 0.29476618 -1305 -0.04280706 -1.35570292 -1.32698357 -1306 0.05688131 0.44073308 0.45345647 -1307 0.02563908 1.34999162 -1.33279347 -1308 0.02673143 0.44414154 0.45011856 -1309 -0.96571210 0.45423328 -1.33903482 -1310 0.98539538 0.26675360 0.57333318 -1311 0.86603637 -1.36579871 0.36597268 -1312 0.78611556 0.75021653 1.19854799 -1313 -0.80774018 -0.44185825 1.84487861 -1314 0.09117233 1.41361264 -0.03227100 -1315 0.35717911 1.40809030 -0.12893339 -1316 -0.73438050 0.61895727 0.12946164 -1317 0.23544867 -1.41148548 0.08396938 -1318 -0.93137887 0.60419332 0.18659810 -1319 -0.70019428 -0.52492505 -0.35259341 -1320 -0.99957646 1.31025074 0.53158736 -1321 0.96285186 0.60456491 1.79814267 -1322 0.77471763 0.33794646 0.53447227 -1323 0.96024221 1.34132323 -0.44743055 -1324 0.01567612 1.41397009 -0.00554165 -1325 -0.99533314 -0.57819963 -0.25603439 -1326 0.99872738 0.52458629 1.31306943 -1327 -0.99989703 -0.71967860 1.75524315 -1328 -0.33219293 0.48334700 0.40773042 -1329 -0.99387810 -0.50474858 1.32082209 -1330 -0.17607070 1.04308350 0.95463025 -1331 0.37218604 -1.09047553 0.90011401 -1332 0.20589124 0.94668031 1.05030401 -1333 0.88903867 -0.60879488 0.17098894 -1334 0.85891826 0.31809653 0.54651900 -1335 -0.11542562 -0.43402318 0.45988293 -1336 -0.93729254 1.34927444 0.42284820 -1337 0.91068397 -0.55519391 0.30270141 -1338 -0.94879205 1.34556524 0.43450696 -1339 -0.60806605 -1.14916928 -0.82386411 diff --git a/QAM/DDPLL/debug.py b/QAM/save/debug.py similarity index 97% rename from QAM/DDPLL/debug.py rename to QAM/save/debug.py index ed8966b..1c8c4d2 100644 --- a/QAM/DDPLL/debug.py +++ b/QAM/save/debug.py @@ -24,7 +24,7 @@ def load_error(filename): # -------------------- Application -------------------- app = QtWidgets.QApplication(sys.argv) -win = pg.GraphicsLayoutWidget(show=True, title="Constellation et PLL Error") +win = pg.GraphicsLayoutWidget(show=True, title="Constellation") win.resize(900, 900) win.setBackground('#0a0a0a') # fond noir profond diff --git a/QAM/OLD/qam.c b/QAM/save/qam.c similarity index 82% rename from QAM/OLD/qam.c rename to QAM/save/qam.c index 82d3704..29095a6 100644 --- a/QAM/OLD/qam.c +++ b/QAM/save/qam.c @@ -39,38 +39,6 @@ void init_constellation (qam_system* qam) { } } -// Calcul du bruit gaussien pour un sigma donné -// Formule de Box-Muller -double gaussian_noise (double sigma) { - double u1 = (rand() + 1) / ((double)RAND_MAX + 2); - double u2 = (rand() + 1) / ((double)RAND_MAX + 2); - return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); -} - -// Ajout du bruit -void add_noise (double complex* s, int len, double sigma) { - for (int i = 0; i < len; i++) { - double nr = gaussian_noise(sigma); - double ni = gaussian_noise(sigma); - s[i] += nr + I * ni; - } -} - -// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) -void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { - int nb_symbols = nb_bits / qam->k; - int sm = sqrt(qam->M); - for (int k = 0; k < nb_symbols; k++) { - int id = 0; - for (int b = 0 ; b < qam->k; b++) { - id = id * 2 + bits[k * qam->k + b]; - } - int i = id / sm; - int j = id % sm; - symbols[k] = qam->constellation[i][j]; - } -} - // Modulation QAM void modulate (qam_system* qam, double complex* symbols, int nb_symbols, double complex* s) { for (int k = 0; k < nb_symbols; k++) { @@ -99,7 +67,8 @@ void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bit // Distance euclidien de Ir et Qr pour avoir le point le plus proche de la constellation (lent) int sm = (int)sqrt(qam->M); double min_d = INFINITY; - int i_cl, j_cl = 0; + int i_cl = 0; + int j_cl = 0; for (int i = 0; i < sm; i++) { for (int j = 0; j < sm; j++) { double d = cabs(r - qam->constellation[i][j]); @@ -120,12 +89,40 @@ void demodulate(qam_system* qam, double complex* s, int nb_symbols, uint8_t* bit } } -// Libération de la mémoire -void free_constellation(qam_system* qam) { - int sm = (int)sqrt(qam->M); - for (int i = 0; i < sm; i++) - free(qam->constellation[i]); - free(qam->constellation); +// Calcul du bruit gaussien pour un sigma donné +// Formule de Box-Muller +double gaussian_noise (double sigma) { + double u1 = (rand() + 1) / ((double)RAND_MAX + 2); + double u2 = (rand() + 1) / ((double)RAND_MAX + 2); + return sigma * sqrt(-2 * log(u1)) * cos(2 * M_PI * u2); +} + +// Ajout du bruit +void add_noise (double complex* s, int len, double sigma) { + //double signal_power = (2.0/3.0)*(qam.M-1); + //double snr_dB = 5; // SNR en dB + //double snr_lin = pow(10.0, snr_dB / 10.0); + //double sigma = sqrt(signal_power / snr_lin); + for (int i = 0; i < len; i++) { + double nr = gaussian_noise(sigma); + double ni = gaussian_noise(sigma); + s[i] += nr + I * ni; + } +} + +// Changer le tableau de bits en boolen ou alors la represenation binaire et shifter pour extraire les bits (pas bien si M plus grand) +void bits_to_symbols (qam_system* qam, uint8_t* bits, int nb_bits, double complex* symbols) { + int nb_symbols = nb_bits / qam->k; + int sm = sqrt(qam->M); + for (int k = 0; k < nb_symbols; k++) { + int id = 0; + for (int b = 0 ; b < qam->k; b++) { + id = id * 2 + bits[k * qam->k + b]; + } + int i = id / sm; + int j = id % sm; + symbols[k] = qam->constellation[i][j]; + } } double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { @@ -136,35 +133,72 @@ double compare_bits(uint8_t* bits1, uint8_t* bits2, int nb_bits) { return (double)errors / nb_bits; } -int main () { - qam_system qam; - qam.M = 16; - qam.k = (int)log2((double)(qam.M)); - qam.Fs = 44100; - qam.Ts = 0.0003; - qam.N = (int)qam.Fs * qam.Ts; - qam.Fc = 2000; - init_constellation(&qam); +void add_dephasage(double complex* s, double phi_offset, int total_samples) { + for (int i = 0; i < total_samples; i++) { + s[i] *= cexp(I * phi_offset); + } +} - //int nb_bits = 1000; - //int nb_symbols = nb_bits / qam.k; +void add_freq(qam_system* qam, double complex* s, double freq_offset, int total_samples) { + for (int i = 0; i < total_samples; i++) { + double t = (double)i / qam->Fs; + s[i] *= cexp(I * 2 * M_PI * freq_offset * t); + } +} - //uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); - //for (int i = 0; i < nb_bits; i++) { - // input_bits[i] = rand() % 2; - //} - char* texte = "Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, "; - int nb_chars = strlen(texte); - int nb_bits = nb_chars * 8; - int nb_symbols = (nb_bits + qam.k - 1) / qam.k; +void fill_constellation_data(qam_system* qam, FILE *fp_ref) { + int sm = (int)sqrt(qam->M); + for (int i = 0; i < sm; i++) { + for (int j = 0; j < sm; j++) { + fprintf(fp_ref, "% .8f % .8f\n", creal(qam->constellation[i][j]), cimag(qam->constellation[i][j])); + } + } +} - // Conversion du texte en bits - uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); +void reconstruction_text(int nb_chars, uint8_t* output_bits, char* texte_recup) { + for(int i = 0; i < nb_chars; i++){ + char c = 0; + for(int b = 0; b < 8; b++){ + c |= output_bits[i*8 + b] << (7-b); + } + texte_recup[i] = c; + } + texte_recup[nb_chars] = '\0'; +} + +void conversion_text_to_bits(int nb_chars, int nb_bits, char* texte, uint8_t* input_bits) { for(int i = 0; i < nb_chars; i++){ for(int b = 0; b < 8; b++){ input_bits[i*8 + b] = (texte[i] >> (7-b)) & 1; } } +} + +// Libération de la mémoire +void free_constellation(qam_system* qam) { + int sm = (int)sqrt(qam->M); + for (int i = 0; i < sm; i++) + free(qam->constellation[i]); + free(qam->constellation); +} + +int main () { + qam_system qam; + qam.M = 16; + qam.k = (int)log2((double)(qam.M)); + qam.Fs = 44100; + qam.Ts = 0.01; + qam.N = (int)(qam.Fs * qam.Ts); + qam.Fc = 2000; + init_constellation(&qam); + + // Conversion du texte en bits + char* texte = "Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux, Vif juge, trempez ce blond whisky aqueux"; + int nb_chars = strlen(texte); + int nb_bits = nb_chars * 8; + int nb_symbols = (nb_bits + qam.k - 1) / qam.k; + uint8_t* input_bits = malloc(nb_bits * sizeof(uint8_t)); + conversion_text_to_bits(nb_chars, nb_bits, texte, input_bits); // Conversion en symboles double complex* symbols = malloc(sizeof(double complex) * nb_symbols); @@ -176,53 +210,29 @@ int main () { modulate(&qam, symbols, nb_symbols, s); // Ajout du bruit - double signal_power = (2.0/3.0)*(qam.M-1); // puissance moyenne - double snr_dB = 5; // SNR en dB - double snr_lin = pow(10.0, snr_dB / 10.0); - double sigma = sqrt(signal_power / snr_lin); - add_noise(s, total_samples, sigma); - + add_noise(s, total_samples, 0); FILE *fp_ref = fopen("constellation_ref.dat", "w"); - int sm = (int)sqrt(qam.M); - for (int i = 0; i < sm; i++) { - for (int j = 0; j < sm; j++) { - fprintf(fp_ref, "% .8f % .8f\n", creal(qam.constellation[i][j]), cimag(qam.constellation[i][j])); - } - } + fill_constellation_data(&qam, fp_ref); fclose(fp_ref); - FILE *fp_constel = fopen("constellation.dat", "w"); - - double phase_offset = M_PI / 6.0; // 30 degrés - for (int i = 0; i < total_samples; i++) { - s[i] *= cexp(I * phase_offset); - } - double freq_offset = 0; // Hz de décalage - for (int i = 0; i < total_samples; i++) { - double t = (double)i / qam.Fs; - s[i] *= cexp(I * 2 * M_PI * freq_offset * t); - } - //int offset_samples = (int)(0.3 * qam.N); // décalage de 30% d’un symbole - //memmove(s + offset_samples, s, (total_samples - offset_samples) * sizeof(double complex)); + // Ajout de dephasage + //add_dephasage(s, M_PI / 6.0, total_samples); + + // AJout de decalage de fréquence + //add_freq(&qam, s, 1, total_samples); // Démodulation + FILE *fp_constel = fopen("constellation.dat", "w"); uint8_t* output_bits = (uint8_t*)malloc(nb_bits * sizeof(uint8_t)); demodulate(&qam, s, nb_symbols, output_bits, fp_constel); - fclose(fp_constel); // Reconstruction du texte char* texte_recup = malloc(nb_chars + 1); - for(int i = 0; i < nb_chars; i++){ - char c = 0; - for(int b = 0; b < 8; b++){ - c |= output_bits[i*8 + b] << (7-b); - } - texte_recup[i] = c; - } - texte_recup[nb_chars] = '\0'; - printf("Texte original : %s\n", texte); + reconstruction_text(nb_chars, output_bits, texte_recup); + + printf("Texte original : %s\n\n", texte); printf("Texte demodulé : %s\n", texte_recup); // Calcul du BER