% MATLAB script for ECS 452 by Asst. Prof. Dr. Prapun Suksompong.

close all; clear all;

tic

%% Simulation parameters
% The number of symbols to be transmitted
n = 15; 
% Channel Input 
S_X = [0 1]; S_Y = [0 1];
p0 = 0.3; p1 = 1-p0; p_X = [p0 p1];
% Channel Characteristics
p = 0.1; Q = [1-p p; p 1-p];

%% 
% Generate the Channel input, apply DMC channel to generate the channel 
% output, show statistical analysis, use naive decoder, and find error
% probability

DMC_Analysis_demo

toc