**3.1.2.5 Calculating BER**

```
rxed_data=rxed_data( :)'; 
errors=O; 
c=xor( data,rxed_data) ; 
errors=nnz(c); 
BER(si,o)=errors/length(data) ; 
o=o+l; 
end si=si+l; 
end for col=l:25; 
ber(l,col)=O;
```

```
for row=l:100; 
ber(l,col)=ber(l,col)+BER(row,col); 
end 
end 
her= her./ 100; 
%% 
figure 
i=0:1:49; 
semilogy(i,ber); 
title('BER vs SNR'); 
ylabel('BER'); 
xlabel('SNR (dB)'); 
grid on
```
Fig. 8. Bit error rate of OFDM system
