Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

t=0:0.001:10; a=1.

1
y=(a.^t)
plot(t,y)
t=0:0.001:5;f=2
y=sin(2*pi*f*t)
plot(t,y)

t=0:0.001:1;f=2
y=sawtooth(2*pi*f*t,0.8)
plot(t,y,'r')

t=-1:0.0001:1;
y=rectpuls(t,0.4)
plot(t,y)
t=-1:0.0001:1;
y=rectpuls(t)
plot(t,y)

USING FUNCTIONS DELAYED SEQUENCE


n=-10:10;n0=4
y=[zeros(1,10),1,zeros(1,10)]
[x,n]=imp(n0,n)
figure(1)
subplot(211)
stem(n,y)
subplot(212)
stem(n,x)
function[x,n]= imp(n0,n)
x=((n-n0)==0)

COMPUTE

ENERGY USING FUNCTION

x=input('enter')
ex=energy(x)
figure(1)
subplot(211)
stem(x)
subplot(212)
stem(ex)

function ex= energy(x)


ex=sum(x.*conj(x))

You might also like