source: EducationApps/PHY/SIMPLE_STREAMING/simple_streaming_init.m

Last change on this file was 1045, checked in by chunter, 16 years ago

Significantly changed VIQ calculation and moved it further up in the processing chain

File size: 2.7 KB
Line 
1%VIQ AVERAGER
2viqAvgLen = 128;
3
4
5
6
7NUM = 35;
8viqFilt = fir1(NUM,.1);
9
10upconv_freq = 0.25;
11downconv_freq = 0.25+1e-6; %Offset to simulator actual CFO
12
13%LSFR parameters
14txLSFR_numBits = 16;
15txLSFR_polynomials = {'3921' '8435' '4A0B' '4F1D' '2835' '9A0B'};
16txLSFR_initValues = {'3F' '1B' '03' '35' '17' '0A'};
17
18modConstellation_prec = 8;
19modConstellation_bp = 7;
20
21%QPSK constellation
22%2 bits per symbol, 1 bit per I/Q
23% I = MSB, Q = LSB
24modConstellation_qpsk = [1 -1]; %[1 -1]
25%modConstellation_qpsk = (1-2^-modConstellation_bp).*modConstellation_qpsk./(max(abs(modConstellation_qpsk)));
26
27%16-QAM constellation
28%4 bits per symbol, 2 bits per I/Q
29% I = 2MSB, Q = 2LSB
30modConstellation_qam16 = [1 3 -1 -3];
31modConstellation_qam16 = (1-2^-modConstellation_bp).*modConstellation_qam16./(max(abs(modConstellation_qam16)));
32
33%64-QAM constellation
34%6 bits per symbol, 3 bits per I/Q
35% I = 3MSB, Q = 3LSB
36modConstellation_qam64 = [3 1 5 7 -3 -1 -5 -7];
37modConstellation_qam64 = (1-2^-modConstellation_bp).*modConstellation_qam64./(max(abs(modConstellation_qam64)));
38
39bndwdth = 1/5500;
40theta_0= 2*pi*bndwdth;
41eta=sqrt(2)/2;
42
43k_i= (4*theta_0*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
44k_p= (4*eta*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
45
46carrierRec_filt_K = .5 %01
47carrierRec_filt_KP = k_p%g*(4*eta*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
48carrierRec_filt_KI = k_i%g*(4*theta_0*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
49
50
51bndwdth = 1/1000;
52theta_0= 2*pi*bndwdth;
53eta=sqrt(2)/2;
54
55k_i= (4*theta_0*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
56k_p= (4*eta*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
57
58timingRec_filt_KP = k_p %g*(4*eta*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
59timingRec_filt_KI = k_i %g*(4*theta_0*theta_0)/(1+2*eta*theta_0+theta_0*theta_0);
60timingRec_filt_K = 1
61
62mf = rcosfir(.3, 4, 8, 1,'sqrt');
63dmf = conv(mf,[-1 0 1]);
64dmf = dmf(2:end-1);
65
66symbolRomLen = 2^13;
67symbolRom = floor(rand(1,2^13) * 4);
68
69%%%%Register Init%%%%
70%Transmitter Setup
71dac1Sel = 2;
72dac2Sel = 2;
73dac3Sel = 0;
74txModSel = 1;
75temp = fi(upconv_freq,0,32,32);
76upConv = str2num(temp.dec);
77
78%Receiver Setup
79initialDelay = 0;
80cfoReset = 0;
81cfoEnable = 1;
82cost = 1;
83benefit = 1;
84temp = fi(carrierRec_filt_K,0,32,25);
85cfoK = str2num(temp.dec);
86temp = fi(carrierRec_filt_KP,0,32,32);
87cfoKP = str2num(temp.dec);
88temp = fi(carrierRec_filt_KI,0,32,32);
89cfoKI = str2num(temp.dec);
90timingReset = 0;
91temp = fi(timingRec_filt_K,0,32,29);
92timingK = str2num(temp.dec);
93temp = fi(timingRec_filt_KP,0,32,32);
94timingKP = str2num(temp.dec);
95temp = fi(timingRec_filt_KI,0,32,32);
96timingKI = str2num(temp.dec);
97rxInputSel = 2;
98temp = fi(downconv_freq,0,32,32);
99downConv = str2num(temp.dec);
100%%%%%%%%%%%%%%%%%%%%%
101
Note: See TracBrowser for help on using the repository browser.