-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBarrett_one_modified.m
232 lines (167 loc) · 2.94 KB
/
Barrett_one_modified.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
fig_num=1;
% THM=evalin('base',FS);
pr1=[0.0200;
0.0250;
0.0315;
0.0400;
0.0500;
0.0630;
0.0800;
0.1000;
0.1250;
0.1600;
0.2000;
0.2500;
0.3150;
0.4000;
0.5000;
0.6300;
0.8000;
1.0000;
1.2500;
1.6000;
2.0000]*1000;
pr2=[136.0000;
138.1000;
140.1165;
141.6000;
142.8000;
144.0438;
145.4000;
146.5000;
146.6000;
146.1000;
145.4000;
144.6000;
143.8000;
142.9000;
142.2000;
141.5000;
140.6000;
139.8000;
138.6000;
137.0000;
135.7000];
pr=[pr1 pr2];
pr(1,:)=[];
pr(1,:)=[];
pr(1,:)=[];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% p31
pn=[20 134.2
25 135.1
31.5 137
40 137.7
50 137.8
63 138
80 138.5
100 138.5
125 138
160 137.6
200 136.9
250 135.9
315 135.1
400 134.7
500 133.6
630 132.7
800 132
1000 131
1250 129.4
1600 128
2000 127];
pn(1,:)=[];
pn(1,:)=[];
pn(1,:)=[];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Gr1=[ 25;
40;
50;
63;
80;
100;
125;
160;
200;
250;
315;
400;
500;
630;
800;
1000;
1250;
1600;
2000];
Gr2=[0.4737;
2.1353;
3.4169;
6.8879;
7.2995;
4.2188;
6.2926;
5.8599;
10.0000;
6.5907;
5.9976;
4.0038;
1.7735;
2.2725;
2.2320;
1.1185;
0.8878;
1.0549;
1.0549];
Gr=[Gr1 Gr2];
Gr(1,:)=[];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mass per area lbm/ft2
rhor=1.12;
rhon=1.942;
rho_ratio=rhor/rhon;
sqrt_F=1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sz=size(Gr);
N=sz(1);
Gn=zeros(N,2);
Gn(:,1)=Gr(:,1);
for i=1:N
delta_dB=pn(i,2)-pr(i,2);
p_ratio=10^(delta_dB/20);
R=p_ratio*sqrt_F;
Gn(:,2)=Gr(:,2)*R^2*rho_ratio;
end
clear leg1
clear leg2
clear grms_r
clear grms_n
fn=Gn(:,1);
an=Gn(:,2);
fr=Gr(:,1);
ar=Gr(:,2);
[~,grms_n] = calculate_PSD_slopes(fn,an);
[~,grms_r] = calculate_PSD_slopes(fr,ar);
md=5;
fmin=Gn(1,1);
fmax=Gn(N,1);
%%%%%
x_label='Center Frequency (Hz)';
y_label='SPL (dB)';
t_string='One-Third Octave SPL';
ppp1=pr;
ppp2=pn;
[oadB_n]=overall_dB(pn(:,2));
[oadB_r]=overall_dB(pr(:,2));
leg2=sprintf('USA P31 Liftoff %6.3g dB OASPL',oadB_n);
leg1=sprintf('Saturn V Reference %6.3g dB OASPL',oadB_r);
[fig_num,h2]=plot_loglin_function_two_NW_h2(fig_num,x_label,...
y_label,t_string,ppp1,ppp2,leg1,leg2,fmin,fmax);
%%%%%
x_label='Frequency (Hz)';
y_label='Accel (G^2/Hz)';
t_string='Power Spectral Density Curves';
leg2=sprintf('USA P31 Liftoff %7.3g GRMS',grms_n);
leg1=sprintf('Static Fire %7.3g GRMS',grms_r);
ppp1=Gr;
ppp2=Gn;
[fig_num,h2]=plot_loglog_function_md_two_h2(fig_num,x_label,...
y_label,t_string,ppp1,ppp2,leg1,leg2,fmin,fmax,md);