Sunteți pe pagina 1din 4

Discrete Time Signals in Frequency Domain

Task 1: Let x(n) be periodic signal with fundamental period N=50, where one period is given by

𝑛𝑒 −0.3𝑛 , 0 ≤ 𝑛 ≤ 25
𝑥(𝑛) = {
0 , 26 ≤ 𝑛 ≤ 49

Find DFS representation of x(n) .


clc;
close all;
clear all;
N=50;
n=0:49;
n1=0:25;
x1=n1.*(exp(-0.3*n1));
x=zeros(1,length(n));
x(find((n>=min(n1))&(n<=max(n1))==1))=x1;
k=[0:N-1];
WN=exp(-1i*2*pi/N);
nk=n'*k;
WNnk=WN .^ nk;
Ck=x * WNnk;
stem(n,x,'r')
xlabel('n')
ylabel('magnitude')
title('DFS representation of signal')
DFS representation of signal
1.4

1.2

1
magnitude

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25 30 35 40 45 50
n

A discrete time signal can be expressed by

These equations are used to find DFS of the signal. Thus a signal and its Fourier coefficients can be found
out in Matlab using above equations.

Task 2: Determine the periodic sequence given by the following DFS coefficients.

Ck = [0,j,-2j,-j] N=4
Ck = [0,1i,-2j,-1i];
N=4;
n=[0:N-1];
k=[0:N-1];
WN=exp(-1i*2*pi/N);
nk=n'*k;
WNnk=WN .^ (-nk);
x=(Ck * WNnk)/N

x=

0.0000 - 0.5000i -0.5000 + 0.5000i -0.0000 - 0.5000i 0.5000 + 0.5000i

Task 3: Determine DTFT of the following sequences and plot the magnitude and angle.

𝑥(𝑛) = (𝑛 + 2)(−0.7)𝑛−1 𝑢(𝑛 − 2) 𝑓𝑜𝑟 − 5 ≤ 𝑛 ≤ 5


clc
close all;
clear all;
n=-5:5;
x = (2+n).*(-0.7.^(n-1)).*[zeros(1,7) ones(1,4)];
k=n;
X=x*(exp(-j*pi/5)) .^(n'*k);
magX=abs(X);
angX=angle(X);
subplot(211)
stem(k,magX);
xlabel('n')
ylabel('magnitude')
title('magX')
subplot(212)
stem(k,angX);
xlabel('n')
ylabel('magnitude')
title('angX')
magX
magnitude 10

0
-5 -4 -3 -2 -1 0 1 2 3 4 5
n
angX
4

2
magnitude

-2

-4
-5 -4 -3 -2 -1 0 1 2 3 4 5
n

Fourier transform equation is used to find DTFT of the signal and then angX and magX commands are
used to find angle and magnitude of the signal.

S-ar putea să vă placă și