H
honhungoc
Guest
HV am încercat să corecteze unele greşeli, dar
am nu a avut posibilitatea de a rula acest cod
Pls ajuta-ma
Multumesc u
pls substitue
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
Mod16qam.m%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
funcţiei Y = mod16qam (X, fd, Fs, EB);
% 16-QAM modulare
%----------------------
% Y = mod16qam (X, fd, Fs, EB)
%
% X - flux de date
FD% - rata de eşantionare de date
% Fs - Modulation semnal samling rata (Fs / fd integer)
EB% - medie cam de energie
%
M = 16;
half_d = sqrt (sqrt (0,4 * EB));
Y = half_d * dmodce (X, fd, Fs, "qask ', M)";% QAM modulare
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
Demod16qam.m%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
funcţia [Y, EB] = demod16qam (R, fd, Fs);
% 16-QAM modulare
%----------------------
% [Y, EB] = demod16qam (R, fd, Fs)
%
% R - a primit un semnal (rând vector)
FD% - rata de eşantionare de date
% Fs - Modulation semnal samling rata (Fs / fd integer)
% Y - semnal de ieşire
EB% - medie de energie pe primit simbol
M = 16;
n = mărimea (R, 2);
Es = suma (ABS (R). ^ 2) / n;
EB = Es / 4;
half_d = sqrt (0,4 * EB);
Scatterplot% (ynoisy, 5,0, "B. ');% risipi complot de semnal zgomot
Y = ddemodce (R / half_d, fd, Fs, "qask ', M);% demodulated semnal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
SISO.m%
Single Single% de intrare iesire 16-QAM Simulare
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
clare;
aproape toţi;
SignalEnergyMin = 2;
SignalEnergyMax = 42;
SignalEnergy_d = 1;
BlocksPerEnergy = 100;
BlockSize = 2 ^ 8;
SamplingRate = 6;
WGNPower = 1;
RayleighParam = .4;
Antene = 2;
M = 16;
pentru aa = 1: Antene
Gvec1 = randn (1, BlocksPerEnergy);
Gvec2 = randn (1, BlocksPerEnergy);
RayleighVec (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= Sqrt ((RayleighParam ^ 2 .* Gvec1. ^ 2) (RayleighParam ^ 2 .* Gvec2. ^ 2));
final
RayleighVec (1,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= Ones (1, dimensiunea (RayleighVec, 2));
EnergiesdB = SignalEnergyMin: SignalEnergy_d: SignalEnergyMax;
Energii = 10. ^ (EnergiesdB./10);
pentru ee = 1: dimensiunea (Energii, 2)
pentru BB = 1: BlocksPerEnergy
A = randint (1, BlockSize, 16);% generarea datelor Stream
B = mod16qam (A, 1, SamplingRate, Energii (EE)) ";% 16-QAM Modulation
pentru aa = 1: Antene
disp ([ 'EB =', int2str (Energii (EE )),'; Bloc ", int2str (BB)," Antena ", int2str (aa)]);
C (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= RayleighVec (aa, bb) .* B;% Rayleigh fading
D (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= AWGN (C (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, WGNPower);% AWGN
[E (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, EB (aa, bb)] = demod16qam (D (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, 1, SamplingRate);% Demodulate
[TT, SER (aa, bb)] = symerr (A, E (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
);% Măsură BER pe antena
final
final
pentru aa = 1: Antene
ESER (AA, EE) = medie (SER (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, 2);
final
final
Eaxis = 10 * log10 ((SignalEnergyMin: SignalEnergy_d: SignalEnergyMax). / (WGNPower ^ 2));
cifră;
semilogy (EnergiesdB, ESER ,' ');
titlu ( "\ fontsize (12) \ bf16-QAM SISO Bit rata de eroare într-un apartament Rayleigh lent AWGN Canal ');
xlabel ( 'Eb/N_0'); ylabel ( 'SER');
legend ( 'Nu fading "," Rayleigh fading (r = 0,24)');
EOF%%%%% EOF% EOF% EOF%%%% EOF% EOF% EOF% EOF%%%%% EOF% EOF
am nu a avut posibilitatea de a rula acest cod
Pls ajuta-ma
Multumesc u
pls substitue
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
Mod16qam.m%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
funcţiei Y = mod16qam (X, fd, Fs, EB);
% 16-QAM modulare
%----------------------
% Y = mod16qam (X, fd, Fs, EB)
%
% X - flux de date
FD% - rata de eşantionare de date
% Fs - Modulation semnal samling rata (Fs / fd integer)
EB% - medie cam de energie
%
M = 16;
half_d = sqrt (sqrt (0,4 * EB));
Y = half_d * dmodce (X, fd, Fs, "qask ', M)";% QAM modulare
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
Demod16qam.m%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%
funcţia [Y, EB] = demod16qam (R, fd, Fs);
% 16-QAM modulare
%----------------------
% [Y, EB] = demod16qam (R, fd, Fs)
%
% R - a primit un semnal (rând vector)
FD% - rata de eşantionare de date
% Fs - Modulation semnal samling rata (Fs / fd integer)
% Y - semnal de ieşire
EB% - medie de energie pe primit simbol
M = 16;
n = mărimea (R, 2);
Es = suma (ABS (R). ^ 2) / n;
EB = Es / 4;
half_d = sqrt (0,4 * EB);
Scatterplot% (ynoisy, 5,0, "B. ');% risipi complot de semnal zgomot
Y = ddemodce (R / half_d, fd, Fs, "qask ', M);% demodulated semnal
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
SISO.m%
Single Single% de intrare iesire 16-QAM Simulare
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
clare;
aproape toţi;
SignalEnergyMin = 2;
SignalEnergyMax = 42;
SignalEnergy_d = 1;
BlocksPerEnergy = 100;
BlockSize = 2 ^ 8;
SamplingRate = 6;
WGNPower = 1;
RayleighParam = .4;
Antene = 2;
M = 16;
pentru aa = 1: Antene
Gvec1 = randn (1, BlocksPerEnergy);
Gvec2 = randn (1, BlocksPerEnergy);
RayleighVec (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= Sqrt ((RayleighParam ^ 2 .* Gvec1. ^ 2) (RayleighParam ^ 2 .* Gvec2. ^ 2));
final
RayleighVec (1,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= Ones (1, dimensiunea (RayleighVec, 2));
EnergiesdB = SignalEnergyMin: SignalEnergy_d: SignalEnergyMax;
Energii = 10. ^ (EnergiesdB./10);
pentru ee = 1: dimensiunea (Energii, 2)
pentru BB = 1: BlocksPerEnergy
A = randint (1, BlockSize, 16);% generarea datelor Stream
B = mod16qam (A, 1, SamplingRate, Energii (EE)) ";% 16-QAM Modulation
pentru aa = 1: Antene
disp ([ 'EB =', int2str (Energii (EE )),'; Bloc ", int2str (BB)," Antena ", int2str (aa)]);
C (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= RayleighVec (aa, bb) .* B;% Rayleigh fading
D (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
= AWGN (C (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, WGNPower);% AWGN
[E (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, EB (aa, bb)] = demod16qam (D (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, 1, SamplingRate);% Demodulate
[TT, SER (aa, bb)] = symerr (A, E (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
);% Măsură BER pe antena
final
final
pentru aa = 1: Antene
ESER (AA, EE) = medie (SER (aa,
<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Zâmbi" border="0" />
, 2);
final
final
Eaxis = 10 * log10 ((SignalEnergyMin: SignalEnergy_d: SignalEnergyMax). / (WGNPower ^ 2));
cifră;
semilogy (EnergiesdB, ESER ,' ');
titlu ( "\ fontsize (12) \ bf16-QAM SISO Bit rata de eroare într-un apartament Rayleigh lent AWGN Canal ');
xlabel ( 'Eb/N_0'); ylabel ( 'SER');
legend ( 'Nu fading "," Rayleigh fading (r = 0,24)');
EOF%%%%% EOF% EOF% EOF%%%% EOF% EOF% EOF% EOF%%%%% EOF% EOF