Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Digital communication Lab, Lecture notes of Digital Communication Systems

Digital communication Lab contains

Typology: Lecture notes

2021/2022

Uploaded on 08/03/2023

ramesha-muniyappa
ramesha-muniyappa 🇮🇳

1 document

1 / 34

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DC LAB
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download Digital communication Lab and more Lecture notes Digital Communication Systems in PDF only on Docsity!

DC LAB

EECE3011P DIGITAL COMMUNICATIONS

List of Laboratory Experiments

  1. MATLAB Simulation of Sampling and reconstruction of analog signals.
  2. MATLAB Implementation of Uniform Quantizer and quantization noise analysis
  3. MATLAB Simulation of DPCM scheme
  4. PCM transmission
  5. Simulation of Baseband Transmission and Equalization using MATLAB Simulink
  6. MATLAB Simulink modelling of ASK Generation and Detection
  7. MATLAB Simulink modelling of PSK Generation and Detection
  8. MATLAB Simulink modelling of FSK Generation and Detection
  9. Simulation and Noise Performance Analysis of Digital modulation schemes using MATLAB/Simulink/ LABVIEW/MULTISIM.
  10. MATLAB Implementation of Spread Spectrum and Orthogonal Frequency Division Multiplexing Systems

MATLAB CODE:

F1 = 300e6; Fs = 800e6; tmin = 0; tmax = 10/F1; t = tmin:1e-12:tmax; x1 = cos(2piF1t); Ts = 1/Fs; ts = tmin:Ts:tmax; x1resampled = cos(2piF1ts); x1reconstructed = zeros(1,length(t)); %preallocating for speed samples = length(ts); for i = 1:1:length(t) for n = 1:1:samples x1reconstructed(i) = x1reconstructed(i) + x1resampled(n)sinc((t(i)-nTs)/Ts); %%% CHANGE end end figure(1) subplot(3,1,1) plot(t,x1) xlabel('Time [sec]') ylabel('Amplitude') title('Continuous time signal') %hold on subplot(3,1,2) stem(ts,x1resampled) xlabel('Time [sec]') ylabel('Amplitude') title('Sampled signal')

subplot(3,1,3) plot(t,x1reconstructed) xlabel('Time [sec]') ylabel('Amplitude') title('reconstructed signal')

Results:

EXP 02: MATLAB Implementation of Uniform Quantizer and quantization noise analysis AIM: To implement a Uniform Quantizer and analyze the quantization noise introduced during the quantization process. Resources Required: PC with MATLAB MATLAB CODE: % Parameters N = 1000; % Number of samples A = 1; % Maximum input amplitude B = 8; % Number of bits for quantization % Generate a sinusoidal input signal f = 10; % Frequency of the sinusoid t = linspace(0, 1, N); % Time vector x = A * sin(2pift); % Sinusoidal signal % Quantization Q = (2A) / (2^B); % Quantization step size x_q = floor(x/Q) * Q; % Quantized signal % Quantization error (quantization noise) error = x - x_q; % Signal-to-Quantization-Noise Ratio (SQNR) SQNR = 10*log10(var(x)/var(error)); % Plot the input signal, quantized signal, and quantization error figure; subplot(3, 1, 1); plot(t, x); title('Input Signal'); xlabel('Time'); ylabel('Amplitude');

subplot(3, 1, 2); plot(t, x_q); title('Quantized Signal'); xlabel('Time'); ylabel('Amplitude'); subplot(3, 1, 3); plot(t, error); title('Quantization Error'); xlabel('Time'); ylabel('Amplitude'); % Display SQNR disp(['SQNR: ' num2str(SQNR) ' dB']); Results: SQNR: 49.7383 dB

EXP 03: MATLAB Simulation of DPCM scheme AIM: To simulate a Differential Pulse Code Modulation (DPCM) scheme. Resources Required: PC with MATLAB MATLAB CODE: % DPCM MATLAB Simulation % Signal generation t = 0:0.01:10; % Time vector f = 1; % Signal frequency A = 1; % Signal amplitude x = Asin(2pift); % Original signal % DPCM Encoding step_size = 0.1; % Quantization step size n = length(x); % Number of samples e = zeros(1, n); % Quantization error y = zeros(1, n); % Encoded signal % Initialize the predictor prev_sample = 0; for i = 1:n % Prediction predicted_sample = prev_sample; % Error calculation e(i) = x(i) - predicted_sample; % Quantization and encoding quantized_sample = round(e(i) / step_size); y(i) = quantized_sample;

% Update predictor prev_sample = predicted_sample + quantized_sample * step_size; end % DPCM Decoding decoded_signal = zeros(1, n); for i = 1:n % Decoding and reconstruction decoded_sample = prev_sample + y(i) * step_size; decoded_signal(i) = decoded_sample; % Update predictor prev_sample = decoded_sample; end % Plotting subplot(3, 1, 1); plot(t, x); title('Original Signal'); xlabel('Time'); ylabel('Amplitude'); subplot(3, 1, 2); plot(t, e); title('Quantization Error'); xlabel('Time'); ylabel('Error'); subplot(3, 1, 3); plot(t, decoded_signal); title('Decoded Signal'); xlabel('Time'); ylabel('Amplitude');

