19 lines
562 B
Matlab
19 lines
562 B
Matlab
|
function gain = helperPlotGainCalibration(name, amplitudes)
|
||
|
% Normalize amplitude for each element in the array
|
||
|
dbNormAmplitudes = mag2db(amplitudes./max(amplitudes));
|
||
|
|
||
|
% Calculate gain adjustment
|
||
|
gain = -mag2db(amplitudes./min(amplitudes));
|
||
|
|
||
|
% Plot normalized amplitudes and gain adjustments
|
||
|
b = bar([dbNormAmplitudes',gain'],'stacked');
|
||
|
b(1).DisplayName = "Initial Normalized Amplitude";
|
||
|
b(2).DisplayName = "Gain Adjustment";
|
||
|
xlabel('Antenna Element')
|
||
|
ylabel('dB');
|
||
|
title([name ' - Gain Calibration'])
|
||
|
legend('Location','southoutside')
|
||
|
|
||
|
end
|
||
|
|