-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathGenSignal.m
115 lines (101 loc) · 24 KB
/
GenSignal.m
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
function [ waveformArray, waveformSignal, steeringVector] = GenSignal(sysPara, hArray)
% /*!
% * @brief This function generate the target signal.
% * @details .
% * @param[out] waveformArray, NxM complex doulbe. array response, i.e. signal waveform response at each antenna. N is the number of samples(snaps). M is the number of channel
% * @param[out] waveformSignal, Nx1 complex doulbe. signal waveform. N is the number of samples(snaps).
% * @param[out] steeringVector, Mx1 complex doulbe. steeringVector of the array according to the input signal.M is the number of channel
% * @param[in] sysPara, 1x1 struct, which contains the following field:
% see get used field for detail.
% * @param[in] hArray, 1x1 antenna array system object.
% * @pre .
% * @bug Null
% * @warning Null
% * @author Collus Wang
% * @version 1.0
% * @date 2017.05.25.
% * @copyright Collus Wang all rights reserved.
% * @remark { revision history: V1.0, 2017.05.25. Collus Wang, first draft }
% * @remark { revision history: V1.1, 2017.06.22. Collus Wang, support 16QAM and 64QAM }
% * @remark { revision history: V1.2, 2017.07.12. Collus Wang, steering vector calculation can include element response.}
% * @remark { revision history: V1.3, 2017.10.18. Collus Wang and Wayne Zhang, add CustomPilot TargetSigType case.}
% * @remark { revision history: V1.4, 2017.10.20. Wayne Zhang, fix bug in 'custompilot' case: first target should not cirshift.}
% * @remark { revision history: V1.5, 2017.11.03. Wayne Zhang, fix bug in 'custompilot' case: 1. pilot should be RC filtered not RRC filtered. 2. cirshift function usage compatible with R2016a}
% */
%% get used field
TargetSigType = sysPara.TargetSigType; % valid value = {'QPSK', '16QAM', '64QAM', 'CustomPilot'}
NumTarget = sysPara.NumTarget; %
TargetAngle = sysPara.TargetAngle; % incoming wave direction in degree, [azimuth; elevation]. The azimuth angle must be between ¨C180 and 180 degrees, and the elevation angle must be between ¨C90 and 90 degrees.
FreqCenter = sysPara.FreqCenter;
Duration = sysPara.Duration;
SymbolRate = sysPara.SymbolRate;
NumElements = getNumElements(hArray);
LenWaveform = sysPara.LenWaveform;
TargetPower = sysPara.TargetPower;
StvIncludeElementResponse = sysPara.StvIncludeElementResponse;
%% Flags
GlobalDebugPlot = sysPara.GlobalDebugPlot;
FlagDebugPlot = true && GlobalDebugPlot;
figureStartNum = 3000;
%% Gen. signal
waveformSignal = zeros(LenWaveform, NumTarget);
switch lower(TargetSigType)
case 'qpsk'
BitPerSym = 2;
numBit = round(Duration*SymbolRate*BitPerSym*NumTarget);
txBits = randi([0, 1], numBit,1);
% bits map to constellations
symbols = SymbolMap(txBits, 'QPSK');
waveformSignal = reshape(symbols, [],NumTarget);
case '16qam'
BitPerSym = 4;
numBit = round(Duration*SymbolRate*BitPerSym*NumTarget);
txBits = randi([0, 1], numBit,1);
% bits map to constellations
symbols = SymbolMap(txBits, '16QAM');
waveformSignal = reshape(symbols, [],NumTarget);
case '64qam'
BitPerSym = 6;
numBit = round(Duration*SymbolRate*BitPerSym*NumTarget);
txBits = randi([0, 1], numBit,1);
% bits map to constellations
symbols = SymbolMap(txBits, '64QAM');
waveformSignal = reshape(symbols, [],NumTarget);
case 'custompilot'
% The pilot waveform below is inherited from CSMA RS (RC filtered) with oversampling of 2. Waveform begins at CP/2.
pilotSignal = [24769.5252109022 + 24769.5252109022i,28486.1974405209 + 5371.10299855758i,24769.5252109022 - 24769.5252109022i,8.49741660046189 - 29807.8583973955i,-24769.5252109022 - 24769.5252109022i,-28449.2649458591 - 28968.3246728757i,-24769.5252109022 - 24769.5252109022i,-28980.8868710102 + 335.605039472830i,-24769.5252109022 + 24769.5252109022i,-796.556170140802 + 29706.0488013873i,24769.5252109022 + 24769.5252109022i,35501.0355563226 + 23498.6614511803i,24769.5252109022 + 24769.5252109022i,-5873.62770928885 + 23975.8165299544i,-24769.5252109022 + 24769.5252109022i,-4968.51796171097 + 30601.8273310245i,24769.5252109022 + 24769.5252109022i,30579.5783232012 - 5866.06831919623i,24769.5252109022 - 24769.5252109022i,23216.9040379714 + 980.826266348245i,24769.5252109022 + 24769.5252109022i,30287.0857177359 + 1165.80754605183i,24769.5252109022 - 24769.5252109022i,-5845.78119687954 - 6002.93435685044i,-24769.5252109022 + 24769.5252109022i,-47.0729903739931 + 29348.8875449107i,24769.5252109022 + 24769.5252109022i,6071.98659579057 + 29306.2594513876i,-24769.5252109022 + 24769.5252109022i,-29647.1983670815 + 561.706213216318i,-24769.5252109022 - 24769.5252109022i,-29082.3653988391 - 35685.3056525300i,-24769.5252109022 - 24769.5252109022i,310.088266102609 + 6239.97917318543i,24769.5252109022 + 24769.5252109022i,29813.2106662932 + 5762.50528801656i,24769.5252109022 - 24769.5252109022i,23517.0909131579 - 36691.8939279368i,24769.5252109022 - 24769.5252109022i,23583.2555018680 + 6813.91038546476i,24769.5252109022 + 24769.5252109022i,30159.5325053458 + 324.765622048863i,24769.5252109022 - 24769.5252109022i,702.410189392815 - 6148.64114106877i,-24769.5252109022 + 24769.5252109022i,-35608.6511072518 + 30510.2685867883i,-24769.5252109022 + 24769.5252109022i,6936.20329234025 + 24296.7442134809i,24769.5252109022 + 24769.5252109022i,172.057358928854 + 24380.3695831998i,-24769.5252109022 + 24769.5252109022i,-6121.62842999977 + 23712.5314949686i,24769.5252109022 + 24769.5252109022i,30522.6039419111 + 29935.1847667739i,24769.5252109022 + 24769.5252109022i,24208.0853812592 + 934.691302482095i,24769.5252109022 - 24769.5252109022i,24636.6408774995 - 34751.2213083765i,24769.5252109022 - 24769.5252109022i,24498.8368133374 + 1077.75567215872i,24769.5252109022 + 24769.5252109022i,24002.3755550000 + 29970.9217374550i,24769.5252109022 + 24769.5252109022i,30856.5720331643 + 23314.3913549729i,24769.5252109022 + 24769.5252109022i,-5110.99376573561 + 23855.5958646452i,-24769.5252109022 + 24769.5252109022i,-5941.51507870943 + 31036.8999656819i,24769.5252109022 + 24769.5252109022i,35662.2412360430 - 5267.53996737791i,24769.5252109022 - 24769.5252109022i,-854.192687789397 - 5860.80801368166i,-24769.5252109022 + 24769.5252109022i,-29966.9734428730 + 36804.8740095482i,-24769.5252109022 + 24769.5252109022i,-23672.3496274365 - 5915.21355113657i,-24769.5252109022 - 24769.5252109022i,-24742.1841868623 - 6229.95516442515i,-24769.5252109022 + 24769.5252109022i,-24862.4968155546 + 35790.9593179526i,-24769.5252109022 + 24769.5252109022i,-23790.8352502508 - 753.321118289096i,-24769.5252109022 - 24769.5252109022i,-29572.9900477944 - 30017.0567013212i,-24769.5252109022 - 24769.5252109022i,-219.130349302849 - 23754.6016773007i,24769.5252109022 - 24769.5252109022i,28971.4698205785 - 24677.6381536952i,24769.5252109022 - 24769.5252109022i,29511.5094607313 - 24678.2267193472i,24769.5252109022 - 24769.5252109022i,-5854.98979697615 - 24000.0335541765i,-24769.5252109022 - 24769.5252109022i,868.765818568113 - 30654.8105014871i,24769.5252109022 - 24769.5252109022i,283.995188864826 + 5033.73226212880i,-24769.5252109022 + 24769.5252109022i,-28.4350780612890 + 4942.77434532904i,24769.5252109022 - 24769.5252109022i,-210.032105265990 - 30875.0934585251i,-24769.5252109022 - 24769.5252109022i,-730.134083957962 - 23837.1847953442i,24769.5252109022 - 24769.5252109022i,5516.46645281225 - 23489.9555842448i,-24769.5252109022 - 24769.5252109022i,-30333.3249067696 - 29687.7419572539i,-24769.5252109022 - 24769.5252109022i,-22839.8173818184 - 168.219420406567i,-24769.5252109022 + 24769.5252109022i,-29674.4685756233 + 28748.2869515261i,-24769.5252109022 + 24769.5252109022i,-1261.43720271418 + 28683.6183005148i,24769.5252109022 + 24769.5252109022i,34817.9622009542 + 87.1322400618913i,24769.5252109022 - 24769.5252109022i,110.307012608607 - 28855.0870937916i,-24769.5252109022 - 24769.5252109022i,-35018.0745226274 - 29479.1322189802i,-24769.5252109022 - 24769.5252109022i,411.897862110755 + 5836.46837161540i,24769.5252109022 + 24769.5252109022i,35511.8749737465 - 891.020957283612i,24769.5252109022 - 24769.5252109022i,-7035.92838499763 - 307.169961411541i,-24769.5252109022 + 24769.5252109022i,904.275946237580 + 105.635272746014i,24769.5252109022 - 24769.5252109022i,1361.49336355080 + 397.220506164501i,-24769.5252109022 + 24769.5252109022i,-6075.49346613362 + 480.042729004076i,24769.5252109022 - 24769.5252109022i,29435.7929419609 - 6503.80985757773i,24769.5252109022 + 24769.5252109022i,30003.9059375347 + 36179.1061036491i,24769.5252109022 + 24769.5252109022i,-4959.43197945852 - 6412.85194077797i,-24769.5252109022 - 24769.5252109022i,-5016.17951773694 + 635.669296815155i,24769.5252109022 + 24769.5252109022i,29646.7446810581 + 115.567318123181i,24769.5252109022 - 24769.5252109022i,28987.9006116963 - 854.799646118003i,24769.5252109022 + 24769.5252109022i,637.753800165916 + 5580.19707731572i,-24769.5252109022 - 24769.5252109022i,-34542.6728790249 - 30226.1507800793i,-24769.5252109022 - 24769.5252109022i,1196.76855170287 - 23362.6108221898i,24769.5252109022 - 24769.5252109022i,29719.1995651738 - 30320.1741429831i,24769.5252109022 - 24769.5252109022i,22669.0597720377 + 6057.67096248459i,24769.5252109022 + 24769.5252109022i,29528.5165557166 - 205.360365403398i,24769.5252109022 - 24769.5252109022i,82.4605001992971 - 7106.40299093004i,-24769.5252109022 + 24769.5252109022i,-29436.1240101402 + 35695.2254361228i,-24769.5252109022 + 24769.5252109022i,-23024.4675933428 + 434.361451161328i,-24769.5252109022 - 24769.5252109022i,-30578.1559562089 - 35026.5719392279i,-24769.5252109022 - 24769.5252109022i,4868.79286905358 + 50.9109288962802i,24769.5252109022 + 24769.5252109022i,4913.52385860407 + 34688.6371607160i,-24769.5252109022 + 24769.5252109022i,-30768.8512274504 - 974.523709158290i,-24769.5252109022 - 24769.5252109022i,-23718.3803661351 - 28746.2024481753i,-24769.5252109022 - 24769.5252109022i,-23772.5284061173 - 28710.2999434045i,-24769.5252109022 - 24769.5252109022i,-30541.0150112121 - 908.947686100173i,-24769.5252109022 + 24769.5252109022i,5699.82917697289 + 34661.7470674911i,24769.5252109022 + 24769.5252109022i,-1048.73202844545 - 296.330543987573i,-24769.5252109022 - 24769.5252109022i,-722.347850853642 - 35400.9793954859i,24769.5252109022 - 24769.5252109022i,6595.59544482559 + 6951.94129263851i,-24769.5252109022 + 24769.5252109022i,-36139.9419642236 - 1036.72774150194i,-24769.5252109022 - 24769.5252109022i,6329.07329875392 - 1102.30376456006i,24769.5252109022 + 24769.5252109022i,-576.383569162571 + 6851.05133046158i,-24769.5252109022 - 24769.5252109022i,102.398161660125 - 35181.8490461831i,24769.5252109022 - 24769.5252109022i,584.182064051311 + 432.381172978103i,-24769.5252109022 + 24769.5252109022i,-6732.26529392914 + 29056.6217824572i,24769.5252109022 + 24769.5252109022i,35795.2815969594 + 29707.5570008705i,24769.5252109022 + 24769.5252109022i,45.6506233817076 - 5061.00247067055i,-24769.5252109022 - 24769.5252109022i,-36114.1983478417 - 5060.09509862375i,-24769.5252109022 + 24769.5252109022i,6201.52008636386 + 30090.1001510888i,24769.5252109022 + 24769.5252109022i,6312.41566462445 + 29706.9684352186i,-24769.5252109022 + 24769.5252109022i,-35958.5717800306 - 6339.32415052591i,-24769.5252109022 - 24769.5252109022i,-255.940226120437 + 40.0592496878966i,24769.5252109022 + 24769.5252109022i,34945.7422563559 + 6367.75922858720i,24769.5252109022 - 24769.5252109022i,-767.078840404131 - 29834.7484906203i,-24769.5252109022 - 24769.5252109022i,-29189.7541067566 - 30246.6463527311i,-24769.5252109022 - 24769.5252109022i,-29691.4756706086 + 5435.75938778448i,-24769.5252109022 + 24769.5252109022i,5453.45927358933 + 6010.00940645862i,24769.5252109022 - 24769.5252109022i,5618.27604882039 - 36006.2333360566i,-24769.5252109022 - 24769.5252109022i,-36753.9630806519 + 14.6773559462537i,-24769.5252109022 + 24769.5252109022i,5819.81073748592 + 35940.6573129985i,24769.5252109022 + 24769.5252109022i,5490.72283643033 - 6074.67805746993i,-24769.5252109022 - 24769.5252109022i,-30205.7716943795 - 5050.16305324658i,-24769.5252109022 + 24769.5252109022i,-29728.6166156055 + 30794.5948438324i,-24769.5252109022 + 24769.5252109022i,6386.50136606744 + 23052.1914879079i,24769.5252109022 + 24769.5252109022i,-395.013384969575 + 29349.2186130900i,-24769.5252109022 + 24769.5252109022i,-6823.22321072890 - 50.8986671118641i,24769.5252109022 - 24769.5252109022i,36618.8504781692 - 29450.1085752669i,24769.5252109022 - 24769.5252109022i,-5892.14300375739 - 22770.5382998666i,-24769.5252109022 - 24769.5252109022i,-5882.72595332571 - 29862.5950030296i,24769.5252109022 - 24769.5252109022i,36608.0110607452 - 789.542429454707i,24769.5252109022 + 24769.5252109022i,-6878.79361770335 + 35456.8808706396i,-24769.5252109022 + 24769.5252109022i,-221.202590869195 - 7041.74660170314i,24769.5252109022 - 24769.5252109022i,7034.17494982611 + 151.788629288791i,-24769.5252109022 + 24769.5252109022i,-35301.2543028285 + 6962.78071006248i,-24769.5252109022 - 24769.5252109022i,593.268046303753 - 36543.3424097339i,24769.5252109022 - 24769.5252109022i,28926.8614488722 + 5478.71854948681i,24769.5252109022 + 24769.5252109022i,28486.1974405209 + 5371.10299855758i,24769.5252109022 - 24769.5252109022i,8.49741660046189 - 29807.8583973955i,-24769.5252109022 - 24769.5252109022i,-28449.2649458591 - 28968.3246728757i,-24769.5252109022 - 24769.5252109022i,-28980.8868710102 + 335.605039472830i,-24769.5252109022 + 24769.5252109022i,-796.556170140802 + 29706.0488013873i,24769.5252109022 + 24769.5252109022i,35501.0355563226 + 23498.6614511803i,24769.5252109022 + 24769.5252109022i,-5873.62770928885 + 23975.8165299544i,-24769.5252109022 + 24769.5252109022i,-4968.51796171097 + 30601.8273310245i,24769.5252109022 + 24769.5252109022i,30579.5783232012 - 5866.06831919623i,24769.5252109022 - 24769.5252109022i,23216.9040379714 + 980.826266348245i,24769.5252109022 + 24769.5252109022i,30287.0857177359 + 1165.80754605183i,24769.5252109022 - 24769.5252109022i,-5845.78119687954 - 6002.93435685044i,-24769.5252109022 + 24769.5252109022i,-47.0729903739931 + 29348.8875449107i,24769.5252109022 + 24769.5252109022i,6071.98659579057 + 29306.2594513876i,-24769.5252109022 + 24769.5252109022i,-29647.1983670815 + 561.706213216318i,-24769.5252109022 - 24769.5252109022i,-29082.3653988391 - 35685.3056525300i,-24769.5252109022 - 24769.5252109022i,310.088266102609 + 6239.97917318543i,24769.5252109022 + 24769.5252109022i,29813.2106662932 + 5762.50528801656i,24769.5252109022 - 24769.5252109022i,23517.0909131579 - 36691.8939279368i,24769.5252109022 - 24769.5252109022i,23583.2555018680 + 6813.91038546476i,24769.5252109022 + 24769.5252109022i,30159.5325053458 + 324.765622048863i,24769.5252109022 - 24769.5252109022i,702.410189392815 - 6148.64114106877i,-24769.5252109022 + 24769.5252109022i,-35608.6511072518 + 30510.2685867883i,-24769.5252109022 + 24769.5252109022i,6936.20329234025 + 24296.7442134809i,24769.5252109022 + 24769.5252109022i,172.057358928854 + 24380.3695831998i,-24769.5252109022 + 24769.5252109022i,-6121.62842999977 + 23712.5314949686i,24769.5252109022 + 24769.5252109022i,30522.6039419111 + 29935.1847667739i,24769.5252109022 + 24769.5252109022i,24208.0853812592 + 934.691302482095i,24769.5252109022 - 24769.5252109022i,24636.6408774995 - 34751.2213083765i,24769.5252109022 - 24769.5252109022i,24498.8368133374 + 1077.75567215872i,24769.5252109022 + 24769.5252109022i,24002.3755550000 + 29970.9217374550i,24769.5252109022 + 24769.5252109022i,30856.5720331643 + 23314.3913549729i,24769.5252109022 + 24769.5252109022i,-5110.99376573561 + 23855.5958646452i,-24769.5252109022 + 24769.5252109022i,-5941.51507870943 + 31036.8999656819i,24769.5252109022 + 24769.5252109022i,35662.2412360430 - 5267.53996737791i,24769.5252109022 - 24769.5252109022i,-854.192687789397 - 5860.80801368166i,-24769.5252109022 + 24769.5252109022i,-29966.9734428730 + 36804.8740095482i,-24769.5252109022 + 24769.5252109022i,-23672.3496274365 - 5915.21355113657i,-24769.5252109022 - 24769.5252109022i,-24742.1841868623 - 6229.95516442515i,-24769.5252109022 + 24769.5252109022i,-24862.4968155546 + 35790.9593179526i,-24769.5252109022 + 24769.5252109022i,-23790.8352502508 - 753.321118289096i,-24769.5252109022 - 24769.5252109022i,-29572.9900477944 - 30017.0567013212i,-24769.5252109022 - 24769.5252109022i,-219.130349302849 - 23754.6016773007i,24769.5252109022 - 24769.5252109022i,28971.4698205785 - 24677.6381536952i,24769.5252109022 - 24769.5252109022i,29511.5094607313 - 24678.2267193472i,24769.5252109022 - 24769.5252109022i,-5854.98979697615 - 24000.0335541765i,-24769.5252109022 - 24769.5252109022i,868.765818568113 - 30654.8105014871i,24769.5252109022 - 24769.5252109022i,283.995188864826 + 5033.73226212880i,-24769.5252109022 + 24769.5252109022i,-28.4350780612890 + 4942.77434532904i,24769.5252109022 - 24769.5252109022i,-210.032105265990 - 30875.0934585251i,-24769.5252109022 - 24769.5252109022i,-730.134083957962 - 23837.1847953442i,24769.5252109022 - 24769.5252109022i,5516.46645281225 - 23489.9555842448i,-24769.5252109022 - 24769.5252109022i,-30333.3249067696 - 29687.7419572539i,-24769.5252109022 - 24769.5252109022i,-22839.8173818184 - 168.219420406567i,-24769.5252109022 + 24769.5252109022i,-29674.4685756233 + 28748.2869515261i,-24769.5252109022 + 24769.5252109022i,-1261.43720271418 + 28683.6183005148i,24769.5252109022 + 24769.5252109022i,34817.9622009542 + 87.1322400618913i,24769.5252109022 - 24769.5252109022i,110.307012608607 - 28855.0870937916i,-24769.5252109022 - 24769.5252109022i,-35018.0745226274 - 29479.1322189802i,-24769.5252109022 - 24769.5252109022i,411.897862110755 + 5836.46837161540i,24769.5252109022 + 24769.5252109022i,35511.8749737465 - 891.020957283612i,24769.5252109022 - 24769.5252109022i,-7035.92838499763 - 307.169961411541i,-24769.5252109022 + 24769.5252109022i,904.275946237580 + 105.635272746014i,24769.5252109022 - 24769.5252109022i,1361.49336355080 + 397.220506164501i,-24769.5252109022 + 24769.5252109022i,-6075.49346613362 + 480.042729004076i,24769.5252109022 - 24769.5252109022i,29435.7929419609 - 6503.80985757773i,24769.5252109022 + 24769.5252109022i,30003.9059375347 + 36179.1061036491i,24769.5252109022 + 24769.5252109022i,-4959.43197945852 - 6412.85194077797i,-24769.5252109022 - 24769.5252109022i,-5016.17951773694 + 635.669296815155i,24769.5252109022 + 24769.5252109022i,29646.7446810581 + 115.567318123181i,24769.5252109022 - 24769.5252109022i,28987.9006116963 - 854.799646118003i,24769.5252109022 + 24769.5252109022i,637.753800165916 + 5580.19707731572i,-24769.5252109022 - 24769.5252109022i,-34542.6728790249 - 30226.1507800793i,-24769.5252109022 - 24769.5252109022i,1196.76855170287 - 23362.6108221898i,24769.5252109022 - 24769.5252109022i,29719.1995651738 - 30320.1741429831i,24769.5252109022 - 24769.5252109022i,22669.0597720377 + 6057.67096248459i,24769.5252109022 + 24769.5252109022i,29528.5165557166 - 205.360365403398i,24769.5252109022 - 24769.5252109022i,82.4605001992971 - 7106.40299093004i,-24769.5252109022 + 24769.5252109022i,-29436.1240101402 + 35695.2254361228i,-24769.5252109022 + 24769.5252109022i,-23024.4675933428 + 434.361451161328i,-24769.5252109022 - 24769.5252109022i,-30578.1559562089 - 35026.5719392279i,-24769.5252109022 - 24769.5252109022i,4868.79286905358 + 50.9109288962802i,24769.5252109022 + 24769.5252109022i,4913.52385860407 + 34688.6371607160i,-24769.5252109022 + 24769.5252109022i,-30768.8512274504 - 974.523709158290i,-24769.5252109022 - 24769.5252109022i,-23718.3803661351 - 28746.2024481753i,-24769.5252109022 - 24769.5252109022i,-23772.5284061173 - 28710.2999434045i,-24769.5252109022 - 24769.5252109022i,-30541.0150112121 - 908.947686100173i,-24769.5252109022 + 24769.5252109022i,5699.82917697289 + 34661.7470674911i,24769.5252109022 + 24769.5252109022i,-1048.73202844545 - 296.330543987573i,-24769.5252109022 - 24769.5252109022i,-722.347850853642 - 35400.9793954859i,24769.5252109022 - 24769.5252109022i,6595.59544482559 + 6951.94129263851i,-24769.5252109022 + 24769.5252109022i,-36139.9419642236 - 1036.72774150194i,-24769.5252109022 - 24769.5252109022i,6329.07329875392 - 1102.30376456006i,24769.5252109022 + 24769.5252109022i,-576.383569162571 + 6851.05133046158i,-24769.5252109022 - 24769.5252109022i,102.398161660125 - 35181.8490461831i,24769.5252109022 - 24769.5252109022i,584.182064051311 + 432.381172978103i,-24769.5252109022 + 24769.5252109022i,-6732.26529392914 + 29056.6217824572i,24769.5252109022 + 24769.5252109022i,35795.2815969594 + 29707.5570008705i,24769.5252109022 + 24769.5252109022i,45.6506233817076 - 5061.00247067055i,-24769.5252109022 - 24769.5252109022i,-36114.1983478417 - 5060.09509862375i,-24769.5252109022 + 24769.5252109022i,6201.52008636386 + 30090.1001510888i,24769.5252109022 + 24769.5252109022i,6312.41566462445 + 29706.9684352186i,-24769.5252109022 + 24769.5252109022i,-35958.5717800306 - 6339.32415052591i,-24769.5252109022 - 24769.5252109022i,-255.940226120437 + 40.0592496878966i,24769.5252109022 + 24769.5252109022i,34945.7422563559 + 6367.75922858720i,24769.5252109022 - 24769.5252109022i,-767.078840404131 - 29834.7484906203i,-24769.5252109022 - 24769.5252109022i,-29189.7541067566 - 30246.6463527311i,-24769.5252109022 - 24769.5252109022i,-29691.4756706086 + 5435.75938778448i,-24769.5252109022 + 24769.5252109022i,5453.45927358933 + 6010.00940645862i,24769.5252109022 - 24769.5252109022i,5618.27604882039 - 36006.2333360566i,-24769.5252109022 - 24769.5252109022i,-36753.9630806519 + 14.6773559462537i,-24769.5252109022 + 24769.5252109022i,5819.81073748592 + 35940.6573129985i,24769.5252109022 + 24769.5252109022i,5490.72283643033 - 6074.67805746993i,-24769.5252109022 - 24769.5252109022i,-30205.7716943795 - 5050.16305324658i,-24769.5252109022 + 24769.5252109022i,-29728.6166156055 + 30794.5948438324i,-24769.5252109022 + 24769.5252109022i,6386.50136606744 + 23052.1914879079i,24769.5252109022 + 24769.5252109022i,-395.013384969575 + 29349.2186130900i,-24769.5252109022 + 24769.5252109022i,-6823.22321072890 - 50.8986671118641i,24769.5252109022 - 24769.5252109022i,36618.8504781692 - 29450.1085752669i,24769.5252109022 - 24769.5252109022i,-5892.14300375739 - 22770.5382998666i,-24769.5252109022 - 24769.5252109022i,-5882.72595332571 - 29862.5950030296i,24769.5252109022 - 24769.5252109022i,36608.0110607452 - 789.542429454707i,24769.5252109022 + 24769.5252109022i,-6878.79361770335 + 35456.8808706396i,-24769.5252109022 + 24769.5252109022i,-221.202590869195 - 7041.74660170314i,24769.5252109022 - 24769.5252109022i,7034.17494982611 + 151.788629288791i,-24769.5252109022 + 24769.5252109022i,-35301.2543028285 + 6962.78071006248i,-24769.5252109022 - 24769.5252109022i,593.268046303753 - 36543.3424097339i,24769.5252109022 - 24769.5252109022i,28926.8614488722 + 5478.71854948681i];
lenPilot = length(pilotSignal); % for mulitple-target case, cyclic shift the RS.
lenPilotCircShift = lenPilot/8;
waveformSignal = zeros(lenPilot, NumTarget);
for idx = 1:NumTarget
waveformSignal(:,idx) = circshift(pilotSignal, [lenPilotCircShift*(idx-1),0]);
end
otherwise
error('Unsupported signal type.')
end
amp = db2mag(TargetPower);
waveformSignal = waveformSignal*diag(amp);
if FlagDebugPlot
figure(figureStartNum+0);clf;
plot(waveformSignal,'o-');axis equal;
title('waveformTx');
fprintf('waveformTx RMS = %2.2f\n', rms(waveformSignal));
end
% waveformArray = collectPlaneWave( hArray, waveformSignal, TargetAngle, FreqCenter); % collectPlaneWave donot count for element response. use SteeringVector in future.
hSteeringVector = phased.SteeringVector('SensorArray', hArray,...
'PropagationSpeed', physconst('LightSpeed'),...
'IncludeElementResponse', StvIncludeElementResponse,...
'NumPhaseShifterBits', 0 ... 'EnablePolarization', false ...
);
steeringVector = step(hSteeringVector, FreqCenter, TargetAngle);
steeringVector = steeringVector*diag(rms(steeringVector).^-1); % in case of IncludeElementResponse=true. Normalize to 1, but keep element response
waveformArray = waveformSignal*steeringVector.';
if FlagDebugPlot
figure(figureStartNum+100);clf;
plot(waveformArray(:,1),'o-');axis equal;
title('waveformSig on the first sensor');
fprintf('Signal waveform RMS on each anntenna:\n')
for idxAntenna = 1:NumElements
fprintf('\tChannel %d = %2.2f = %2.2fdB\n', idxAntenna, rms(waveformArray(:,idxAntenna)), mag2db(rms(waveformArray(:,idxAntenna))) );
end
end