Sei sulla pagina 1di 13

MATLAB PROJECT

TDM (multiplexing and


demultiplexing)
TDM??
Time-division multiplexing (TDM) is a
method of putting multiple data
streams in a single signal by
separating the signal into many
segments, each having a very short
duration. Each individual data stream
is reassembled at the receiving end
based on the timing.
Diagram 1
Diagram 2
MATLAB Program

clc;
close all;
clear all;
% Signal generation
fs =1000;
f1=50;
f2=100;
N=100;
n=0:N-1;
signal1=sin(2*pi*f1*n/fs);
signal2=cos(2*pi*f2*n/fs);

program
% Display of Both Signals
subplot(2,2,1);
plot(signal1);
title('signal 1');
ylabel('Amplitude');
xlabel('Time');
subplot(2,2,2);
plot(signal2);
title('signal 2');
ylabel('Amplitude');
xlabel('Time');

% Display of Both Sampled Signals


subplot(2,2,3);
stem(signal1);
title('Sampled Signal 1');
ylabel('Amplitude');
xlabel('Time');
subplot(2,2,4);
stem(signal2);
title('Sampled signal 2');
ylabel('Amplitude');
xlabel('Time');
program
l1=length(signal1);
l2=length(signal2);
for i=1:l1
signal(1,i)=signal1(i);
% Making Both row vector to a
matrix
signal(2,i)=signal2(i);
end
program
% TDM of both quantize signal
tdmsignal=reshape(signal,1,2*l1);

% Display of TDM Signal


figure
stem(tdmsignal);
title('TDM Signal');
ylabel('Amplitude');
xlabel('Time');
program
% Demultiplexing of TDM Signal
demux=reshape(tdmsignal,2,l1);
for i=1:l1
signal3(i)=demux(1,i);
% Converting The matrix into row
vectors
signal4(i)=demux(2,i);
end
program
% display of demultiplexed signal
figure
subplot(2,1,1)
plot(signal3);
title('Signal1');
ylabel('Amplitude');
xlabel('Time');
subplot(2,1,2)
plot(signal4);
title('Signal2');
ylabel('Amplitude');
xlabel('Time');


Fig 1
Fig 2
Fig 3

Potrebbero piacerti anche