Document 11
Document 11
1.
Objective:
To observe how changing the time interval affects the magnitude
spectrum of a given signal.
Explanation:
In the original setup, the time interval is from -T/2 to T/2. This is a
symmetric range around zero, which ensures that both positive and
negative frequencies are represented in the magnitude spectrum.
When changing the time interval to 0 to T, the signal starts at zero and
ends at T, so the signal will be missing the negative frequency
components, potentially causing the magnitude spectrum to show a
distorted or half-wave pattern.
Changing the interval to -T/4 to 3T/4 will affect the representation of the
signal in both time and frequency domains. The length of the interval
reduces the representation of the signal, which can influence the
frequency resolution.
Changing the interval to -T to T should return a symmetric frequency
spectrum again, but the time-domain signal will be mirrored.
MATLAB Code:
T = 1; % Period
X1 = abs(fft(x1));
X2 = abs(fft(x2));
X3 = abs(fft(x3));
figure;
2.
We have stated that c(k+1) = c(k). Modify the code for example 1 and see
whether you get a periodic repetition of c(k).
Objective:
To modify the code and observe if periodic repetition of c(k) occurs.
Explanation:
The modification involves changing the relation of c(k) such that
c(k+1) = c(k). By doing so, we expect to see a periodic pattern
emerging from the signal.
MATLAB Code:
N = length(x); % Length of the signal
for k = 1:N-1
if mod(k,2) == 0
end
end
3.
Explanation:
The given signal is a combination of sinusoidal and cosine waves. The
FFT (Fast Fourier Transform) will be used to observe its frequency
components.
MATLAB Code:
f1 = 300; % Frequency for 3sin(300πt)
% Non-sinusoidal signal
title('Signal x(t)');
X = abs(fft(x));
xlim([0 1200]);
4.
Derive the power density spectrum for a rectangular pulse train and observe
their dual nature in time and frequency domain.
Objective:
To analyze the power density spectrum of a rectangular pulse train and
observe its characteristics in both time and frequency domains.
Explanation:
A rectangular pulse train is generated using square(), and its power
density spectrum is calculated using the FFT.
MATLAB Code:
PART-B
1.
Increase the range of the frequency grid to [0, 2π]. Observe and explain the
effects.
Explanation:
Typically, the frequency grid is from [-π, π] or [-2π, 2π]. When you
change the frequency grid to [0, 2π], you only observe the positive
frequency components.
As a result, the frequency spectrum of the signal will only display the
positive frequency part, and the negative frequency components will be
excluded, which might result in an incomplete representation of the
signal.
MATLAB Code:
% Define frequency grid and time signal
X = abs(fft(x));
figure;
plot(f_axis, X);
xlabel('Frequency (radians)');
ylabel('Magnitude');
2.
Change the range of the frequency range to [-2π, 2π]. Observe and explain the
effects.
Explanation:
When you adjust the frequency grid to [-2π, 2π], the signal's frequency
spectrum will include both positive and negative frequencies.
This allows the signal to be fully represented, and you'll see a symmetric
frequency spectrum around zero.
MATLAB Code:
X = abs(fft(x));
figure;
plot(f_axis, X);
xlabel('Frequency (radians)');
ylabel('Magnitude');
3.
Verify the effect of changing the index (n) to -40:120, -40:80. In each case
observe the reconstructed signal.
Explanation:
Changing the index n will affect the reconstruction of the signal.
If n = -40:120, the reconstructed signal will be based on a broader range
of indices, providing more information.
If n = -40:80, the signal will have a smaller time range and some
information will be omitted, affecting the reconstructed signal's quality.
MATLAB Code:
% Define signal and indices
n1 = -40:120;
n2 = -40:80;
x1 = cos(2pi5n1);
x2 = cos(2pi5n2);
figure;
subplot(2,1,1);
plot(n1, x1);
subplot(2,1,2);
plot(n2, x2);
4.
If you reconstruct the signal in n_re=240:240, why do you get a repetition of the
aperiodic signal? Explain.
Explanation:
Reconstructing the signal with n_re=240:240 leads to a repetition of the
aperiodic signal because the index range forces the signal to repeat from
its starting point.
This repetition occurs due to the periodic nature of the reconstruction
when the time range is not large enough to represent the full signal.
MATLAB Code:
figure;
plot(n_re, x_re);
5
Consider the continuous time signal shown in Fig. 16. Sample it and then find
out the Fourier transform in terms of the analog frequency.
Explanation:
You are given a continuous time signal, which will be sampled at a
specific frequency.
After sampling the signal, you need to calculate the Fourier Transform to
analyze the frequency components in terms of the analog frequency.
MATLAB Code:
% Sample the continuous signal
x_cont = cos(2pi5*t_cont);
% Sampled signal
t_sampled = 0:1/Fs:1;
x_sampled = cos(2pi5*t_sampled);
X_sampled = abs(fft(x_sampled));
figure;
subplot(2,1,1);
plot(t_cont, x_cont);
subplot(2,1,2);
plot(f_sampled, X_sampled);