Palīdziet man plz: pievienot rayleigh kanāls manā programma,

E

eng.raed

Guest
plz mēģinu pievienot kodu rayleigh kanāls manā programma, lietošanas qpsk modulācijas un režģis kodu un viterbi atšifrēt bet i dont ir kods (rayleigh fedings) siutable ar manu programma, lai darbotos tā (i vēlaties aprēķināt ietekmi fadind kanāls ber vers eb / nē )
var kāds man palīdzēt PLZ (urgint)
šis ir mans kods, programma,
ar manu attiecībā uz visiem, un es gaidīt replay, ja vēlaties uz manu e-pastu
ryd_mnsr (at) yahoo.com
paldies
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parametri
Fd = 1;% simbolu frekvence (Hz)
Fs = 1;% parauga frekvence (Hz)
N = Fs / FD;
nSymb = 100;% numuru simboli
M = 4;% modulācijas tipu
n = 128;% punktu apgriezti pārveidot
nPlot = 30;% skaita viedokļa parauglaukuma
k = log2 (M);% = 2
SNR = 30%, signāla un trokšņa attiecība
sēklas = [4321 1234];
constlen = 7;
Codegen = [171 151];
codeRate = 1 / 2;
trel = poly2trellis (constlen, Codegen);
nEncPlot = nPlot. / codeRate;
tEnc = [0: nEncPlot-1] * codeRate;
nModPlot = nEncPlot * Fs. / k;
tMod = [0: nModPlot 1],. / Fs .* k;
tblen = 52% traceback garums
SNRpBit = [0: .5:7]; linSNRpB = 10 SNRpBit. ^ ((

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

.* 0,1);
raj = [14:02:20]; nErr = [27 158 1051 8708];
expBER = 0,5 .* erfc (SQRTn (linSNRpB * codeRate));
expVitBER = vitproberrdemo (expBER, raj, nErr);
EncPlot = nPlot. / CodeRate;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TX
rands ("valsts", sēklas (1)); randn ("valsts", sēklas (2));.
msg_orig = randsrc (nSymb, 1, [0 1]);% rada binārus datus, izmantojot RANDSRC.

attēlu (1), apakšparauglaukumu (211), stumbra ([0: nPlot 1]-, msg_orig (1: nPlot), "r")
ass ([0 nPlot -0,2 1,2]), xlabel ("Time"), ylabel (amplitūdas)
virsraksts ("Binary simboli befor Convolutional Encoding"), tīkla
apakšparauglaukumu (212), gabals ([0: nPlot 1]-, msg_orig (1: nPlot), "b")
ass ([0 nPlot -0,2 1,2]), xlabel ("Time"), ylabel (amplitūdas)
virsraksts ("Binary simboli"), tīkla

[Msg_enc_trel] = convenc (msg_orig, trel);% izmanto CONVENC lai kodētu informāciju simboliem.
msg_enc = bi2de (pārveidot (msg_enc_trel, ...
lielums (msg_enc_trel, 2) * k, izmēru (msg_enc_trel, 1) / k) ');
grayencod = bitxor ([0:-1], grīdas ([0 M: M-1] / 2));% rada kodēšanas masīva un izmantot to, lai
% Gray-šifrēt simboliem ...
msg_gr_enc = grayencod (msg_enc 1);
attēlu (2), apakšparauglaukumu (211), stumbra (tEnc, msg_enc_trel (1: garums (tEnc)), "RX") energosistēmai
ass ([min (tEnc) max (tEnc) -0,2 1,2]), xlabel ("Time"), ylabel (amplitūdas)
virsraksts ("Convolutional Encoding")
apakšparauglaukumu (212), gabals (tEnc, msg_enc_trel (1: garums (tEnc))) energosistēmai
ass ([min (tEnc) max (tEnc) -0,2 1,2]), xlabel ("Time"), ylabel (amplitūdas)
msg_mod = dmodce (msg_gr_enc, FD, [Fs, pī / 4], "PSK" M);% izmanto DMOD ar četraizvietotā PSK (QPSK)
% Modulēt signālu.
msg_mod1 msg_mod = ';
attēlu (3), apakšparauglaukumu (211), gabals (tMod, reālā (msg_mod (1: garums (tMod ))),' r-", ...
tMod, imag (msg_mod (1: garums (tMod ))),' b-"); tīkla
ass ([min (tMod) max (tMod) -1,5 1,5]); xlabel ("Time"), ylabel (amplitūdas ');
virsraksts ("QPSK Baseband Modulation");
uzraksts ("In-fāzē", "kvadrātiskās ');
apakšparauglaukumu (212), stumbra ((01:50), reālā (msg_mod (01:50)), "r-") energosistēmai,
turēt uz, leģenda ("In-fāzē", "kvadrātiskās)
ass ([min (tMod) max (tMod) -1,5 1,5]),
xlabel ("Time"), ylabel (amplitūdas "),
stumbra ((01:50), imag (msg_mod (01:50)), "b-") energosistēmai, turiet off, leģenda ("In-fāzē", "kvadrātiskās)
ass ([min (tMod) max (tMod) -1,5 1,5]), xlabel ("Time"), ylabel (amplitūdas "),

X = [msg_orig, msg_mod1]%, samaisot divas kārtas signāli
msg_zpad = [X :),

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

; Nulles (102,2)];% pievienot nulles paded
msg_zpad1 = [msg_zpad (51:202,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

; Msg_zpad (01:50,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

];
msg_ifft = ifft (msg_zpad1, n);% padara ifft ar 128 punktu apgriezto pārveidot
msg_cycprefix (01:33,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

= Msg_ifft (96:128,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

;% Pievienot ciklisks prefikss
msg_cycprefix (33:160,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

= Msg_ifft;

attēlu (4), apakšparauglaukumu (211), stumbra (tMod, reālā (msg_ifft (1: garums (tMod ))),' r-")
uzraksts ("In-fāze"), virsraksts ("IFFT '); xlabel (" Time "), ylabel (amplitūdas');
ass ([0 0,1 -0,1 0,4]), režģi
apakšparauglaukumu (212), stumbra (tMod, imag (msg_ifft (1: garums (tMod ))),' b-"), tīkla
ass ([0; 1 -0,1 0,4]); xlabel ("Time"), ylabel (amplitūdas ');
uzraksts (kvadrātiskās)
msg_tx2 (1:160,1) = msg_cycprefix :), 1);% ievietošanas ziņu transsmitted
msg_tx2 (161:320,1) = msg_cycprefix :), 2);
%################################################# #########################
%% Channel
msg_chan = awgn (msg_tx2, SNR);% pievienot AWGN troksnis
%################################################# #########################
%%% RX
msg_rx (1:160,1) = msg_chan (1:160,1);
msg_rx (1:160,2) = msg_chan (161:320,1);
uz y 1:128 =
msg_rcycprefix (y,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

= Msg_rx (y,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

;% Noņemt ciklisks prefikss
beigas
msg_fft :), 1) = FFT (msg_rcycprefix :), 1), 128);% dara FFT
msg_fft :), 2) = FFT (msg_rcycprefix :), 2), 128);
msg_rzpad = [msg_fft (77:128,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

; Msg_fft (01:48,

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

]% Noņemt nulle paded
msg_data (1:100,1) msg_rzpad = :), 1);
msg_data (1:100,1) msg_rzpad = :), 2);
msg_demod = ddemodce (msg_data, FD, [Fs, pī / 4], "PSK" M);% Izmantojiet DDEMOD līdz
% Demodulate un atklātu kodēta simboliem.
[Manekens graydecod] = šķirot (grayencod);% kārtot pelēkā kodējumu masīvs uz
% Rada pelēkās dekodēšana masīvs un
graydecod graydecod = - 1;
msg_gr_dec = graydecod (msg_demod 1) ";% izmanto pelēkās dekodēšanas masīvs uz
% Atšifrēt saņemto simboli
msg_gr_dec_bi = de2bi (msg_gr_dec, k),% izmanto DE2BI konvertēt datus uz
% Bināro no decimālo numurus bināro numuru.
msg_gr_dec_bi = msg_gr_dec_bi (

<img src="http://www.edaboard.com/images/smiles/icon_smile.gif" alt="Smaids" border="0" />

;
msg_dec = vitdec (msg_gr_dec_bi, trel, tblen "turpinājums", "grūti");%
attēlu (5)
stumbra (tEnc, reālā (msg_demod (1: nEncPlot)), "r"); noturēties;
stumbra (tEnc, imag (msg_demod (1: nEncPlot)), "b"); atturēt;
ass ([0 nPlot -0,2 3,5]); režģi
xlabel ("Time"), ylabel (amplitūdas "), virsraksts (" demodulācijas simboli ");
attēlu (6)
stumbra ([0: nPlot-1] msg_dec (1 tblen: nPlot tblen), "bo"), turiet off, režģi
ass ([0 nPlot -0,2 1,2]); xlabel ("Time"), ylabel (amplitūdas)
virsraksts ("dekodēt simboli)

[ErrorBitCod ratioBitCod] = biterr (msg_enc, msg_gr_dec);
ratioBitCod1 (SNR) = ratioBitCod;
errorBitCod = errorBitCod ratioBitCod1;
errorBitCod = errorBitCod / nSymb;
attēlu (7)
semilogy (SNRpBit, expVitBER, "b *-');
xlabel (Eb / Nē (dB) '); ylabel (BER "); tīkla
virsraksts ("SNR vers BER");

 

Welcome to EDABoard.com

Sponsor

Back
Top