Aim: To study Phase Shift Keying (PSK) modulator and demodulator in MATLAB Apparatus Required: PSK Modulator circuit

, PSK Demodulator circuit, MATLAB softw are Theory: Phase-shift keying (PSK) is a digital modulation scheme that conveys dat a by changing, or modulating, the phase of a reference signal (the carrier wave) . Any digital modulation scheme uses a finite number of distinct signals to repr esent digital data. PSK uses a finite number of phases, each assigned a unique p attern of binary digits. Usually, each phase encodes an equal number of bits. Ea ch pattern of bits forms the symbol that is represented by the particular phase. The demodulator, which is designed specifically for the symbol-set used by the modulator, determines the phase of the received signal and maps it back to the s ymbol it represents, thus recovering the original data. This requires the receiv er to be able to compare the phase of the received signal to a reference signal - such a system is termed coherent (and referred to as CPSK). Diagrams: MATLAB Code: clc; clear all; close all; %% Message Bits to transmit. msg_bits = [1 0 1 0 1 0 0 0 1 1 0 0 1 0 1]; Tb = 1; % Bit Period (in seconds). %% Carrier Signal. fc = 3; fs = 8000; amp = 5;

% Sampling Frequency. % Carrier Amplitude.

%% Modulate. unipolarNRZ = []; carrierSignal = []; output_psk = []; time_axis = []; tl = 0; for mBit = msg_bits if (mBit == 0) [s, t] = Generate_Sin(amp, fc, tl, tl + Tb, fs); output_psk = [output_psk s]; unipolarNRZ = [unipolarNRZ zeros(1,length(t))]; elseif (mBit == 1) [s, t]= Generate_Cos(amp, fc, tl, tl + Tb, fs); output_psk = [output_psk s]; unipolarNRZ = [unipolarNRZ ones(1,length(t))]; end time_axis = [time_axis t]; tl = tl + 1; end %% Display Modulation Result. subplot(3,1,1); stem(0:length(msg_bits)-1, msg_bits,'b','LineWidth',2); axis([0 time_axis(end) -0.5 1.5]); title('Input Message Bits', 'Fontsize', 14); xlabel('Time'); ylabel('Amplitude'); grid on; subplot(3,1,2); plot(time_axis, unipolarNRZ, 'b', 'LineWidth',2);

14). 'Fontsize'. %% Demodulate. fc.3). xlabel('Time'). ylabel('Amplitude'). plot(time_axis.5 1. 'Fontsize'. subplot(3. output_psk. xlabel('Time').5]). ylabel('Amplitude'). fs). time_axis = []. rx_bits).'LineWidth'. subplot(2. output_psk. msg_bits. title('Output PSK'. grid on. fs). [bit_0. for n = 1 : rx_bits samples = output_psk(n * (fs+1) . the corresponding unipolar non-retu rn to zero signal and the transmitted Phase Shift Keyed signal . axis([0 time_axis(end) -0. 14). 'Fontsize'. stem(0:length(msg_bits)-1.5]). 'Fontsize'. xlabel('Time'). tl. title('Unipolar NRZ'. 'k'.5 1. xlabel('Time').2). title('Received Signal'. 'LineWidth'. ylabel('Amplitude').bit_0) == 0) detected_Bits = [detected_Bits 0]. title('Detected Message Bits'. grid on. fc. 1 shows the input message bits. 'LineWidth'.2). t] = Generate_Sin(amp. elseif(sum(samples . tl + Tb. end %% Display Demodulation Result. detected_Bits = zeros(1. tl. 14). rx_bits = length(output_psk) / (fs+1). Result: Fig. ylabel('Amplitude'). 'k'. tl = tl + 1. grid on. subplot(2.1. [bit_1. figure.2). tl = 0.1.axis([0 time_axis(end) -0. t] = Generate_Cos(amp. 14). end time_axis = [time_axis t]. tl + Tb.1.(fs+1) + 1 : n*(fs+1)). plot(time_axis.bit_1) == 0) detected_Bits = [detected_Bits 1].'b'.2). grid on. if(sum(samples .1).