Digital Signal Processing Reference
In-Depth Information
% TRANSMITTER
% Generate raw data
raw_data = randint(1, DATA_SET_LEN*NO_OF_DATA_SET);
frame_out = [];
out = [];
un_coded = [];
for burst_index=0:NO_OF_DATA_SET-1
% process data on frame by frame basis
frame = raw_data(DATA_SET_LEN*burst_index+1:
DATA_SET_LEN*(burst_index+1));
if (fec_en)
% Block encoding
% Put the raw data for RS encoder format
% The encoder generates n m-bit code symbols, that has k m-bit message
% symbols
% First put the bits in groups of m-bits to convert them
% to RS symbols
msg_in = reshape(frame,RS_CODE_m,DATA_SET_LEN/RS_CODE_m) ' ;
% Convert the m-bit symbols from binary to decimal while
% considering the left bit as MSB
msg_sm = bi2de(msg_in, ' left-msb ' );
% Put the data in k m-bit message symbols
rs_msg_sm = reshape(msg_sm,length(msg_sm)/RS_CODE_k,RS_CODE_k);
% Convert the symbols into GF of 2^RS_CODE_m
msg_tx = gf(rs_msg_sm, RS_CODE_m);
% Encode using RS (n,k) encoder
code = rsenc(msg_tx, RS_CODE_n, RS_CODE_k);
% Convolution encoding
tx_rs = code.x. ' ;
tx_rs_st = tx_rs(:);
bin_str = de2bi(tx_rs_st,RS_CODE_m, ' left-msb ' ) ' ;
bin_str_st = bin_str(:);
un_coded = [un_coded bin_str_st ' ];
% Perform convolution encoding
% conv_enc_out = convenc(bin_str_st, trellis, punct_code);
frame = convenc(bin_str_st, trellis) ' ;
end
frame_out = [frame_out frame];
end
% QPSK modulation
out_symb =reshape(frame_out, bps, length(frame_out)/bps) ' ;
out_symb_dec = bi2de(out_symb, ' left-msb ' );
mod_out = const_map(out_symb_dec+1);
Search WWH ::




Custom Search