Skip to content

Commit 3c92d99

Browse files
author
Xavier Arteaga
committed
Add channel estimator time-domain interpolation strategy
1 parent bb5c4a4 commit 3c92d99

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

+srsMEX/+phy/@srsMultiPortChannelEstimator/srsMultiPortChannelEstimator.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
ImplementationType (1, :) char {mustBeMember(ImplementationType, {'MEX', 'noMEX'})} = 'MEX'
6464
%Frequency domain smoothing strategy ('filter', 'mean', 'none').
6565
Smoothing (1, :) char {mustBeMember(Smoothing, {'filter', 'mean', 'none'})} = 'filter'
66+
%Time domain interpolation strategy ('average', 'interpolate').
67+
Interpolation (1, :) char {mustBeMember(Interpolation, {'average', 'interpolate'})} = 'average'
6668
%Boolean flat: compensate CFO if true.
6769
CompensateCFO (1, 1) logical = true
6870
end % properties (Nontunable)
@@ -80,7 +82,7 @@ function setupImpl(obj)
8082
% constructs the channel estimator object inside the MEX function.
8183
if strcmp(obj.ImplementationType, 'MEX')
8284
obj.stepMethod = @stepMEX;
83-
obj.multiport_channel_estimator_mex('new', obj.Smoothing, obj.CompensateCFO);
85+
obj.multiport_channel_estimator_mex('new', obj.Smoothing, obj.Interpolation, obj.CompensateCFO);
8486
else
8587
obj.stepMethod = @stepPLAIN;
8688
end

+srsMEX/source/lib/phy/upper/signal_processors/multiport_channel_estimator_mex.cpp

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,34 +34,43 @@ using namespace srsran_matlab;
3434

3535
void MexFunction::method_new(ArgumentList outputs, ArgumentList inputs)
3636
{
37-
constexpr unsigned NOF_INPUTS = 3;
37+
constexpr unsigned NOF_INPUTS = 4;
3838
if (inputs.size() != NOF_INPUTS) {
3939
mex_abort("Wrong number of inputs: expected {}, provided {}.", NOF_INPUTS, inputs.size());
4040
}
4141

4242
if (inputs[1].getType() != ArrayType::CHAR) {
4343
mex_abort("Input 'smoothing' must be a string.");
4444
}
45-
std::string smoothing_string = static_cast<CharArray>(inputs[1]).toAscii();
46-
port_channel_estimator_fd_smoothing_strategy smoothing = port_channel_estimator_fd_smoothing_strategy::none;
47-
if (smoothing_string == "filter") {
48-
smoothing = port_channel_estimator_fd_smoothing_strategy::filter;
49-
} else if (smoothing_string == "mean") {
50-
smoothing = port_channel_estimator_fd_smoothing_strategy::mean;
51-
} else if (smoothing_string != "none") {
52-
mex_abort("Unknown smoothing strategy {}", smoothing_string);
45+
std::string fd_smoothing_string = static_cast<CharArray>(inputs[1]).toAscii();
46+
port_channel_estimator_fd_smoothing_strategy fd_smoothing = port_channel_estimator_fd_smoothing_strategy::none;
47+
if (fd_smoothing_string == "filter") {
48+
fd_smoothing = port_channel_estimator_fd_smoothing_strategy::filter;
49+
} else if (fd_smoothing_string == "mean") {
50+
fd_smoothing = port_channel_estimator_fd_smoothing_strategy::mean;
51+
} else if (fd_smoothing_string != "none") {
52+
mex_abort("Unknown FD smoothing strategy {}", fd_smoothing_string);
5353
}
5454

55-
if ((inputs[2].getType() != ArrayType::LOGICAL) && (inputs[2].getNumberOfElements() > 1)) {
55+
std::string td_interpolation_string = static_cast<CharArray>(inputs[2]).toAscii();
56+
port_channel_estimator_td_interpolation_strategy td_interpolation =
57+
port_channel_estimator_td_interpolation_strategy::average;
58+
if (td_interpolation_string == "interpolate") {
59+
td_interpolation = port_channel_estimator_td_interpolation_strategy::interpolate;
60+
} else if (td_interpolation_string != "average") {
61+
mex_abort("Unknown TD interpolation strategy {}", td_interpolation_string);
62+
}
63+
64+
if ((inputs[3].getType() != ArrayType::LOGICAL) && (inputs[3].getNumberOfElements() > 1)) {
5665
mex_abort("Input 'compensateCFO' should be a scalar logical.");
5766
}
58-
bool compensate_cfo = static_cast<TypedArray<bool>>(inputs[2])[0];
67+
bool compensate_cfo = static_cast<TypedArray<bool>>(inputs[3])[0];
5968

6069
if (!outputs.empty()) {
6170
mex_abort("Wrong number of outputs: expected 0, provided {}.", outputs.size());
6271
}
6372

64-
estimator = create_port_channel_estimator(smoothing, compensate_cfo);
73+
estimator = create_port_channel_estimator(fd_smoothing, td_interpolation, compensate_cfo);
6574

6675
// Ensure the estimator was created properly.
6776
if (!estimator) {

+srsMEX/source/lib/phy/upper/signal_processors/multiport_channel_estimator_mex.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ class MexFunction : public srsran_mex_dispatcher
103103
};
104104

105105
std::unique_ptr<srsran::port_channel_estimator>
106-
create_port_channel_estimator(srsran::port_channel_estimator_fd_smoothing_strategy smoothing, bool compensate_cfo)
106+
create_port_channel_estimator(srsran::port_channel_estimator_fd_smoothing_strategy fd_smoothing,
107+
srsran::port_channel_estimator_td_interpolation_strategy td_interpolation,
108+
bool compensate_cfo)
107109
{
108110
using namespace srsran;
109111
std::shared_ptr<dft_processor_factory> dft_factory = create_dft_processor_factory_fftw_slow();
110112
std::shared_ptr<time_alignment_estimator_factory> ta_est_factory =
111113
create_time_alignment_estimator_dft_factory(dft_factory);
112114
std::shared_ptr<port_channel_estimator_factory> estimator_factory =
113115
create_port_channel_estimator_factory_sw(ta_est_factory);
114-
return estimator_factory->create(smoothing, compensate_cfo);
116+
return estimator_factory->create(fd_smoothing, td_interpolation, compensate_cfo);
115117
}

apps/simulators/PUSCHBLER/PUSCHBLER.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@
201201
%Bit-width of the compressed IQ samples.
202202
% Only applies if ApplyOFHCompression is set to true.
203203
CompIQwidth (1, 1) double {mustBeInteger, mustBeInRange(CompIQwidth, 1, 16)} = 9
204+
%Time-domain interpolation strategy ('average', 'interpolate').
205+
% Valid only for SRS estimator.
206+
Interpolation (1, :) char {mustBeMember(Interpolation, {'average', 'interpolate'})} = 'average'
204207
end % of properties (Nontunable)
205208

206209
properties % Tunable
@@ -638,7 +641,7 @@ function stepImpl(obj, SNRIn, nFrames)
638641
if useSRSDecoder
639642
srsDemodulatePUSCH = srsMEX.phy.srsPUSCHDemodulator;
640643
srsChannelEstimate = srsMEX.phy.srsMultiPortChannelEstimator(ImplementationType = obj.SRSEstimatorType, ...
641-
Smoothing = 'filter', CompensateCFO = true);
644+
Smoothing = 'filter', Interpolation = obj.Interpolation, CompensateCFO = true);
642645
end
643646

644647
% %%% Simulation loop.

0 commit comments

Comments
 (0)