Front Haul Interface Library first seed code contribution
[o-du/phy.git] / fhi_lib / app / gen_test.m
1 %/******************************************************************************
2 %*
3 %*   Copyright (c) 2019 Intel.
4 %*
5 %*   Licensed under the Apache License, Version 2.0 (the "License");
6 %*   you may not use this file except in compliance with the License.
7 %*   You may obtain a copy of the License at
8 %*
9 %*       http://www.apache.org/licenses/LICENSE-2.0
10 %*
11 %*   Unless required by applicable law or agreed to in writing, software
12 %*   distributed under the License is distributed on an "AS IS" BASIS,
13 %*   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 %*   See the License for the specific language governing permissions and
15 %*   limitations under the License.
16 %*
17 %*******************************************************************************/
18
19 %Matlab: read bin
20 %fileID_c = fopen('ant_7.bin','r');
21 %ant7_c= fread(fileID_c, [2, 792*14*80], 'integer*2');
22 %ant7_c;
23 %ant7_c=ant7_c.';
24
25 close all;
26 clear all;
27
28 ifft_in = load('ifft_in.txt')
29 ant_c = ifft_in;
30 for (i=1:1:80*14-1)
31     ant_c = [ant_c; ifft_in];
32 end
33
34 ant0=ant_c;
35 ant1=ant_c*10;
36 ant2=ant_c*20;
37 ant3=ant_c*30;
38 ant4=ant_c*40;
39 ant5=ant_c*50;
40 ant6=ant_c*60;
41 ant7=ant_c*70;
42 ant8=ant_c*80;
43 ant9=ant_c*90;
44 ant10=ant_c*100;
45 ant11=ant_c*110;
46 ant12=ant_c*120;
47 ant13=ant_c*130;
48 ant14=ant_c*140;
49 ant15=ant_c*150;
50
51
52 ant0_16=int16(ant0.');
53 fileID = fopen('ant_0.bin','w');
54 fwrite(fileID,ant0_16, 'int16');
55 fclose(fileID);
56
57 ant1_16=int16(ant1.');
58 fileID = fopen('ant_1.bin','w');
59 fwrite(fileID,ant1_16, 'int16');
60 fclose(fileID);
61
62 ant2_16=int16(ant2.');
63 fileID = fopen('ant_2.bin','w');
64 fwrite(fileID,ant2_16, 'int16');
65 fclose(fileID);
66
67 ant3_16=int16(ant3.');
68 fileID = fopen('ant_3.bin','w');
69 fwrite(fileID,ant3_16, 'int16');
70 fclose(fileID);
71
72 ant4_16=int16(ant4.');
73 fileID = fopen('ant_4.bin','w');
74 fwrite(fileID,ant4_16, 'int16');
75 fclose(fileID);
76
77 ant5_16=int16(ant5.');
78 fileID = fopen('ant_5.bin','w');
79 fwrite(fileID,ant5_16, 'int16');
80 fclose(fileID);
81
82 ant6_16=int16(ant6.');
83 fileID = fopen('ant_6.bin','w');
84 fwrite(fileID,ant6_16, 'int16');
85 fclose(fileID);
86
87 ant7_16=int16(ant7.');
88 fileID = fopen('ant_7.bin','w');
89 fwrite(fileID,ant7_16, 'int16');
90 fclose(fileID);
91
92 ant8_16=int16(ant8.');
93 fileID = fopen('ant_8.bin','w');
94 fwrite(fileID,ant8_16, 'int16');
95 fclose(fileID);
96
97 ant9_16=int16(ant9.');
98 fileID = fopen('ant_9.bin','w');
99 fwrite(fileID,ant9_16, 'int16');
100 fclose(fileID);
101
102 ant10_16=int16(ant10.');
103 fileID = fopen('ant_10.bin','w');
104 fwrite(fileID,ant10_16, 'int16');
105 fclose(fileID);
106
107 ant11_16=int16(ant11.');
108 fileID = fopen('ant_11.bin','w');
109 fwrite(fileID,ant11_16, 'int16');
110 fclose(fileID);
111
112 ant12_16=int16(ant12.');
113 fileID = fopen('ant_12.bin','w');
114 fwrite(fileID,ant12_16, 'int16');
115 fclose(fileID);
116
117 ant13_16=int16(ant13.');
118 fileID = fopen('ant_13.bin','w');
119 fwrite(fileID,ant13_16, 'int16');
120 fclose(fileID);
121
122 ant14_16=int16(ant14.');
123 fileID = fopen('ant_14.bin','w');
124 fwrite(fileID,ant14_16, 'int16');
125 fclose(fileID);
126
127 ant15_16=int16(ant15.');
128 fileID = fopen('ant_15.bin','w');
129 fwrite(fileID,ant15_16, 'int16');
130 fclose(fileID);