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

Signal Generation in MATLAB: A Practical Guide, Study Guides, Projects, Research of Analog Communication

Matlab codes

Typology: Study Guides, Projects, Research

2014/2015

Uploaded on 09/14/2015

shubham_sarkar
shubham_sarkar 🇮🇳

2 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
%generation of unit step and unit impulse signal
clc;
clear all;
close all;
x=-5:5
y=[zeros(1,5),1,ones(1,5)]
subplot(3,4,1)
stem(x,y,'r')
a=-5:5
z=[zeros(1,5),1,zeros(1,5)]
subplot(3,4,2)
stem(a,z,'.-')
%generation of ramp signal
b=-5:5
c=[zeros(1,5),0:1:5]
subplot(3,4,3)
stem(b,c,'b')
%genration of logarathimic signal
x=-5:10
y=log(x)
subplot(3,4,4)
stem(x,y,'.-')
%generation of exp signal
u=-5:5
v=exp(u)
subplot(3,4,5)
stem(u,v,'r')
%generation of sinc signal
m=-5:5
n=sinc(m)
subplot(3,4,6)
stem(m,n,'g')
%generation of sine signal
x=linspace(0,4*pi)
y=sin(x);
subplot(3,4,7)
stem(x,y)
%genertaion of random signal
k=rand(1,100);
subplot(3,4,8)
pf2

Partial preview of the text

Download Signal Generation in MATLAB: A Practical Guide and more Study Guides, Projects, Research Analog Communication in PDF only on Docsity!

%generation of unit step and unit impulse signal clc; clear all; close all; x=-5: y=[zeros(1,5),1,ones(1,5)] subplot(3,4,1) stem(x,y,'r') a=-5: z=[zeros(1,5),1,zeros(1,5)] subplot(3,4,2) stem(a,z,'.-') %generation of ramp signal b=-5: c=[zeros(1,5),0:1:5] subplot(3,4,3) stem(b,c,'b') %genration of logarathimic signal x=-5: y=log(x) subplot(3,4,4) stem(x,y,'.-') %generation of exp signal u=-5: v=exp(u) subplot(3,4,5) stem(u,v,'r') %generation of sinc signal m=-5: n=sinc(m) subplot(3,4,6) stem(m,n,'g') %generation of sine signal x=linspace(0,4*pi) y=sin(x); subplot(3,4,7) stem(x,y) %genertaion of random signal k=rand(1,100); subplot(3,4,8)

plot(k) %generation of sine with noise l=y+k subplot(3,4,9) plot(l) %generation of cosine t=linspace(0,4*pi) h=cos(t) subplot(3,4,10) plot(t,h) %generation of cosine with noise j=h+k subplot(3,4,11) plot(j)