Code: Select all
mha_spec_t* convert_t::process(ComplexFloatArray2D* pInputStreamCplx)
ComplexFloatArray2D* convert_t::process(mha_spec_t* s)
Code: Select all
mha_spec_t* convert_t::process(ComplexFloatArray2D* pInputStreamCplx)
ComplexFloatArray2D* convert_t::process(mha_spec_t* s)
Code: Select all
// This is a sketch to point out the general idea.
// The sketch will not work as is.
// You need to adapt it, and fill in missing parts.
class my_plugin : public MHAPlugin::plugin_t<runtime_config_type> {
public:
// signal representation used by existing code
other_signal_type * other_signal;
void prepare(mhaconfig_t dimensions) {
// use info from dimensions to allocate other_signal:
other_signal = new other_signal_type(...);
}
void release() {delete other_signal; other_signal=nullptr;}
mha_spec_t * process(mha_spec_t * openmha_signal) {
// copy signal from openmha_signal to other signal
...
// call existing code to operate on current signal block
...
// copy output signal modified by existing code back to openmha_signal.
...
return openmha_signal;
}
// Everything else (unrelated to signal representation adaptation):
...
};