waqas naseem

Upload: muhammadwaqasnaseem

Post on 19-Oct-2015

7 views

Category:

Documents


0 download

DESCRIPTION

Digital signal processing

TRANSCRIPT

Q#1

NAME : WAQAS NASEEM

CLASS: BETE-##(TELECOM)ROLL # S-####SUBJECT: DSP

Program p1-1n=-10:20u=[zeros(1,10) 1 zeros(1,20)]stem(n,u)xlabel('time index n')ylabel('unit sample sequence')axis([-10 20 0 1 ])

Q#1.14

clf;n=-10:20;u=[zeros(1,10) 1 ones(1,20)];stem(n,u);xlabel('Time index n'); ylabel('Amplitude');title('unit step sequence');axis([-10 20 0 1.2]);

Q#1.5

Roll # S-3115

% Delay= 3+1=4

clf;n=-10:20;u=[zeros(1,14) 1 ones(1,16)];stem(n,u);xlabel('Time index n');ylabel('Amplitude');title('unit step sequece');axis([-10 20 0 1.2]);

Advance=1+5=6n=-10:20;u=[zeros(1,4) 1 ones(1,26)];stem(n,u);xlabel('Time index n'); ylabel('Amplitude');title('unit step sequence');axis([-10 20 0 1.2]);

Q#1.17

clfn=0:40f=0.1phase=0a=1.5arg=2*pi*f*n - phasex=a*cos(arg)clfstem(n,x)axis([0 40 -2 2])gridxlabel('Time index n'); ylabel('Amplitude');title('Sinusoidal sequence');

Q#1.18

The frequency of this sequence is f=0.1..it can be changed by putting other values,like f=1.2,3,4 etc.For phase controlParameter phase controls the ,phase of a sinusoidal functionFor amplitude:-Parameter A controls the amplitude in this program .

A=1.5

Q#1.19

Length of the sequence is 0 to 40. Length can be changed by putting some other values in (n). For example n= 0:50, the length is 0 to 50.

Q#1.21

Axis:

Axis command control axis scaling and appearence. AXIS([XMIN XMAX YMIN YMAX]) sets scaling for the x- and y-axes on the current plot.Grid: Grid command draw grid line on figure. GRID ON adds major grid lines to the current axes. GRID OFF removes major and minor grid lines from the current axes

Q#1.22

sinusoidal sequence of frequency 0.9:n=0:40;f=0.9;phase=0;A=1.5;arg=2*pi*f*n-phase;x=A*cos(arg);clf;stem(n,x);axis([0 40 -2 2])grid

xlabel('Time index n'); ylabel('Amplitude');title('Sinusoidal sequence');sinusoidal sequence of frequency 1.1:n=0:40;f=1.1;phase=0;A=1.5;arg=2*pi*f*n-phase;x=A*cos(arg);clf;stem(n,x);axis([0 40 -2 2]);grid;xlabel('Time index n'); ylabel('Amplitude');title('Sinusoidal sequence');Q#1.23

Roll # S-3115clfn=0:50f=0.03phase=50a=1.1arg=2*pi*f*n - phasex=a*cos(arg)clfstem(n,x)axis([0 40 -2 2])gridxlabel('Time index n'); ylabel('Amplitude');title('Sinusoidal sequece');

Q#1.24

n=0:40;f=0.1;phase=0;A=1.5;arg=2*pi*f*n-phase;x=A*cos(arg);clf;plot(n,x);axis([0 40 -2 2]);

Q#1.25

n=0:40;f=0.1;phase=0;A=1.5;arg=2*pi*f*n-phase;x=A*cos(arg);clf;stairs(n,x);axis([0 40 -2 2]);grid;