Simulation Experiments With Output
Simulation Experiments With Output
AIM:
To study the FSK,PSK ,DPSK Modulation using MATLAB code & observe the output
waveform.
APPARATUS REQUIRED:
PROGRAM:
OUTPUT
RESULT:
Thus FSK,PSK ,DPSK Modulation using MATLAB code were studied&
output waveforms are noted.
Ex.No: 14 SIMULATION OF QPSK AND QAM GENERATION SCHEMES
Date:
AIM:
To generate a QPSK,QAM modulated waveform and to simulate using MATLAB
APPARATUS REQUIRED:
1.System with Matlab software.
PROGRAM
% 14.a QPSK Modulation
clc;
clear all;
close all;
n=input('Enter the input bits');
y=length(n);
freq=input('Enter the carrier frequency');
for i=1:y
if n(1,i)==00
for t=(i-1)*100+1:(i*100)
y(t)=sin(2*pi*freq*(t/1000));
end
else if n(1,i)==01
for t=(i-1)*100+1:(i*100)
y(t)=sin(2*pi*freq*(t/1000)+(pi/2));
end
else if n(1,i)==10
for t=(i-1)*100+1:(i*100);
y(t)=sin(2*pi*freq*(t/1000)*pi);
end
else if n(1,i)==11
for t=(i-1)*100+1:(i*100);
y(t)=sin(2*pi*freq*(t/1000)+(3*pi)/2);
end
end
end
end
end
end
figure(2);
plot(y);
xlabel('Time in Seconds');
ylabel('Amplitude in Volts');
title('Quadrature Phase Shift Keying');
grid on;
OUTPUT
RESULT:
Thus the generation of QPSK,QAM was simulated using MATLAB
Ex.No: 15 SIMULATION OF LINEAR BLOCK AND CYCLIC ERROR CONTROL CODING SCHEMES
Date:
AIM:
To write a program in MATLAB for error control coding techniques.
APPARATUS REQUIRED:
clc;
clear all;
% Input Generator Matrix
g=input('Enter The Generator Matrix: ')
disp ('G = ')
disp ('The Order of Linear block Code for given Generator Matrix is:')
[n,k] = size(transpose(g))
for i = 1:2^k
for j = k:-1:1
if rem(i-1,2^(-j+k+1))>=2^(-j+k)
u(i,j)=1;
else
u(i,j)=0;
end
end
end
u;
disp('The Possible Codewords are :')
c = rem(u*g,2)
disp('The Minimum Hamming Distance dmin for given Block Code is= ')
d_min = min(sum((c(2:2^k,:))'))
% Code Word
r = input('Enter the Received Code Word:')
p = [g(:,n-k+2:n)];
h = [transpose(p),eye(n-k)];
disp('Hammimg Code')
ht = transpose(h)
disp('Syndrome of a Given Codeword is :')
s = rem(r*ht,2)
for i = 1:1:size(ht)
if(ht(i,1:3)==s)
r(i) = 1-r(i);
break;
end
end
disp('The Error is in bit:')
i
disp('The Corrected Codeword is :')
r
OUTPUT
RESULT:
Thus the MATLAB program for error control coding techniques was simulated successfully.
.