-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathChannelImplementation.m
30 lines (30 loc) · 1.58 KB
/
ChannelImplementation.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
function [waveformArrayChannel] = ChannelImplementation(sysPara, waveformArray)
% /*!
% * @brief This function implement channel amplitude error and phase error.
% * @details .
% * @param[out] waveformArrayChannel, NxM complex doulbe. multi-channel waveform include amplitude error and phase error, N is the number of samples(snaps). M is the number of channel
% * @param[in] sysPara, 1x1 struct, which contains the following field:
% see get used field for detail.
% * @param[in] 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
% * @pre .
% * @bug Null
% * @warning Null
% * @author Wayne Zhang
% * @version 1.0
% * @date 2017.08.03.
% * @copyright Wayne Zhang all rights reserved.
% * @remark { revision history: V1.0, 2017.08.03. Wayne Zhang, first draft }
% */
%% get used field
SwitchChannelImplementation = sysPara.SwitchChannelImplementation; % boolen scaler. true = enable channel implementation; false = disable channel implementation.
ChannelAmpliErr = sysPara.ChannelAmpliErr; % double Mx1 vector. channel amplitude vector. unit in dB. M is number of channel.
ChannelPhaseErr = sysPara.ChannelPhaseErr; % double Mx1 vector. channel phase vector. unit in degree . M is number of channel.
%% process
if ~SwitchChannelImplementation
waveformArrayChannel = waveformArray;
return;
end
%% process
waveformArrayChannel = waveformArray*diag(10.^(ChannelAmpliErr/20))...
*diag(exp(1i*ChannelPhaseErr/180*pi));
end