0% found this document useful (0 votes)
18 views6 pages

DSP-LAB-2-Task: Submitted By: Shazir Ali Khan REG NO # SP18-BTN-004 SUBMITTED TO: Maam Zenab Fazal

Uploaded by

Shazir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views6 pages

DSP-LAB-2-Task: Submitted By: Shazir Ali Khan REG NO # SP18-BTN-004 SUBMITTED TO: Maam Zenab Fazal

Uploaded by

Shazir Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DSP-LAB-2-Task

SUBMITTED BY: SHAZIR ALI KHAN


REG NO # SP18-BTN-004
SUBMITTED TO: Maam Zenab Fazal
DATE: 26 August, 2020
LAB TASK:

fn=3; % Using frequencies 3 and 100


fs=100;
t=-1:1/fs:1;
x=sin(2*pi*fn*t);
plot(t,x)
xlabel('t')
ylabel('amp')
title('x(t)')
axis([0 1 -1 1])

Figure:

Xjw=fftshift(fft(x,fs));
om=linspace(-fs/2,fs/2,fs);
plot(om,abs(Xjw))

Figure:
s=square(2*pi*2*fn*t);
impT=abs(diff(s))/2;
plot(t(1:length(t)-1),impT)

Figure:

samp=x(1:length(impT)).*(impT);
stem(samp)
Figure:

fn=35; % Using frequencies 35 and 200


fs=200;
t=-1:1/fs:1;
x=sin(2*pi*fn*t);
plot(t,x)
xlabel('t')
ylabel('amp')
title('x(t)')
axis([0 1 -1 1])

Figure:
Xjw=fftshift(fft(x,fs));
om=linspace(-fs/2,fs/2,fs);
plot(om,abs(Xjw))

Figure:

s=square(2*pi*2*fn*t);
impT=abs(diff(s))/2;
plot(t(1:length(t)-1),impT)

Figure:

samp=x(1:length(impT)).*(impT);
stem(samp)

Figure:

You might also like