Professional Documents
Culture Documents
Digital Signal Processing: Introduction To Matlab: Ms. T. Samanta Lecturer Department of Information Technology
Digital Signal Processing: Introduction To Matlab: Ms. T. Samanta Lecturer Department of Information Technology
to MATLAB
Ms. T. Samanta
Lecturer
Department of Information Technology
Command Window
Figure Window
>> y= 2*(1+4*j)
>> y=
2.0000 + 8.0000i
+ addition,
- subtraction,
* multiplication,
/division,
^ power operator,
' transpose
t=0:1:n-1;
y1=ones(1,n); %unit step
y2=[zeros(1,4) ones(1,n-4)]; %delayed unit step
subplot(2,1,1);
stem(t,y1,'filled');ylabel('amplitude');
xlabel('n----->');ylabel('amplitude');
subplot(2,1,2);
stem(t,y2,'filled');
xlabel('n----->');ylabel('amplitude');
I = 6; j = 21
if I > 5
k = I;
elseif (i>1) & (j == 20)
k = 5*I + j
else
k = 1;
end
%if statement
3>Draw a circle with radius unity. (use cos for x axis, sin for y
axis)
4>Draw a cosine wave with frequency 10kHz. Use both ‘plot’ and
‘stem’ functions to see the difference.