0% found this document useful (0 votes)
65 views

Matlab Practical Assignments

This document contains code for two MATLAB programs. The first program defines a function called triplesinc that generates a baseband signal for AM modulation using a combination of sinc functions. The second program uses the triplesinc function to demonstrate double sideband (DSB) modulation and demodulation, multiplying the output of triplesinc by a cosine carrier signal and performing an FFT to recover the signal spectrum after modulation.

Uploaded by

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

Matlab Practical Assignments

This document contains code for two MATLAB programs. The first program defines a function called triplesinc that generates a baseband signal for AM modulation using a combination of sinc functions. The second program uses the triplesinc function to demonstrate double sideband (DSB) modulation and demodulation, multiplying the output of triplesinc by a cosine carrier signal and performing an FFT to recover the signal spectrum after modulation.

Uploaded by

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

for program 1

%(triplesinc.m)
%Baseband signal for AM
%Usage m=triplesinc(t,Ta)

function m=triplesinc(t,Ta)

%t is the length of the signal


%Ta is the parameter,equaling twice the delay

%
sig_1=sinc(2*t/Ta);
sig_2=sinc(2*t/Ta-1);
sig_3=sinc(2*t/Ta+1);
m=2*sig_1+sig_2+sig_3;

end

for program 2

%(ExampleDSB.m)
%This program uses triplesinc.m to illustrate DSB modulation and demodulation

ts=1.e-4

t=-0.04:ts:0.04;
Ta=0.01;

m_sig=triplesinc(t,Ta);
Lfft=length(t); Lfft=2^ceil(log2(Lfft));

M_free=fftshift(m_sig,Lfft));
freqm=(-Lfft/2:Lfft/2-1)/(Lfft*ts);

s_dsb=m_sig.*cos(2*pi*500t);
Lfft=length (t); Lfft=2^ceil(log2(Lfft)+1);

S_dsb=fftshift(fft(s_dsb,Lfft));
freqs=(-Lfft/2:Lfft/2-1)/(Lfft*ts);

Trange=[-0.03 0.03 -2 2]
figure(1)
subplot(221);td1=plot(t,m_sig);

You might also like