Experiment No 3.pdf
Short Description
experiment...
Description
00
TECHNOLOGICAL UNIVERSITY OF THE PHILIPPINES COLLEGE OF ENGINEERING ELECTRONICS ENGINEERING DEPARTMENT EXPERIMENT NO. 3 AM‐MATLAB & ACTUAL EXPERIMENTATION GROUP LEADER: VILLALUNA, JASON A. MEMBERS: ALBA, YUGEL RUDOLF NOMIL, DIANA S. MONJE, MANOLITO JR. G. BSESE‐4B OCTOBER 16, 2013 ENGR. JOHN WILLIAM ORILLO INSTRUCTOR
EXPERIMENT 3: AM‐MATLAB & ACTUAL EXPERIMENTATION
I.
OBJECTIVES
The main objectives of this experiment are: 1.
The gain a clearer understanding about double‐sideband suppressed carrier (DSB‐SC)and amplitude modulation.
2.
To learn how to simulate modulation/demodulation system for DSB‐SC and Am using MATLAB for synthetic and real signals (such as speech).
II. 1.
PRE‐LAB WORK Read the relevant material in your textbook (Chapter 4).
2. a.
Using MATLAB, perform the following: x=[0 1 2 3 4 5]
b. y=[1 2 3 4 5 6] Now multiply x by y using two ways. The first one is the usual MATLAB multiplication (star(x*y)) and the other one is what we called point‐wise array multiplication (a dot followed by a star (x.*y). What is the difference between the two? *Write your answer in Results and Discussion 3.
Using MATLAB generate a vector t=[0:0.001:1]. Then generate m=cos(2*π*t). Plot m,v, and the product x=mv. Are you going touse multiplication between matrices or vectors that are representing a function? *Write your answer in Results and Discussion
III. LAB WORK
1.
Use MATLAB to simulate the following block diagram
x(t) y(t)= x(t) cos(2πfct)
w(t) v(t)
X
cos(2πfct)
X
LPF
cos(2πfct + ψ)
Assume ψ 0 and let x(t) cos(2π2000t). Use a carrier frequency of fc 20kHz. Plot x(t), y(t), w(t), and v(t), and their magnitude spectrums each in a two‐panel figure. Define the time vector t as [0:200]*ts where ts is the step size given by ts =1/(10 fc ) . *Write your answer in Results and Discussion At the receiver end, you need to design a Low Pass Filter (LPF). In MATLAB, you can use a type of filters known as Butterworth filters. For example, you can design a given filter with some order n and cut‐off frequency fc which is typically normalized in Matlab and given by 2 fcts (where ts is the sampling period). To obtain the filter coefficients, the statement will be: [num,den]=butter(n, 2 fcts ), where num and den are the numerator and denominator coefficients of the rational function representing the analog filter. You can use n 5 for example. Once you obtained these coefficients, you can use the Matlab function filter to filter the signal w(t) using the designed LPF. That is, v = filter(num,den,w). Refer to the additional notes below for further discussion on how to use filters in Matlab. Useful MATLAB Functions: cos, fftshift(fft( )), butter, filter, abs, plot, subplot, figure,xlabel,ylabel, title.
2.
Repeat Part 1 with2 different values for the receiver phase offset:ψ=π/ 2&π. What do you notice at the receiver end? Is there any difference between the recovered signal here and the one obtained in Part 1? Why is that? And what is the solution to this problem? *Write your answer in Results and Discussion Repeat Part 1 by making y(t) = Ac (1+ µxn (t)) cos(2πfct) where is the modulation index of the AM wave, Ac is the carrier amplitude (set it equal to 4), and xn(t)is the normalized version of x(t). Set it to be 0.5 (50% modulation).
3. At the demodulator, you can implement the functionality of the simple envelope detector that you studied in class (built with a diode, a capacitor and resistor) by using simple MATLAB code to produce full‐wave rectification (absolute value function), followed by low‐pass filtering. This is illustrated in the following block diagram. You need to think about setting the appropriate cutoff frequency for the LPF. In addition, you can also add a mechanism to remove the DC component from the signal y(t)
LPF
Received Signal
4. Repeat Part 3 by letting the modulation index equal to 1.2. What will happen to thereceived signal? Explain. Since the modulation index is greater than 1, it caused a severe distortion in the receiver. It is called over modulation. It sometimes causes harmonic generation.
5. Load the file called Exp3Part5.mat. This data file contains: a. A vector called ms, which is a speech signal sampled with ts 1/96E3 s. b. A vector called t that represents time. With a carrier of 24kHz, transmit and receive ms using the AM system in part 3 with µ = 0.5 &1.5 . For both cases show the following: a. In one figure with two panels, the time and frequency domain representations of the modulated waves b. Listen to ms by typing (sound(ms,96E3), pause, then press Enter to continue). Also listen to the received signal v by typing sound(v,96E3). Comment on the differences between the two signals. The demodulated waveform in the receiver is a replica of the modulated waveform. Their only difference is that the demodulated wave has lower amplitude compared to the other. Note: in order to be able to see the spectrum of the signal ms, after plotting the magnitudespectrum of ms, (denoted by Ms) vs. f, type: axis([‐4E3,4E3,0,max(|Ms|)]) Useful MATLAB Functions: load, sound, pause, axis.
IV.
ADDITIONAL NOTES (FILTERS IN MATLAB) To further understand how to use filters in Matlab, recall from EE207 that the rational transfer function of a filter can be expressed in terms of the Laplace variable s by:
⋯ ⋯
where the a’s and b’s define the transfer function coefficients. These coefficients completely characterize the filter response. Matlab returns these two vectors as a result of designing a filter with a certain type (e.g., Butterworth, etc) and cutoff frequency. Forexample, with num=[bm ,bm−1 ,…,b0 ] and den=[an , an−1 ,…, a0 ] , the filter design is done by : [num,den]=butter(n, 2 fcts ), Notice also that the filter order n is important to specify. For example, t is shown that for these Butterworth‐type filters, as the filter order increases the filter response will approach that of an ideal “brick‐ wall” response.
V.
RESULTS AND DISCUSSIONS Discuss and show all the output of the plot command. Include the Syntax used. For PRE‐LAB 2.
The first method produces an error and it is the multiplication of one matrix to another while the
second method is the entry by entry product of X and Y and is an array multiplication. 3.
We will use the multiplication between vectors that represents function..
For LAB WORK 1.
The DSBSC modulated signal y(t) is simply obtained by multiplying the information signal with the carrier. The
resulating waveform becomes passband signal. Therefore, this signal becomes a passband signal with frequency that is much larger than the maximum frequency in m(t).The demodulation process of a DSBSC signal involves obtaining the original information signal or scaled version of it from the modulated signal. This is done by multiplying the modulated signal y(t) with another carrier signal that has EXACTLY the same frequency and as the carrier signal in the modulator. The amplitude of the two carrier signals in the modulator and demodulator are not important since they just affect the magnitude of the different intermediate signals and final output signal of the demodulator. However, as seen w(t), the original message signal (scaled by 1/2) is present but also other components with frequencies centered around 2ωc and –2ωc. These components are undesired and must be removed to get the message signal. This can be done using a LPF .This is simply a scaled version of the original transmitted signal that can now be easily amplified to obtain the original signal exactly.
WAVEFORM and MAGNITUDE SPECTRUM:
x(t):
y(t):
w(t):
v(t):
SYNTAX
fc=2000;ts=1/(10*fc);t=[0:200]*ts;psi=0;n=5; [num,den]=butter(n,2*fc*ts); x=cos(2*pi*2000*t); y=x.*cos(2*pi*fc*t); w=y.*cos((2*pi*fc*t)+psi); v=filter(num,den,w); figure(1),subplot(211),plot(t,x,'r'), grid on,xlabel('Time'), ylabel('Amplitude'), title('x(t)'); subplot(212), stem(abs(fftshift(fft(x)))), grid on, xlabel('Frequency'), ylabel('Magnitude'), title('Magnitude Spectra OF x(t)'); figure(2), subplot(211) plot(t,y,'g'), grid on, xlabel('Time'), ylabel('Amplitude'), title('y(t)'); subplot(212), stem(abs(fftshift(fft(y)))), grid on, xlabel('Frequency'), ylabel('Magnitude'), title('Magnitude Spectra OF y(t)'); figure(3), subplot(211) plot(t,w,'m'), grid on, xlabel('Time'), ylabel('Amplitude'), title('w(t)'); subplot(212), stem(abs(fftshift(fft(w)))), grid on, xlabel('Frequency'), ylabel('Magnitude'), title('Magnitude Spectra OF w(t)'); figure(4), subplot(211) plot(t,v,'c'), grid on, xlabel('Time'), ylabel('Amplitude'), title('v(t)'); subplot(212), stem(abs(fftshift(fft(v)))), grid on, xlabel('Frequency'), ylabel('Magnitude'), title('Magnitude Spectra OF v(t)');
2.
Compared to the receiver signal of part 1, having a value of ∏/2 for ψ makes the signal to shift 90°.
While having a value of ∏ for ψ made the signal to be inverted by 180°. This is because ψ is an added angle to another cosine function multiplied to another cosine function.
WAVEFORM and MAGNITUDE SPECTRUM: x(t):
y(t):
w(t):
v(t):
SYNTAX: fc=2000;ts=1/(10*fc);t=[0:200]*ts;psi v(t):=(pi/2);n=5; [num,den]=butter(n,2*fc*ts); x=cos(2*pi*2000*t); y=x.*cos(2*pi*fc*t); w=y.*cos((2*pi*fc*t)+phase); v=filter(num,den,w); figure(5), subplot(211), plot(t,x), grid on xlabel('TIME'), ylabel('AMPLITUDE'), title('x(t)'); subplot(212), stem(abs(fftshift(fft(x)))), grid on xlabel('FREQUENCY'), ylabel('MAGNITUDE'), title('MAGNITUDE x(t)'); figure(6), subplot(211), plot(t,y), grid on xlabel('TIME'), ylabel('AMPLITUDE'), title('y(t)'); subplot(212), stem(abs(fftshift(fft(y)))), grid on xlabel('FREQUENCY'), ylabel('MAGNITUDE'), title('MAGNITUDE y(t)'); figure(7), subplot(211), plot(t,w), grid on xlabel('TIME'), ylabel('AMPLITUDE'), title('w(t)'); subplot(212), stem(abs(fftshift(fft(w)))), grid on xlabel('FREQUENCY'), ylabel('MAGNITUDE'), title('MAGNITUDE w(t)'); figure(8), subplot(211), plot(t,v), grid on xlabel('TIME'), ylabel('AMPLITUDE'), title('v(t)'); subplot(212), stem(abs(fftshift(fft(v)))), grid on xlabel('FREQUENCY'), ylabel('MAGNITUDE'), title('MAGNITUDE
SPECTRA OF
SPECTRA OF
SPECTRA OF
SPECTRA OF
3.
SYNTAX fc=20000;ts=1/(10*fc);t=(0:2000)*ts;A=4; x=cos(2*pi*2000*t); fom=cos(2*pi*fc*t); xnorm=x/max(abs(x)); y=A.*(1+.5.*xnorm).*fom;%0.5 modulation w=abs(y); [num,den]=butter(5,2*fc*ts); v=filter(num,den,w)-(A+1)/2; figure(13),subplot(311),plot(t,y),axis([0 .003 -5 5]) title('MODULATED SIGNAL (y(t))'),xlabel('time'),ylabel('AMPLITUDE') subplot(312),plot(t,w),axis([0 .003 -5 5]),title('w(t)') xlabel('TIME'),ylabel('AMPLITUDE') subplot(313),plot(t,v),axis([0 .003 -2 2]),title('DEMODULATED SIGNAL (v(t))') xlabel('TIME'),ylabel('AMPLITUDE')
4.
SYNTAX
fc=20000;ts=1/(10*fc);t=(0:2000)*ts;Ac=4;x=cos(2*pi*2000*t);xnorm=x/max(abs (x));fom=cos(2*pi*fc*t); y=Ac.*(1+1.2.*xnorm).*fom; w=abs(y); [num,den]=butter(5,2*fc*ts); v=filter(num,den,w)-(Ac+1)/2; figure(14),subplot(311),plot(t,x),axis([0 .003 -2 2]) title('Modulating Signal (x(t))'),xlabel('Time'),ylabel('Amplitude') subplot(312),plot(t,fom),axis([0 .003 -2 2]),title('Carrier Signal (fo)') xlabel('Time'),ylabel('Amplitude') subplot(313),plot(t,y),axis([0 .003 -10 10]),title('Modulated Signal (y(t))') xlabel('Time'),ylabel('Amplitude') figure(15),subplot(311),plot(t,y),axis([0 .003 -10 10]),title('Modulated Signal (y(t))') xlabel('Time'),ylabel('Amplitude') subplot(312),plot(t,w),axis([0 .003 -10 10]),title('w(t)') xlabel('Time'),ylabel('Amplitude') subplot(313),plot(t,v),axis([0 .003 -5 5]),title('Demoodulated Signal (v(t))') xlabel('Time'),ylabel('Amplitude')
5.
SYNTAX
load forexp3.mat t = 0:Fs+1'/Fs; Fc = 24000; % Carrier frequency Fs=2*(Fc+Fs); y1 = ammod(voice,Fc,Fs); % Compute spectra of both modulated signals. z1 = fft(y1); z1 = abs(z1(1:length(z1)/2+1)); frq1 = (0:length(z1)-1)*Fs/length(z1)/2; % Plot spectra of both modulated signals. figure; subplot(311);plot(y1); title('Amplitude Modulated Signal') subplot(312); plot(frq1,z1); title('Spectrum of 1-sideband signal'); %Demodulation [num,den] = butter(10,Fc*2/Fs); s1 = amdemod(y1,Fc,Fs,0,0,num,den); soundsc(s1) subplot(313);plot(s1); title('Demodulated Signal')
VI.
CONCLUSION Amplitude modulation is a modulation technique that varies the strength of the transmitted signal in
relation to the information being sent. Double‐sideband supressed carrier is a form of amplitude modulation in which both the upper and lower sidebands are transmitted but the power contained in the unmodulated carrier level is reduced to a fixed level, ideally being completely suppressed. MATLAB can simulate amplitude modulation by using pointwise multiplication of an information signal with the carrier signal of the same vector size. Thus, the output is similar to the information signal but has peak amplitudes equal to the sum of peak values of the signals.
VII.
QUESTIONS TO BE ANSWERED
1.
Enumerate and describe the types of Amplitude Modulation. Include its designation by ITU
(International Telecommunication Union)
Designation
Description
A3E
double‐sideband a full
R3E
single‐sideband reduced‐carrier
H3E
single‐sideband full‐carrier
J3E
single‐sideband suppressed‐carrier
B8E
independent‐sideband emission
C3F
vestigial‐sideband
2.
Enumerate and briefly explain the modulation method for AM.
a. Low‐level generation In modern radio systems, modulated signals are generated via digital signal processing (DSP). With DSP many types of AM modulation are possible with software control (including DSB with carrier, SSB suppressed‐carrier and independent sideband, or ISB).
b. High‐level generation High‐power AM transmitters (such as those used for AM broadcasting) are based on high‐efficiency
class‐D and class‐E power amplifier stages, modulated by varying the supply voltage.
View more...
Comments