Write a MATLAB program to implement Digital Modulation techn
Write a MATLAB program to implement Digital Modulation techniques (ASK, FSK, PSK). (Refer to Figure 2 above) If the input is 1 then: ASK/FSK/PSK: A sinusoidal signal with low frequency f. If the input is 0 then: ASK: 0 FSK: High frequency f 1 PSK: A sinusoidal signal with low frequency f and a phase shift of 180 for x = square (t) x = square (t, duty) x = square (t) generates a square wave with period 2 pi. Square (t) creates a square wave with peaks of plusminus 1. x = square (t, duty) generates a square wave with specified duty cycle (0 to 100). Duty Cycle is the percent of the period in which the signal is positive. y =line space(x1I. x2). Create a vector of 100 evenly spaced points in interval [x 1, x2] y = line space (x1, x2, n). n indicates number of evenly speed points. y = line space(-5, 5); Create a vector of 100 evenly spaced points in the interval [-5. 5] y1 = line space(-5, 5, .7); Create a vector of 7 evenly spaced points in the interval 1-5, 5] .write MATLAB program to implement Line Coding techniques (Unipolar. Polar and Manchester, with time axis t = i0.001: i+ 1-0.001.
Solution
LowFreq=10; %10Hz
HighFreq=15;%15Hz
SymbolLength=100; %Number of Samples per symbol
SamplFreq=1000;%Sampled at 1000Hz
switch(modulation)
case ASK
{if(input==0)
Output=zeros(SymbolLength,1);
else
Output=sin(2*pi*LowFreq/SamplFreq*(0:SymbolLength-1);}
case(FSK){
{if(input==0)
Output=sin(2*pi*HighFreq/SamplFreq*(0:SymbolLength-1);
else{
Output=sin(2*pi*LowFreq/SamplFreq*(0:SymbolLength-1)}
end
Case(PSK){
if(input==1){
Output=sin(2*pi/SamplFreq*LowFreq*(0:SymbolLength-1))
else
Output=sin(2*pi/SamplFreq*LowFReq(0:SymbolLength-1)+PI)}
% Note Coherent FSK Assumed.Data Rate 10 bits/sec.Frequency seperation must be 1/2*Data Rate=5Hz
