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
|
clc;
clear all;
//page no 158
//prob no. 5.7
fLO=40; //MHz
//function for ascending pulse
function V=pulse_a()
V=[]
for i=1:.005:2
V=[V i]
end
endfunction
//function for descending pulse
function V=pulse_d()
V=[]
for i=2:-.005:1
V=[V i]
end
endfunction
//for V2(f)
f=[0:.01:48+.01]; //x axis
V2=[zeros(0:.01:-8+fLO-.01) pulse_d() zeros(-6+fLO+.01:.01:6+fLO-.01) pulse_a() 0]; //y axis
clf;
subplot(211);
plot2d(f,V2,[5],rect=[0,0,50,2])
xtitle('Spectral diagram','f,MHz','V2(f)');
//for V3(f)
f=[0:.01:48+.01]; //x axis
V3=[zeros(0:.01:6+fLO-.01) pulse_a() 0]; //y axis
subplot(212);
plot2d(f,V3,[5],rect=[0,0,50,2])
xtitle('Spectral Diagram','f,MHz','V3(f)');
|