Lab: What for Lunch? Bob is very appreciative of your help throughout the semester. He wants to treat you for lunch. Since he is an amateur radio fan, he transmits the lunch menu to you through ham radio to see if you like it. The radio transmission uses amplitude modulation and the carrier frequency is 1.885 MHz. You receive the modulated signal. Now you need to demodulate the signal to find out the lunch menu. Lab Objectives: 1. Apply the multiplication property of Fourier transform, i.e.., time domain multiplication of two signals is equivalent to frequency domain convolution. See Table 4.1 for the property. Review Week 4 practice and homework problems 4.28 (b) (i) and (iii) for an example. This is a key concept of communication system.) 2. Understand the procedure to amplitude modulate a signal and be able to derive the Fourier transform of the modulated signal. 3. Understand the procedure to coherently demodulate a signal and be able to derive its Fourier transform. 4. Resample the signal when a signalis modulated and dernudulated based on Nyquist Theorem. 5. (Optional) Understand the impact of modulation index on coherent demodulation. To understand the theory of amplitude modulating and demodulating, it is crucial to understand the Fourier transform of a signal multiplied by a sinusoid. Suppose we have a signal m(t) and its Fourier transform is w), what is the Fourier transform of m(t)cose Wet)? From the multiplication property, we know M m(t) cos( Mt) F1 21 M(4) { [8W – ) + (6 + wc)) Due to the sifting property of delta function, we have m(t) cos(act) F12 [ MW-wc)) + MW+ wc)) In other words, if any signal is multiplied by a cosine signal in the tirne domain, in the frequency domain, it is equivalent to split the spectrum of the signal into two halves 12 M (jw), with one half shifted to the left by the frequency of the cosine signal We and the other half shifted to the right by we. For example, assume m(t)- cosus (2n100c) and wc-2×1000. Figure 1 shows the Fourier transforms (the FFT magnitude) of m(t) = COS (2.×1000) and m(t) cos(2x 1000t) respectively. As shown in the figure, the Faurier transform of m(t) is two impulses at +100Hz. After multiplied by cos(2x1000t), the spectrum of m(t) is split into two halves, one shifted to the left by 1000Hz, and the other shifted to the right by 1000Hz, and they end up centered around at £1000Hz respectively. Lab Tasks: Submit your derivation, answer to questions, MATLAB script and plot in a signal PDF file. 1. In this lab, you will need to use the “amdemod” (and possibly “ammod”) commands from MATLAB Communications Toolbox. If you haven’t installed the toolbox, you can go to “Home->Add-Ons->Manage Add- Ons” and go to “Get Add-Ons” and choose Communications Toolbox to install. 2. Read the tutorial on amplitude modulation/demodulation, 1. Derive the Fourier transform expression of the amplitude modulated signal DAM (W) in the tutorial. (Hint: All you need is Table 4.1 and 4.2.) 4. Derive the Fourier transform expression Rljw) of (4) in the tutorial. (Hint: Expand the expression and again all you need is Table 4.1 and 4.2.) 5. Given the R() you derived, what needs to be done to restore the original signal? In the MATLAB command window, type “type amdemod”. It will display the script for the demodulation function. Read the code and describe the demodulation process. How is the signal restored to its original form? Does the procedure make sense based on the Rlju) you derived? The script uses a butterworth low pass filter. What is the default cutoff frequency? Why is it a good choice? Refer to the MATLAB documentation you can type “help butter” at the command line) or noise removal lab for the syntax of “butter” command. 6. Download the modulated signal “lunch_modulated.txt”. Due to its large size, the file is compressed. You need to unzip the file first. 7. Download the MATLAB script “ab mod demod mesa.m”. The part of MATLAB code to modulate the message is commented out and included for your reference. Don’t uncomment this part until you decode the message and if you want to complete Task 9. Complete the script, and submit the completed script. Your task is to a. Dernodulate the message using “amdemod”, which is the inverse of “arriad” (example on how to use “ammod” is in the commented out code section). b. Down sample the demadulated message so that it can be played by a speaker. It is the inverse af up- sampling (example on how to use “resample” to do up-sampling is in the commented out code section). C. Plot and play the recovered message. 8. Submit the MATLAB plot of the recovered message. What is the lunch menu Bob sends? 9. (Optional) Once you successfully demodulate the message, you can save the message as “lunch.wav” using the “audiawrite” command. Now you can uncomment the modulation part of the code (also comment out the twa dlrnwrite and dlmread lines, so you don’t repeatedly writing and reading file), and experiment with different modulation indices (adjust the mu variable), can you recover message correctly when the modulation index is greater than 1? -1900 -1000 -500 500 1000 1000 100 1000 500 1000 1500 0 Frecuency (He) 0 500 Frequency (Hz) Figure 1. FFTs of m(t) = cos(21000) (left) and m(t) cos(21000) (right) lab mod demod mesg.m $ figure $ plot (am modulated data) | plot the modulated message MATLAB script to implement double sideband, full carrier amplitude $ modulation and demodulation $ Author: Chao Wang f dlmwrite(‘lunch_modulated.txt’, am modulated data) | write data to file $$ WRITE code to perform AM demodulation $ make sure the file is in the same directory as this matlab script $ and the file is UNZIPPED. am modulated data = dlmread (‘lunch modulated.txt’); $ read modulated data f demodulate the message using “amdemod” function & Syntax z = amdemod (Y, FC, F5, INI PHASE, CARRAMP), see line 36 for the & definition of the parameters in the ammod function & down sampling so that the signal can be played by a speaker & use the “resample” function (note line 33 shows how to upsample) $ to downsample from Fs to Esm $ (you need to first define Fsm, Fs is already defined) $ plot recovered message f play message using the original sampling frequency Esm $ Task: Complete and run the script. $ The places you need to add code start with a capitized word. clear all; close all; FC = 1.885e6; % carrier frequency, amateur radio 160-meter band B = 4000; f bandwidth for voice is 4KHz (refer to Figure 2 in the & amplitude modulation tutorial) $ In Figure 3 of the tutorial, FC + B will be signal frequency upper bound $ (actual max signal frequency could be smaller than this) Due to the Nyquist theorem, sampling frequency for modulated data must satisfy Fs>=2+ (FC+B) FS = 2* (FC+B); mu = 1; $ adjust modulation index A = 1/mu; $ carrier ampitude (based on the definition of modulation index) $$ This is the code used to modulate the message. $ $ You only uncomment this part if you are ready to do Task 8. $ $ It will take a while to run. $ [m, Fsm] = audioread (‘lunch.wav’); % read in the message, $ $ sampling rate Fsm = 8000Hz satisfies the Nyquist theorem given $ f the max voice fregency is 4KHZ. Note this is different from Fs above. $ $ Fsm is the sampling rate for the original signal, whereas % % Fs is the sampling rate for the modulated signal. $ plot (m) % plot the message $ $% AM modulation $ f upsample input signal from Fs to Esm to satisfy Nyquist $ data for mod resampled = resample (m, Fs, Esm); $ $ modulate with carrier signal % % Syntax Y = ammod (X, FC,FS, INI PHASE, CARRAMP), i.e. use $ $ c(t) = CARRAMP*cos (2*pi*Fct+INI PHASE) (equation 1 in the tutorial) $ $ to modulate signal x with sampling frequency Fs. $ $ Here CARRAMP = A, INI PHASE = 0. $ am modulated data = ammod (data for modesampled, Fc, Fs, 0, A);


15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!

Why US?

100% Confidentiality

Information about customers is confidential and never disclosed to third parties.

Timely Delivery

No missed deadlines – 97% of assignments are completed in time.

Original Writing

We complete all papers from scratch. You can get a plagiarism report.

Money Back

If you are convinced that our writer has not followed your requirements, feel free to ask for a refund.

WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!