Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

MATLAB Project 2 AM and FDM Due Time and Date: 11:59pm, August 5th, 2021 2-3 students is required for each group. For a 1-person team, 5% score will be deducted. Please specify the student information...

1 answer below »
MATLAB Project 2
AM and FDM
Due Time and Date: 11:59pm, August 5th, 2021
2-3 students is required for each group. For a 1-person team, 5% score will
e deducted. Please specify the student information (name and student ID) fo
every group member in your group. Access to Matlab is needed to work on this
project. The source files for this project are located at
ightSpace → contents
→ Project2.
1 Source files
There are seven source files:
1. ece301cov.m
2. x1.wav ∼ x6.wav
’ece301cov.m’ is a function which implements convolution of two inputs, and
outputs the convolution result. ’x_i.wav’ are sound files clipped from music
pieces.
2 Submission items
The following items are to be submitted:
1. The Maltab code source file
2. The report
3. The sound wav files for hatxi_lp.
3 The project
3.1 Overview
In this project, you will practice on implementing systems of amplitude modu-
lation (AM) and frequency division multiplexing (FDM) we learned in lecture
1
22-25. The project contains two parts. Part 1 involves AM-DSB and FDM. It
equires submission. Part2 involves AM-SSB with FDM. It is optional without
submission required.
Imagine that there is an antenna tower. In part 1, it has three signals,
x_i, i = 1, 2, 3, to send out to distant users. It is licensed with 8KHz
andwidth, equivalently the frequency band [−8KHz, 8KHz]. Your task is
to design an AM-DSB & FDM system, to send the three signals simultaneously
to distant users and ensure that perfect reconstruction is possible at users.
You may assume that the channels between the sender and users are perfect,
without any distortion or delay. So Phase Lcok Loop (PLL) is not needed.
You can find the model of an AM-DSB & FDM system in details in lecture
22-25. As introduced in these lectures, there are several important frequency
parameters to design so that perfect reconstruction is possible. They are the
ca
ier frequencies and cutoff frequencies of LPF/BPF.
In Part 2, the scenario is similar to Part 1. The differences are that there
are 6 signals, x_i, i = 1, · · · , 6, to send out simultaneously, and an AM-SSB &
FDM system should be used. You need to design the frequency parameters so
that perfect reconstructions of the 6 signals are possible at users.
The original sound waves may not be band-limited. We will generate a sub-
optimal band-limited version for each of them prior to modulation, as you will
see in the next section.
The suggested way to work on this project is to
1. Design frequency parameters. You may design frequency parameters
y applying them to the AM & FDM system with drawing the intermedi-
ate signal frequency spectrums as we did in lectures. Check whether you
design generates undistorted frequency specturms.
2. Test your design in Matlab. Implement your AM & FDM system in
Matlab step by step. Observe your results.
3. Re-design if e
or occurs. Recall that the goal is to have a AM &
FDM system with perfect reconstruction on the receiver side. If any of
your reconstructed signal sounds differently to its original band-limited
version, you need to check whether any e
or happens in the Matlab code
or go back to step 1 to re-design and test the new design in Matlab again.
When their sounds match, it means your design succeeds.
3.2 Start
To start, please do the following 3 steps:
1. Download ’ece301cov.m’ and ’x_i.wav’ and save them at one folder.
2. Open Matlab and change the directory to where the source files are saved.
3. Generate a time axis for your signal ’x_i.wav’ using the following com-
mands:
2
duration = 8;
f_sample = 44100;
t = (((0-4)*f_sample+0.5):((duration-4)*f_sample-0.5))/f_sample;
It creates a time duration centered at 0 and with length of 8, where a
signal is sampled every 1/f_sample seconds.
3.3 Part 1: AM-DSB and FDM
1. Load the sound signals x_i, i = 1, 2, 3 using the following commands:
[x0_i,f_sample1] =audioread(’x_i.wav’);
x_i = x0_i’;
The command x_i = x0_i’ transforms a column vector into a row vector.
Only signals x_i, i = 1, 2, 3 are used in Part 1. Signals x_i, i = 4, 5, 6 are
eserved for Part 2.
2. Listen to the sound signals x_i, i = 1, 2, 3 using the following command:
soundsc(x_i,f_sample1);
3. Input x_i, i = 1, 2, 3 to an ideal low-pass filter with fcutoff = 1KHz to
generate band-limited signals xi_lp. Hint: Refer to Project.1 Part 3.
4. Listen to the band-limited signals. Plot the sound waveforms xi_lp and
include the plot in your report.
figure(i)
plot(t,xi_lp);
title(’original sound waveform i’);
xlabel(’t’);
ylabel(’xi_lp’);
5. Simulate the sender side AM-DSB part using your designed ca
ier fre-
quencies. Make sure the modulated signals do not exceed the frequency
and [−8KHz, 8KHz]. Name the modulated signals as yi.
6. Complete the sender side multiplexing by summing yi to generate the
signal to send out, named as y.
7. Now simulate the receivers(users) side by demultiplexing/demodulating
the received signal y for signals xi_lp i = 1, 2, 3 respectively. Denote the
demodulated signals as hatxi_lp i = 1, 2, 3, respectively.
3
8. Listen to your results hatxi_lp i = 1, 2, 3 and compare them to xi_lp
i = 1, 2, 3 respectively. Are xi_lp and hatxi_lp the same for each signal?
Plot the sound waveforms hatxi_lp and include the plot in your report.
figure(i)
plot(t,hatxi_lp);
title(’demodulated sound waveform i’);
xlabel(’t’);
ylabel(’hatxi_lp’);
9. Save the sound wave file using the following command:
audiowrite(’hatxi_lp.wav’,hatxi_lp,f_sample);
10. Describe whether the AM-DSB & FM process has changed the original
and-limited signals hatxi_lp.
3.4 Part 2: AM-SSB and FDM (Optional)
1. Load the sound signals x_i, i = 1, · · · , 6 using the following commands:
[x0_i,f_sample1] =audioread(’x_i.wav’);
x_i = x0_i’;
2. Listen to the sound signals x_i, i = 1, · · · , 6 using the following command:
soundsc(x_i,f_sample1);
3. Input x_i, i = 1, · · · , 6 into an ideal low-pass filter with fcutoff = 1KHz
to generate band-limited signals xi_lp.
4. Plot the sound waveforms xi_lp.
figure(i)
plot(t,xi_lp);
title(’original sound waveform i’);
xlabel(’t’);
ylabel(’xi_lp’);
5. Simulate the sender side AM-SSB part using your designed ca
ier fre-
quencies. Make sure the modulated signals do not exceed the frequency
and [−8KHz, 8KHz]. Name the modulated signals as yi_ssb.
4
6. Complete the sender side multiplexing by summing yi_ssb to generate
the signal to send out, named as y_ssb.
7. Now simulate the receivers(users) side by demultiplexing/demodulating
the received signal y_ssb for signals xi_lps i = 1, · · · , 6 respectively.
Denote the demodulated signals as hatxi_lps i = 1, · · · , 6, respectively.
8. Listen to the signals hatxi_lps and plot their sound waveforms.
figure(i)
plot(t,hatxi_lps);
title(’demodulated sound waveform i’);
xlabel(’t’);
ylabel(’hatxi_lps’);
9. Save the sound wave file using the following command:
audiowrite(’hatxi_lp.wav’,hatxi_lp,f_sample);
10. Compare hatxi_lps with xi_lps. Describe whether the process has
changed the waveform xi_lps.
5
    Source files
    Submission items
    The project
    Overview
    Start
    Part 1: AM-DSB and FDM
    Part 2: AM-SSB and FDM (Optional)

function [ y ] =ece301conv(x1,x2)
%copyright: Chih-Chun Wang
%UNTITLED1 Summary of this function goes here
% Detailed explanation goes here
duration=8;
x1e=[x1 zeros(size(x1))];
x2e=[x2 zeros(size(x2))];
fx1e=fft(x1e);
fx2e=fft(x2e);
fye=fx1e.*fx2e;
ye=ifft(fye);
y=ye(floor(length(x1)/2)+(1:length(x1)))/length(x1)*duration;

%% Generate a time axis for your signal Â’x_i.wavÂ’
duration = 8;
f_sample = 44100;
t = (((0-4)*f_sample+0.5):((duration-4)*f_sample-0.5))/f_sample;
%% Load the sound signals x_i, i = 1, 2, 3 using the following commands:
% [x0_i,f_sample1] =audioread(Â’x_i.wavÂ’);
% x_i = x0_iÂ’;
[x0_1,f_sample1] =audioread('x1.wav');
x_1 = x0_1';
[x0_2,f_sample1] =audioread('x2.wav');
x_2 = x0_2';
[x0_3,f_sample1] =audioread('x3.wav');
x_3 = x0_3';
% A
ay of input signals
input_signals = [x_1 x_2 x_3];
%% Listen to the sound signals x_i, i = 1, 2, 3 using the following command:
%{
soundsc(x_1,f_sample1);
soundsc(x_2,f_sample1);
soundsc(x_3,f_sample1);
%}
%% Part 3
% Input x_i, i = 1, 2, 3 to an ideal low-pass filter with fcutoff = 1KHz to generate band-limited signals xi_lp.
f_cutoff = 1000;
lpf = sin(2*pi*f_cutoff*t)./pi./t;
figure(1)
plot(t,lpf);
title('Low Pass Filter with f_cutoff 1KHz');
xlabel('t')
axis([-0.03,0.03,-500,1500]);
% Convolve the sound input x_1,x_2,x_3 with low pass filter, generate band limited signals xi_lp
x1_lp = ece301conv(lpf,x_1);
x2_lp = ece301conv(lpf,x_2);
x3_lp = ece301conv(lpf,x_3);
%Save the bandlimited audio for listening in part 4
audiowrite('x1_lp.wav',x1_lp,f_sample)
audiowrite('x2_lp.wav',x2_lp,f_sample)
audiowrite('x3_lp.wav',x3_lp,f_sample)
%% Part 4
%Plot the sound waveforms xi_lp and include the plot in your report.
figure(2)
plot(t,x1_lp);
title('Bandlimited Sound Waveform 1');
xlabel('t');
ylabel('x1_lp');
figure(3)
plot(t,x2_lp);
title('Bandlimited Sound Waveform 2');
xlabel('t');
ylabel('x2_lp');
figure(4)
plot(t,x3_lp);
title('Bandlimited Sound Waveform 1');
xlabel('t');
ylabel('x3_lp');
%Listen to the band-limited signals.
%{
soundsc(x1_lp,f_sample1);
soundsc(x2_lp,f_sample1);
soundsc(x3_lp,f_sample1);
%}
%% Part 5
%Simulate the sender side AM-DSB part using your designed ca
ier fre-quencies. Make sure the modulated signals do not exceed the frequency band [?8KHz, 8KHz].
Answered Same Day Aug 05, 2021

