0% found this document useful (0 votes)
3 views

ID=22-46790-1(DatacommLabR-02)

This lab report details the study of signal frequency, spectrum, and bandwidth using MATLAB. It includes the calculation of amplitudes, plotting of signals in both time and frequency domains, and quantization of the signal into six levels. The report concludes with the determination of the bandwidth as 50 Hz and provides visual representations of the original and quantized signals.

Uploaded by

shusanto64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

ID=22-46790-1(DatacommLabR-02)

This lab report details the study of signal frequency, spectrum, and bandwidth using MATLAB. It includes the calculation of amplitudes, plotting of signals in both time and frequency domains, and quantization of the signal into six levels. The report concludes with the determination of the bandwidth as 50 Hz and provides visual representations of the original and quantized signals.

Uploaded by

shusanto64
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

AMERICAN INTERNATIONAL UNIVERSITY-BANGLADESH

FACULTY OF ENGINEERING
DATA COMMUNICATION
Fall 23-24
Section: I

LAB REPORT ON:


Study of signal frequency, spectrum, bandwidth using MATLAB
Supervised By
Shadman Shahriar Alam

Name ID

MD. SAIF AHMED SOURAV 22-46790-1


Repot title:
Study of signal frequency, spectrum, bandwidth using MATLAB.
Performance Task for Lab Report:
My ID is = 22-46790-1
So, A = 2, B = 2, C = 4, D = 6, E = 7, F = 9, G = 0, H = 1
Here, 𝑥1 (t) =𝐴1 * cos (2 * π *(C *10) * t)
𝑥2 (t) = 𝐴2 * cos (2 * π * (F*10) * t)
And,
𝑥3 (t) = x1 (t) + 𝑥2 (𝑡)

(a) Select the value of the amplitudes as follows: let 𝐴1 = G+D and 𝐴2 = A+F.
Solve:
The values of amplitude,
𝐴1 = G + D 𝐴2 = A + F
=0+6 =2+9
=6 = 11

(b) Make a plot of x3 over a range of t which will exhibit approximately 2 cycles. Make sure the plot
starts at a negative time so that it will include t = 0 and at least 20 samples per period of the wave.
Solve:
We have already obtained the values of A1 =6, A2 = 11, f1 =40 & f2. =90.
MATLAB Code:
fs = 1000;
t = -0.5:1/fs:0.5-1/fs;
f1 = 40;
f2 = 90;
A1 = 6;
A2 = 11;
x1 = A1*sin(2*pi*f1*t);
x2 = A2*sin(2*pi*f2*t);
x3 = x1+x2;
plot(t, x3)
Figure 1: Signal (𝑥3 ) Over Time (t).
(c) Plot x3 in the frequency domain and calculate its bandwidth.
Solve:
MATLAB Code:
A1 = 6;
A2 = 11;
f1 = 40;
f2 = 90;
fs =10000;
t= 0:1/fs:1-1/fs;
x1 = A1 * cos(2 * pi * f1 * t);
x2 = A2 * cos(2 * pi * f2 * t);
x3 = x1 + x2;
fx3 = fft(x3); fx3 = fftshift(fx3) / (fs / 2);
f = fs / 2 * linspace(-1, 1, fs);
subplot(4,1,4);
plot(f, abs(fx3));
axis([-1 95 0 15]);
xlabel('Frequency (Hz)');
ylabel('Amplitude');
title('Frequency Domain of x3');
Figure 2: Signal (𝑥3 ) in frequency domain.

Here from the frequency domain value is,

The highest is 90.50 Hz and the lowest is 40.50

We know that,

Bandwidth=Highest Frequency-Lowest Frequency

=90.50-40.50

=50Hz

(d) Quantize x3 in 6 equally distributed levels and provide image for one cycle of the original signal
and quantized signal.
Solve:
MATLAB Code:
fs = 1000;
t = 0:1/fs:1/f1;
f1 = 40;
f2 = 90;
A1 = 6;
A2 = 11;

% Original signal
x1 = A1 * cos(2 * pi * f1 * t);
x2 = A2 * cos(2 * pi * f2 * t);
x3 = x1 + x2;
% Quantization
L = 6;
min_x3 = min(x3);
max_x3 = max(x3);
q_levels = linspace(min_x3, max_x3, L);
q_step = (max_x3 - min_x3) / (L - 1);

% Quantizing the signal


x3_quantized = min_x3 + round((x3 - min_x3) / q_step) * q_step;

% Plotting
figure;
subplot(2,1,1);
plot(t, x3, 'LineWidth', 1.5);
title('Original Signal x_3(t)');
xlabel('Time (s)');
ylabel('Amplitude');
subplot(2,1,2);
plot(t, x3_quantized, 'LineWidth', 1.5, 'Color', 'r');
title('Quantized Signal x_3(t) with 6 Levels');
xlabel('Time (s)');
ylabel('Amplitude');

Figure-4: Image for the original signal and quantized signal.

You might also like