Project Signals
Project Signals
Q1:
fs=5;%freq of sampling
Ts=1/fs;%sample period
x = (10^ (-3))*t;
m = (sin(x)./x).^2;%%sinc squared
M = (Ts)*fftshift(fft(m)) ;
n = length (m) ;
f= (-n/2:n/2-1)*(fs/n) ;
w = 2*pi*f ;
xlabel('W');
ylabel('m(w)');
figure;
plot(t,m);
title('sinc squared');
xlabel('t');
ylabel('x(t)');
Q2:b)
fs = 4 ;
Ts = 1/fs ;
t = linspace (-150000, 150000, 300000*fs) ;
x = (10^-3)*t ;m =(sin(x)./x).^2 ;y= 2*pi*(10^5)*t;
r = m.*cos(y) ;
R = Ts*fftshift(fft(r)) ;
n = length (r);
f = (-n/2:n/2-1)*(fs/n);
w = 2*pi*f ;
plot (w, abs(R))
xlabel('w');
ylabel('R(w)');
figure;
plot(t,r)
xlabel('t');
ylabel('r(t)');
Q3:
syms t n real
x = exp(-t);
Dn = (1/pi) * int(x * exp(-2 .*n .* t .*j), t, 0, pi);
n = -5:5;
Dn_values = subs(Dn,n);
figure;
stem(n, abs(Dn_values), 'LineWidth', 1.5);
title('Magnitude of D_n');
xlabel('n');
ylabel('|D_n|');
grid on;
figure;
stem(n, angle(Dn_values)* ( 180/pi) , 'LineWidth', 1.5);
title('Phase of D_n');
xlabel('n');
ylabel('angle D_n (radians)');
grid on;
Part2: