

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Matlab codes
Typology: Study Guides, Projects, Research
1 / 2
This page cannot be seen from the preview
Don't miss anything!


%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)