NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

1. To study the function of amplitude Modulation and
Demodulation using MATLAB.

2. To study the amplitude modulation in 3 signals in
MATLAB.

3. To study the working of DSB-SC modulator and
demodulator using MATLAB.

4. To study and generate single sideband (SSB)
modulation using MATLAB.

5. To study and generate frequency modulation and
demodulation using MATLAB.

6. To study sampling theorem and its reconstruction
or reconstitution using MATLAB

7. To verify sampling theorem with continuous signal
using MATLAB software.

8. To study pulse amplitude modulation and
demodulation techniques using MATLAB.

9. To study pulse width modulation and
demodulation technique using MATLAB software.





1.
% carrier Frequency
Fc = 200;
% sampling frequency
Fs = 4000;
% time duration
t = (0 : 1 / Fs : 1);
%sine wave with time duration of
x=sin(2*pi*t);
%amplitude Modulation
y = ammod(x, Fc, Fs );
plot(y);
title('Amplitude Modulation );
xlabel('Time(sec)')
ylabel('Amplitude')
2.
Ac = input('enter carrier signal amplitude: ');
Am = input('enter message signal amplitude: ');
fc = input('enter carrier frequency: ');
fm = input('enter message frequency: '); % fm < fc
m = input('enter modulation index: ');
t = input('enter time period: ');
t1 = linspace(0, t, 1000);
y1 = Am * sin(2 * pi * fm * t1); % message signal
y2 = Ac * sin(2 * pi * fc * t1); % carrier signal
eq = (1 + m * y1) .* y2; % element-wise multiplication
subplot(3, 1, 1);
plot(t1, y1);
xlabel('Time');
ylabel('Amplitude');
title('Message signal');
subplot(3, 1, 2);
plot(t1, y2);
xlabel('Time');
ylabel('Amplitude');
title('Carrier signal');
subplot(3, 1, 3);
plot(t1, eq, 'r');
xlabel('Time');
ylabel('Amplitude');
title('Modulated Signal');
3.
close all
clear all
clc
fs = 8000;
fm = 20;
fc = 50;
Am = 1;
Ac = 1;
t = (0:0.1*fs)/fs;
subplot(5,1,1);
ml = Am*cos(2*pi*fm*t);
plot(t, ml);
title("SSB-SC Modulation Demodulation ","Message Signal");
m2 = Am*sin(2*pi*fc*t);
subplot(5,1,2)
cl = Ac*cos(2*pi*fc*t);
plot(t, cl)
title('Carrier Signal')
c2 = Ac*sin(2*pi*fc*t)
subplot(5,1,3)
Susb = 0.5*ml.*cl + 0.5*m2.*c2;
plot(t, Susb)
title('SSB-SC Signal with USB');
subplot(5,1,4)
Slsb = 0.5*ml.*cl + 0.5*m2.*c2;
plot(t, Slsb)
title('SSB-SC Signal with LSB')
r = Susb.*cl;
subplot(5,1,5);
[ba] = butter(1, 0.0001);
mr = filter(ba, 1, r);
plot(t, mr);
title('Demodulated Output')
4.
close all
clear all
fs = 80000;
fm = 1000;
Am = 1;
t = (0:0.01*fs)/fs;
m1 = Am*cos(2*pi*fm*t);
subplot(5,1,1)
plot(t, m1)
title(Message Signal");
fc = 20000;
Ac = 1;
cl = Ac*cos(2*pi*fc*t);
subplot(5,1,2)
plot(t, cl)
title('Carrier Signal');
Susb = 0.5*m1.*cl;
subplot(5,1,3)
plot(t, Susb)
title('SSB-SC Signal with USB');
Slsb = 0.5*m1.*conj(cl);
subplot(5,1,4)
plot(t, Slsb)
title('SSB-SC Signal with LSB');
r = Susb.*cl;
[b, a] = butter(1, 0.0001);
mr = filter(b, a, r);
subplot(5,1,5)
plot(t, mr)
title('Demodulated Output');
5.
close all
clear all
clc
%fm=35Hz, fc=500Hz, Am=1V, Ac=1V, B=10
fs = 10000;
Ac = 1;
Am = 1;
fm = 35;
fc = 500;
B = 10;
t = (0:.1*fs)/fs
wc = 2*pi*fc;
wm = 2*pi*fm;
m_t = Am*cos(wm*t);
subplot(4,1,1);
plot(t,m_t);
title('Modulating or Message signal(fm=35Hz)');
c_t = Ac*cos(wc*t)
subplot(4,1,2);
plot(t,c_t);
title('Carrier signal(fm=500Hz)');
s_t = Ac*cos((wc*t)+B*sin(wm*t));
subplot(4,1,3);
plot(t,s_t);
title('Modulated signal');
d = demod(s_t,fc,fs,'fm');
subplot(4,1,4);
plot(t,d);
title('demodulated signal')
6.
%program for verification of sampling theorem
close all;
clear all;
clc
t=-10:.01:10;
T=4;
fm=1/T;
x=cos(2*pi*fm*t);
subplot(2,2,1);
plot(t,x);
title("Sampling Theorem");
%input signal
xlabel('time');ylabel('x(t)');title('continous time signal');
grid;
n1=-4:1:4;
fs1=1.6*fm;
fs2=2*fm;
fs3=8*fm;
%discrete time signal with fs<2fm
x1=cos(2*pi*fm/fs1*n1);
subplot(2,2,2);
stem(n1,x1);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs<2fm');
hold on
subplot(2,2,2);
plot(n1,x1)
grid;
%discrete time signal with fs=2fm
n2=-5:1:5;
x2=cos(2*pi*fm/fs2*n2);
subplot(2,2,3);
stem(n2,x2);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs=2fm');
hold on
subplot(2,2,3);
plot(n2,x2);
%discrete time signal with fs>2fm
grid;
n3=-20:1:20;
x3=cos(2*pi*fm/fs3*n3);
subplot(2,2,4);
stem(n3,x3);
xlabel('time');ylabel('x(n)');
title('discrete time signal with fs>2fm');
hold on
subplot(2,2,4);
plot(n3,x3);
grid;
7.
clc;
T=0.04; % Time period of 50 Hz signal
t=0:0.0005:0.02;
f = 1/T;
n1=0:40;
size(n1)
xa_t=sin(2*pi*2*t/T);
subplot(2,2,1);
plot(200*t, xa_t);
title('verification of sampling theorem');
title('continuous signal');
xlabel('t');
ylabel('x(t)');
ts1=0.002;%>niq rate
ts2=0.01;%=niq rate
ts3=0.1; %<niq rate
n=0:20;
x_ts1=2*sin(2*pi*n*ts1/T);
subplot(2,2,2);
stem(n,x_ts1);
title('greater than Nq');
xlabel('n');
ylabel('x(n)');
n=0:4;
x_ts2=2*sin(2*pi*n*ts2/T);
subplot(2,2,3);
stem(n,x_ts2);
title('Equal to Nq');
xlabel('n');
ylabel('x(n)');
n=0:10;
x_ts3=2*sin(2*pi*n*ts3/T);
subplot(2,2,4);
stem(n,x_ts3);
title('less than Nq');
xlabel('n');
ylabel('x(n)');
8.
% pulse amplitude modulation
close all
clear all
clc
t = 0: 1/1e3 : 10; %1 kHz sample freq for 1s
d = 0: 1/5 : 10;
x = 5+sin(2*pi/4*2*t); %message signal
figure;
subplot(3,1,1)
plot(x)
title('Message');
xlabel('time');ylabel('amplitude');
y = pulstran(t,d,'rectpuls',0.1); %generation of pulse input
subplot(3,1,2)
plot(y);
title('Pulse Input');
xlabel('time');ylabel('amplitude');
z=x.*y; %PAM output
subplot(3,1,3);
plot(z);
title('PAM modulation');
xlabel('time');ylabel('amplitude');
9.
%pulse width modulation and demodulation
close all
clear all
clc
fc = 1000;
fs = 10000;
fl = 200;
t = 0:1/fs:((2/fl)-(1/fs));
xl = 0.4*cos(2*pi*fl*t)+0.5;
%modulation
yl = modulate(xl, fc, fs, 'pwm');
subplot(311);
plot(xl);
axis([0 50 0 1]);
title('Original signal taken message, f1=500, fs=10000');
subplot(312);
plot(yl);
axis([0 500 -0.2 1.2]);
title('PWM')
%demodulation
xl_recov = demod(yl, fc, fs, 'pwm');
subplot(313);
plot(xl_recov);
title('time domain recovered, single tone, f1=200')
axis([0 50 0 1]);
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.