Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

EE301-HW 3

Tuba Gök-2575306

Osman Melih Muslu- 2516581

Elif Balaban-2515591

Part a)
x(t) given is defined and plotted using the following code:

Ts = 4e-5; % sec
T_observation = 20e-3; % sec
t = (0:1:T_observation/Ts-1)*Ts;
x_t = cos(2*pi*100*t) + cos(2*pi*120*t); % Generation of the signal

figure;
plot(t, x_t);
xlabel('Time (s)');
ylabel('Amplitude');
title('Signal in Time Domain');
grid on;

1
In the time domain there are two sinusoids with the different frequencies 100Hz and 120Hz respectively. The
peaks and troughs can be seen from the plot. Since the two sinusoids have phase difference, the amplitude of
the signal decreases in the time interval of [0,0.02] giving the maximum amplitude at 0, where both sinusoids
have the amplitude of 1.

Part b)
Ts = 4e-5; % sec
T_observation = 20e-3; % sec
t = (0:1:T_observation/Ts-1)*Ts;
x_t = cos(2*pi*100*t) + cos(2*pi*120*t);

Fourier_Transform(x_t, Ts, 10000)

In this part, the magnitude of fourier transform of signal x(t) is plotted. Since, it is the magnitude plot the
imaginary parts of the signal is not included. Theoratically, the signals in the frequency domain should be in the
dirac functions form but cannot be identified easily compared to the case for the theoretical results. Due to the
effect of spreading in the resulting frequency reprasantation, the peaks at the frequencies of the x(t) signal are
not as sharp as delta functions.

Part c)

2
Ts = 4e-5; % sec
T_observation = 40e-3; % sec
t = (0:1:T_observation/Ts-1)*Ts;
x_t = cos(2*pi*100*t) + cos(2*pi*120*t);

Fourier_Transform(x_t, Ts, 10000)

Sinusoidal signals is observed as impulses in the frequency domain according to theoratical knowledge.
However, the graphs we observe in this homework do not contain sharp impulse components because of
the reason explained above. By comparing the graphs obtained in part b and part c, it can be seen that as
duration of x(t) increases, the number of peaks in the graph also rises. This is because, in much larger duration
the signal continues to create new values. As the signal keep creating new values, differentiating the signals
becomes harder. However, signal become to resemble delta function more.

Part d)
Ts = 4e-5; % sec
T_observation = 100e-3; % sec
t = (0:1:T_observation/Ts-1)*Ts;
x_t = cos(2*pi*100*t) + cos(2*pi*120*t);

Fourier_Transform(x_t, Ts, 10000)

3
In this part, x(t) is observed in duration for 100 ms. That is, in this part, more different values are obtained due
to more various locations of the sinusoids with respect to each other. This situation makes identifying the signals
more complicated. On the other hand, the peaks in this plot are sharper than the previous one. In other words,
in this case, they are more similar to impulses than ones observed in part b and c

Part e)
Ts = 4e-5; % sec
T_observation = 1000e-3; % sec
t = (0:1:T_observation/Ts-1)*Ts;
x_t = cos(2*pi*100*t) + cos(2*pi*120*t);

Fourier_Transform(x_t, Ts, 10000)

4
In part e, the same signal x(t) is observed for 1000 ms. Since the duration of observation of the signal is the
greatest. As time duration increases, the peak values that are occured because of the phase shift between
two sinusoidal signals varies as explained above. More peak values result in more peaks, looking likemuch
more two impulses in this graph, in frequency domain. For this reason, it is almost impossible to identify two
sinusoidal signals in frequency domain as seen from the graph.

Part f)

That is because of the finite duration of our signal whereas a sinusoidal signal extends infinitely in time and
this would result in a delta function in the frequency domain. However x(t) has a finite duration (from 0 to
0.002 seconds) that provides spread in the frequencies which makes harder to identify individual frequency
components in the frequency domain. This can also interpreted as follows: x(t) is only defined and has nonzero
values within the time range [0, 0.002] seconds. Outside of this time interval,it is not defined or nonzero. The
signal is essentially time-limited to the specified duration.

function [] = Fourier_Transform(x_t, Ts, max_frequency)

5
OS = 23; % Oversampling factor
X_j_omega = fft(x_t, OS * length(x_t)); % Compute the FFT
omega = (0:1:(OS * length(x_t))-1)/(OS * length(x_t))*(1/Ts)*2*pi - (1/Ts)*pi; % Frequency

% Plot the magnitude of the Fourier Transform


figure;
plot(omega, abs(fftshift(X_j_omega)), 'LineWidth', 2);
grid on;
xlabel('Angular Frequency (\omega) in rad/s');
ylabel('X(j\omega)');
title('Approximate Fourier Transform');
xlim([-max_frequency, max_frequency]);
end

You might also like