Professional Documents
Culture Documents
Ece 2006 - Digital Signal Processing Faculty:Dr. Ashish P.: Lab Task - I
Ece 2006 - Digital Signal Processing Faculty:Dr. Ashish P.: Lab Task - I
subplot(3,1,1);
plot(t,c);
n=256;
w=0:f/n:(f-(f/n));
c=fft(c,n);
subplot(3,1,2)
plot(w,abs(c));
subplot(3,1,3);
plot(w,angle(c));
Output:
1 B.) In place of 30Hz, give (i) 70Hz signal. Analyse how does it reflect in the
spectrum. (ii) What happens if an 80Hz signal is given instead of 30Hz signal.
Sol: -
MATLAB CODE: -
clc
clear all
f = 100;
t = 0:1/f:1;
x = sin(2*pi*10*t)+sin(2*pi*20*t)+sin(2*pi*70*t); plot(t,x);
N=256;
W=0:f/N:(f-(f/N));
X=fft(x,N); plot(W,abs(X));
Output:
Matlab code:
clc
clear all
f=100;
t=0:1/f:1;
t0=1;
c=0;
for n=1:2:100
c=c+ (4/n*pi)*sin(2*pi*n*t/t0);
end
subplot(3,1,1);
plot(t,c);
n=256;
w=0:f/n:(f-(f/n));
c=fft(c,n);
subplot(3,1,2)
plot(w,abs(c));
subplot(3,1,3);
plot(w,angle(c));
Output: