2:20 AM

this is the ramp function

function rmps()
f=input('enter the sample frequency= ');
l=input('enter the length of the sequence= ');

Ts=1/f;
n=1:l;
x(n)=n-1;

n=0:l-1;
stem(n*Ts,x,'fill');
title('ramp function');
xlabel('time in secs');
ylabel('amplitude');


given is the example for sample frequency 25000 and sample length 40.

PLEASE LEAVE A COMMENT :)

2:18 AM

unit step sequence

here's another one

function usts()
f=input('enter the sampling frequency= ');
l=input('enter the length of the sequence= ');

Ts=1/f;
n=1:l;
x(n)=ones(1,numel(l));
n=0:l-1;
stem(n*Ts,x,'fill');
title('unit step sequence');    
xlabel('time in secs');
ylabel('amplitude');
  
PLEASE LEAVE A COMMENT :)

2:12 AM

unit sample sequence

i started off with simple programs and i will keep posting them...any queries and suggestions are always welcome :)

this is the first programming i did-unit sample sequence
pretty easy...

function uss1()
N=input('enter the sampling frequency = ');
l=input('enter the length of the sequence = ');

Ts=1/N;
x(1)=ones;
 for n=2:l
     x(n)=zeros;
 end
   n=0:l-1;
   stem(n*Ts,x,'fill');
   title('unit sample sequence');
   xlabel('time in secs');
   ylabel('amplitude');

there r a lot more ways of doing this programming...thanks for reading :)

PLEASE LEAVE A COMMENT :)