EXP 04 : PCM transmission AIM: To Simulate PCM modulation and demodulation. Resources Required: PC with MATLAB Theoretical: Modulation is the process of varying one or more parameters of a carrier signal in accordance with the instantaneous values of the message signal. The message signal is the signal which is being transmitted for communication and the carrier signal is a high frequency signal which has no data but is used for long distance transmission. There are many modulation techniques, which are classified according to the type of modulation employed. Of them all, the digital modulation technique used is Pulse Code Modulation PCM. A signal is pulse code modulated to convert its analog information into a binary sequence, i.e., 1s and 0s. The output of a PCM will resemble a binary sequence. The following figure shows an example of PCM output with respect to instantaneous values of a given sine wave. Instead of a pulse train, PCM produces a series of numbers or digits, and hence this process is called as digital. Each one of these digits, though in binary code, represent the approximate amplitude of the signal sample at that instant. In Pulse Code Modulation, the message signal is represented by a sequence of coded pulses. This message signal is achieved by representing the signal in discrete form in both time and amplitude. MATLAB CODE: clc; close all; clear all; n=input('Enter for n-bit PCM system : '); %Encodebook Bit Length n1=input('Enter Sampling Frequency : '); %Sampling Frequency L = 2^n; %Number of Quantisation Levels %% Here we pllot the Analog Signal and its Sampled form Vmax = 8; x = 0:pi/n1:4pi; %Construction of Signal ActualSignl=Vmaxsin(x); %Actual input subplot(3,1,1); plot(ActualSignl); title('Analog Signal'); subplot(3,1,2); %Sampled Version stem(ActualSignl);grid on; title('Sampled Sinal'); %% Now perform the Quantization Process Vmin=-Vmax; %Since the Signal is sine StepSize=(Vmax-Vmin)/L; % Diference between each quantisation level QuantizationLevels=Vmin:StepSize:Vmax; % Quantisation Levels - For comparison codebook=Vmin-(StepSize/2):StepSize:Vmax+(StepSize/2); % Quantisation Values - As Final Output of qunatiz [ind,q]=quantiz(ActualSignl,QuantizationLevels,codebook); % Quantization process NonZeroInd = find(ind ~= 0); ind(NonZeroInd) = ind(NonZeroInd) - 1;

% MATLAB gives indexing from 1 to N.But we need indexing from 0, to convert it into binary codebook BelowVminInd = find(q == Vmin-(StepSize/2)); q(BelowVminInd) = Vmin+(StepSize/2); %This is for correction, as signal values cannot go beyond Vmin %But quantiz may suggest it, since it return the Values lower than Actual %Signal Value subplot(3,1,3); stem(q); grid on; % Display the Quantize values title('Quantized Signal'); %% Having Quantised the values, we perform the Encoding Process figure TransmittedSig = de2bi(ind,'left-msb'); % Encode the Quantisation Level SerialCode = reshape(TransmittedSig',[1 size(TransmittedSig,1)size(TransmittedSig,2)]); subplot(2,1,1); grid on; stairs(SerialCode); % Display the SerialCode Bit Stream axis([0 100 - 2 3]); title('Transmitted Signal'); %% Now we perform the Demodulation Of PCM signal RecievedCode=reshape(SerialCode,n,length(SerialCode)/n); %Again Convert the SerialCode into Frames of 1 Byte index = bi2de(RecievedCode','left-msb'); %Binary to Decimal Conversion q = (StepSizeindex); %Convert into Voltage Values q = q + (Vmin+(StepSize/2)); % Above step gives a DC shfted version of Actual siganl %Thus it is necessary to bring it to zero level subplot(2,1,2); grid on; plot(q); % Plot Demodulated signal title('Demodulated Signal'); Results:

EXP 05 : Simulation of Baseband Transmission and Equalization using MATLAB Simulink AIM: Resources Required: PC with MATLAB

EXP 06 : MATLAB Simulink modeling of ASK Generation and Detection AIM: To model the process of Amplitude Shift Keying (ASK) signal generation and detection using simulink. Resources Required: PC with MATLAB Simulink Model: PROCEDURE:

  1. Open the MATLAB , then click on ‘Simulink Library’ in tool bar to open it.
  2. Create New Model.
  3. Copy the blocks from simulink library.
  4. Click on blocks to enter the parameters(Shown in following Figures) In Time based mode: i) Consider Carrier Signal Amplitude is 1 volt, Frequency 100Hz, Sampling time is 0.00001 sec ii) Consider Data or message signal whose amplitude 1 v, period 0.01 and pulse width:50%

Results:

EXP 07 : MATLAB Simulink modeling of PSK Generation and Detection AIM: To generate MATLAB Simulink modeling of PSK Generation and Detection Resources Required: PC with MATLAB