EXPERIMENT:8
Aim: Perform adaptive delta modulation on matlab of given signal.
clc
clear all;
t =0:1/29:1;
f=1;
x=4*sin(2*pi*f*t);
x=[x ones(1,10) x];
y = zeros(1,length(x));
d = zeros(1,length(x));
e= zeros(1,length(x));
s=0.1;
for i=5:length(x)
if(x(i)-y(i-1))>=0
      y(i) = x(i)-s;
        d(i)=-1;
elseif(x(i)-y(i-1))<0
y(i)=x(i)-1;
d(i)=-1;
end
if(sum(d(i-4:i)))>3
s=s+0.01;
elseif(sum(d(i-4:i)))<-3
  s=s+0.01;
elseif(sum(d(i-4:i)))==0
s=s-0.01;
else
s=s;
end
pause;
subplot 211; plot(x); hold on;
stem(y,'m');e=x-y;plot(e,'r');
title('Input,tracking and error graph');
subplot 212; stem (d,'k'); title('output data signal')
end
                                    EXPERIMENT:9
                          Amplitude Shift Keying (ASK)
Aim: To study and observe Amplitude Shift Keying modulation and
demodulation
Apparatus: ST2156 and ST2157 Trainers, 2 mm Banana cable, Oscilloscope Caddo 802 or
equivalent
Circuit Diagram:
Procedure:
1. Connect the power supplies of ST2156 and ST2157 but do not turn on the power supplies until
   connections are made for this experiment.
2. Make the connections as shown in the figure.
3. Switch 'ON' the power.
4. On ST2156, connect oscilloscope CH1 to ‘Clock In’ and CH2 to ‘Data In’ and observe the
   waveforms.
5. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of modulator Circuit
   (l) on ST2156 and observe the waveforms.
6. Vary the gain potentiometer of modulator circuit (l) on ST2156 to adjust the amplitude of ASK
   Waveform.
7. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of comparator on
   ST2157 and observe the waveforms.
Observations:
1. The output at ‘Data In’ is repeating sequence of bits generated by Data Source.
2. The output at Modulator Circuit (l) is the ASK waveform which contains carrier transmitted for
   Data ‘1’ and carrier suppressed Data ‘0’.
3. The output at comparator on ST2157 is the same as ‘Data In’ on ST2156.
Conclusion:
Remarks:      Signature
                           Frequency Shift Keying (FSK)
Aim: To study and observe Frequency Shift Keying modulation and
demodulation
Apparatus: ST2156 and ST2157 Trainers, 2 mm Banana cable, Oscilloscope Caddo 802 or
equivalent
Circuit Diagram:
Procedure:
1. Connect the power supplies of ST2156 and ST2157 but do not turn on the power supplies until
   connections are made for this experiment.
2. Make the connections as shown in the figure 3.1.
3. Switch 'ON' the power.
4. On ST2156, connect oscilloscope CH1 to ‘Clock In’ and CH2 to ‘Data In’ and observe the
   waveforms.
5. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of Summing
   Amplifier on ST2156 and observe the waveforms.
6. Adjust the potentiometers of both the Modulator Circuit (l) &(ll) onST2156 to adjust the
   amplitude of FSK waveform at Summing Amplifier’s output on ST2156.
7. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of comparator on
   ST2157 and observe the waveforms.
Observations:
1. The output at Summer Amplifier is the FSK waveform, Observe that for data bit '0' the FSK
signal is at lower frequency (960KHz) & for data bit '1’ the FSK signal is at higher frequency (1.6
MHz)The output at comparator on ST2157 is the same as ‘Data In’ on ST2156.
Conclusion:
Remarks:      Signature
                              Phase Shift Keying (PSK)
Aim: To study and observe Phase Shift Keying modulation and demodulation
Apparatus: ST2156 and ST2157 Trainers, 2 mm Banana cable, Oscilloscope Caddo 802 or
equivalent
Circuit Diagram:
Procedure:
1. Connect the power supplies of ST2156 and ST2157 but do not turn on the power supplies until
   connections are made for this experiment.
2. Make the connections as shown in the figure 4.1.
3. Switch 'ON' the power.
4. On ST2156, connect oscilloscope CH1 to ‘Clock In’ and CH2 to ‘Data In’ and observe the
   waveforms.
5. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of Modulator Circuit
   (l) on ST2156 and observe the waveforms.
6. Adjust the ‘Gain’ potentiometer of the Modulator Circuit (l) on ST2156 to adjust the amplitude
   of PSK waveform at output of Modulator Circuit (l) on ST2156.
7. Now on ST2157 connect oscilloscope CH1 to ‘Input’ of PSK demodulator and connect CH2
   one by one to output of double squaring circuit, output of PLL, output of Divide by four (÷ 2)
   observe the wave forms.
8. On ST2157 connect oscilloscope CH1 to output of Phase adjust and CH2 to ‘output’ of PSK
   demodulator and observe the waveforms. Set all toggle switch to 0 and compare the waveform
   now vary the phase adjust potentiometer and observe its effects on the demodulated signal
   waveform. (Note: If there is problem in setting the waveform with potentiometer then toggle
   the switch given in PSK demodulator block two to three times to get the required waveform).
9. Now connect oscilloscope CH1 to ‘PSK’ output of PSK demodulator on ST2157 and connect
   CH2 ‘Output’ of Low Pass Filter on ST2157 and observe the waveforms.
10. Connect oscilloscope CH1 to ‘Output’ of Low Pass Filter on ST2157 then connect CH2 to
    ‘Output’ of Comparator on ST2157 and observe the waveforms, now vary the reference voltage
    potentiometer of first comparator to generate desired data pattern.
11. On ST2156, connect oscilloscope CH1 to ‘NRZ (L)’ and CH2 to ‘Output’ of comparator on
    ST2157 and observe the waveforms.
12. Connect oscilloscope CH1 to ‘Data In’ then connect CH2 output to Bit decoder and observe
    the waveforms. If both data does not matches then try to match it by varying the phase adjust
    potentiometer on QPSK Demodulator.
13. Now try to match the LED sequence by once pressing the reset switch on ST2156.
Observations:
1. The output at ‘Data In’ is repeating sequence of bits generated by Data Source.
2. The ‘Output’ of Modulator Circuit (l) is Phase Shift Keying modulated signal.
3. The output of Double squaring circuit is sinusoidal signal (carrier signal) but frequency is four
   times higher than that of carrier used for modulation.
4. The output of Phase Lock Loop (PLL) is clock signal of same frequency as that of the output of
   double squaring circuit and output of Divide by two (÷ 2) is clock signal of frequency two times
   less than the output of PLL signal.
5. The output of PSK demodulator is a signal having group of positive half cycles and group of
   negative half cycles of the carrier signal.
6. A low pass filter removes high frequency component from demodulated PSK signal and it makes
   the signal smooth.
7. The variation in reference voltage potentiometer affect the Data, to recover Data correctly
   potentiometer adjustment is necessary.
8. The Phase Adjust potentiometer on ST2157 matches the phase of regenerated clock and carrier
   with input clock and carrier signal.
Conclusion:
Remarks:                                                                            Signature
                                 EXPERIMENT:9
Aim: Perform ASK FSK and PSK on matlab of given signal.
Code:
%matlab code for digital modulation(ask, fsk and psk)
f=5;
f2=10;
x=[1 1 0 0 1 0 1 0] % input signal ;
nx=size(x,2);
i=1;
while i<nx+1
     t = i:0.001:i+1;
    if x(i)==1
       ask=sin(2*pi*f*t);%ask
       fsk=sin(2*pi*f*t); %fsk
       psk=sin(2*pi*f*t); %psk
    else
        ask=0;
        fsk=sin(2*pi*f2*t);
        psk=sin(2*pi*f*t+pi);
    end
    subplot(3,1,1);
    plot(t,ask);
    hold on;
    grid on;
    axis([1 10 -1 1]);
 title('Amplitude Shift Key')
    subplot(3,1,2);
    plot(t,fsk);
    hold on;
    grid on;
    axis([1 10 -1 1]);
title('Frequency Shift Key')
  subplot(3,1,3);
  plot(t,psk);
   hold on;
   grid on;
   axis([1 10 -1 1]);
title('Phase Shift Key')
  i=i+1;
end