@@ -34,34 +34,43 @@ using namespace srsran_matlab;
34
34
35
35
void MexFunction::method_new (ArgumentList outputs, ArgumentList inputs)
36
36
{
37
- constexpr unsigned NOF_INPUTS = 3 ;
37
+ constexpr unsigned NOF_INPUTS = 4 ;
38
38
if (inputs.size () != NOF_INPUTS) {
39
39
mex_abort (" Wrong number of inputs: expected {}, provided {}." , NOF_INPUTS, inputs.size ());
40
40
}
41
41
42
42
if (inputs[1 ].getType () != ArrayType::CHAR) {
43
43
mex_abort (" Input 'smoothing' must be a string." );
44
44
}
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 );
53
53
}
54
54
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 )) {
56
65
mex_abort (" Input 'compensateCFO' should be a scalar logical." );
57
66
}
58
- bool compensate_cfo = static_cast <TypedArray<bool >>(inputs[2 ])[0 ];
67
+ bool compensate_cfo = static_cast <TypedArray<bool >>(inputs[3 ])[0 ];
59
68
60
69
if (!outputs.empty ()) {
61
70
mex_abort (" Wrong number of outputs: expected 0, provided {}." , outputs.size ());
62
71
}
63
72
64
- estimator = create_port_channel_estimator (smoothing , compensate_cfo);
73
+ estimator = create_port_channel_estimator (fd_smoothing, td_interpolation , compensate_cfo);
65
74
66
75
// Ensure the estimator was created properly.
67
76
if (!estimator) {
0 commit comments