1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| %% point A : Générateur aléatoire de données binaires
data_tx=rand(1,Nbits)>0.5; % Données binaires aléatoires équiprobables
subplot(511) ; stem (data_tx,'r', 'linewidth', 2); grid on; hold on;
%% point B : Mapping
symb_tx=qam(data_tx,1); % Symboles aprés Mapping
subplot(512) ; stem (symb_tx,'r', 'linewidth', 2); grid on; hold on;
%%point C : Upsampling
symb_tx_up=upsample(symb_tx,N); % Signal informatif sur échantillonné
subplot (513) ; stem (symb_tx_up,'r','linewidth', 2) ; grid on;
%% point D : Filtre de mise en forme
g=ones (1,N); % Impulsion rectangle
Eg= sum (abs (g).^2);
g=g/sqrt (Eg);
sig_tx= filter(g,1,symb_tx_up); % Signal apres filtrage de mise en forme
subplot(514) ; stem (sig_tx,'r', 'linewidth', 2); grid on; hold on;
%% point E : Ajout du bruit blanc gaussien
sig_rx=awgn(sig_tx,SNR); % Signal recu bruité
subplot(515) ; stem (sig_rx,'r', 'linewidth', 2); grid on; hold on;
%% point F : Filtre de réception
figure
symb_rx_up=filter(g,1,sig_rx); % Signal apres filtrage de réception
subplot(311) ; stem (symb_rx_up,'r', 'linewidth', 2); grid on; hold on;
%% point G : Downsampling
symb_rx=downsample(symb_rx_up,15); %Symboles apres échantillonage au %rythme1/T
subplot(312) ; stem (symb_rx,'r', 'linewidth', 2); grid on; hold on;
%% point H : Demapping
data_rx=demodqam(symb_rx,1); % Données binaires recus apres le Demapping
subplot(313) ; stem (data_rx,'r', 'linewidth', 2); grid on; hold on;
%% apres on calcule lle nombre moyen des bits érronés:
C = xor(data_tx, data_rx);
sum(data_tx);
sum(data_rx); |
Partager