0% found this document useful (0 votes)
170 views2 pages

TDM 2

This document contains MATLAB code that generates analog and discrete signals, multiplexes the signals, and then demultiplexes the combined signal back into its original components. It defines sinusoidal and triangular waveforms as analog inputs, samples and plots them, combines the signals using reshaping, and then separates the multiplexed signal by reshaping it again into the original waveforms.

Uploaded by

Santanu Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
170 views2 pages

TDM 2

This document contains MATLAB code that generates analog and discrete signals, multiplexes the signals, and then demultiplexes the combined signal back into its original components. It defines sinusoidal and triangular waveforms as analog inputs, samples and plots them, combines the signals using reshaping, and then separates the multiplexed signal by reshaping it again into the original waveforms.

Uploaded by

Santanu Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

TDM

clc;
close all;
clear all;
%analog input signal
x=linspace(1,4*pi,100);
s1=sin(x);
l=length(s1);
s2=triang(l);
subplot(3,3,1);
plot(s1);
grid on;
ylabel('amplitude--->');
xlabel('time--->');
subplot(3,3,2);
plot(s2);
grid on;
ylabel('amplitude--->');
xlabel('time--->');
%discrete input signal
subplot(3,3,4);
stem(s1,'r');
grid on;
ylabel('amplitude--->');
xlabel('time--->');
subplot(3,3,5);
stem(s2,'g');
grid on;
ylabel('amplitude--->');
xlabel('time--->');
%computing mux
for i=1:l
sig(1,i)=s1(i);
sig(2,i)=s2(i);
end
tdmsig=reshape(sig,1,2*l);
subplot(3,3,[3,6,9]);
stem(tdmsig,'b');
grid on;
ylabel('amplitude--->');
xlabel('time--->');
%computing demux
demux=reshape(tdmsig,2,l);
for i=1:l
sig1(i)=demux(1,i);
sig2(i)=demux(2,i);
end
subplot(3,3,7);
plot(sig1,'g');
grid on;
ylabel('amplitude--->');
xlabel('time--->');
subplot(3,3,8);
plot(sig2,'r');
grid on;
ylabel('amplitude--->');

xlabel('time--->');

You might also like