-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathAnalogAmplitudeCalibrationFormat.m
55 lines (45 loc) · 1.49 KB
/
AnalogAmplitudeCalibrationFormat.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
classdef AnalogAmplitudeCalibrationFormat
% Copyright 2023 The MathWorks, Inc.
properties
CourseSubarray1Data
CourseSubarray2Data
FineSubarray1Data
FineSubarray2Data
end
methods
function s = toStruct(this)
s.CourseSubarray1Data = this.CourseSubarray1Data;
s.CourseSubarray2Data = this.CourseSubarray2Data;
s.FineSubarray1Data = this.FineSubarray1Data;
s.FineSubarray2Data = this.FineSubarray2Data;
end
function [cal1,cal2] = getCourseCalValues(this)
cal1 = this.getCourseCal1();
cal2 = this.getCourseCal2();
end
function [cal1,cal2] = getFineCalValues(this)
cal1 = this.getFineCal1();
cal2 = this.getFineCal2();
end
end
methods (Access = private)
function cal1 = getCourseCal1(this)
cal1 = this.getCal(this.CourseSubarray1Data);
end
function cal1 = getFineCal1(this)
cal1 = this.getCal(this.FineSubarray1Data);
end
function cal2 = getCourseCal2(this)
cal2 = this.getCal(this.CourseSubarray2Data);
end
function cal2 = getFineCal2(this)
cal2 = this.getCal(this.FineSubarray2Data);
end
function cal = getCal(~,data)
% get amplitudes
amp = mean(max(abs(fft(data))));
scaling = min(amp) ./ amp;
cal = reshape(scaling,[1 4]);
end
end
end