% Reed-Solomon FEC Performance % % Using Equation 8.7, in section 8.1.1 Reed-Solomon Error Probability from % Digital Communications, 2nd edition, by Bernard Sklar clear all; close all; m = 8; % bits per symbol n = 204; % codeword length (symbols) k = 188; % no. input symbols erasure = 0; min_SER = 10^-3; max_SER = 0.1; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% input_SER = [min_SER:min_SER:max_SER]; if erasure == 0 t = floor((n-k)/2) else t = n - k end for j=(t+1:2^m-1) combination(j,1) = nchoosek(2^m-1,j); % n! / (k! * (n-k)!) combination function end output_SER = zeros(length(input_SER),1); for i=1:length(input_SER) for j=(t+1:2^m-1) output_SER(i) = output_SER(i) + j * combination(j,1) ... * (input_SER(i))^j * (1 - input_SER(i))^(2^m-1-j); end end output_SER = (1/(2^m-1)) * output_SER; if erasure == 1 string = 'Using Erasures'; else string = 'No Erasures'; end loglog(input_SER,output_SER) title(['Reed-Solomon Code Performance - (', num2str(n), ', ', num2str(k), ', ',... num2str(t), ') ', string]); xlabel('Input SER') ylabel('Output SER')