Solution

Nishchay answered on Aug 06 2021
151 Votes
ece301conv.m
function [ y ] =ece301conv(x1,x2)
%copyright: Chih-Chun Wang
%UNTITLED1 Summary of this function goes here
% Detailed explanation goes here
duration=8;
x1e=[x1 zeros(size(x1))];
x2e=[x2 zeros(size(x2))];
fx1e=fft(x1e);
fx2e=fft(x2e);
fye=fx1e.*fx2e;
ye=ifft(fye);
y=ye(floor(length(x1)/2)+(1:length(x1)))/length(x1)*duration;
hatx1_lp.wav
hatx2_lp.wav
hatx3_lp.wav
project2.m
%% Generate a time axis for your signal Â’x_i.wavÂ’
duration = 8;
f_sample = 44100;
t = (((0-4)*f_sample+0.5):((duration-4)*f_sample-0.5))/f_sample;
%% Load the sound signals x_i, i = 1, 2, 3 using the following commands:
% [x0_i,f_sample1] =audioread(Â’x_i.wavÂ’);
% x_i = x0_iÂ’;
[x0_1,f_sample1] =audioread('x1.wav');
x_1 = x0_1';
[x0_2,f_sample1] =audioread('x2.wav');
x_2 = x0_2';
[x0_3,f_sample1] =audioread('x3.wav');
x_3 = x0_3';
% A
ay of input signals
input_signals = [x_1 x_2 x_3];
%% Listen to the sound signals x_i, i = 1, 2, 3 using the following command:
%{
soundsc(x_1,f_sample1);
soundsc(x_2,f_sample1);
soundsc(x_3,f_sample1);
%}
%% Part 3
% Input x_i, i = 1, 2, 3 to an ideal low-pass filter with fcutoff = 1KHz to generate band-limited signals xi_lp.
f_cutoff = 1000;
lpf = sin(2*pi*f_cutoff*t)./pi./t;
figure(1)
plot(t,lpf);
title('Low Pass Filter with f_cutoff 1KHz');
xlabel('t')
axis([-0.03,0.03,-500,1500]);
% Convolve the sound input x_1,x_2,x_3 with low pass filter, generate band limited signals xi_lp
x1_lp = ece301conv(lpf,x_1);
x2_lp = ece301conv(lpf,x_2);
x3_lp = ece301conv(lpf,x_3);
%Save the bandlimited audio for...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here