-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample4_01.m
More file actions
46 lines (35 loc) · 787 Bytes
/
Example4_01.m
File metadata and controls
46 lines (35 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% File: Example4_01.m for Example 4-1
clear;
fc = 10;
fa = 1;
Ta = 1/fa;
dt = 4*Ta/200;
wc = 2*pi*fc;
wa = 2*pi*fa;
% Generate x and y quadrature modulating functions
t = 0:dt:4*Ta;
x = cos(wa*t);
x = x(:);
y = zeros(length(t),1);
y = PULSE(y,t,Ta,2*Ta);
% Generate the modulated signal by using the complex envelope
% as given by Eq. (4-1a)
j = sqrt(-1);
g = x + j*y;
carrier = exp(j*wc*t);
g = g(:);
carrier = carrier(:);
v = real(g.*carrier);
subplot(211);
plot(t,x,t,y,':');
xlabel('t in sec -->');
ylabel( 'x(t) (solid), y(t) (dotted)')
axis([0 4 -1.2 1.2])
title('x(t) and y(t) Modulating Waveforms');
subplot(212);
plot(t,v,t,abs(g),':');
%plot(t,v);
xlabel('t in sec -->');
ylabel('v(t) solid, |g(t)| dotted');
title('QM Signal and its Complex Envelope Magnitude');