MFM comes with a few common channel models including the Rayleigh-faded channel, ray/cluster channel, and spherical-wave channel.
Adding your own channel to MFM is relatively straightforward, though a few rules must be followed to ensure it integrates with the rest of MFM.
Custom channel objects should be named with the prefix
channel_ and saved in the
mfm/obj/channel/ directory beside the other channel definitions.
Subclass of the Generic Channel
A custom channel
channel_custom should always be defined as a subclass of the
channel object as follows
classdef channel_custom < channel ... end
A custom channel
channel_custom should have its own definition of
realization() that is of the form.
function H = realization(obj) H = ... % realization definition obj.set_channel_matrix(H); H = obj.get_channel_matrix(); end
realization function should take only one input argument (the object itself) and return the realized channel matrix
realization function, the object should call
Below is a boilerplate class definition for creating a custom channel object in MFM.
classdef channel_custom < channel properties ... % extra properties beyond those inherited from the channel object end methods function obj = channel_custom(...) ... % constructor definition end ... % extra methods beyond those inherited from the channel object function H = realization(obj) H = ... % realization definition obj.set_channel_matrix(H); H = obj.get_channel_matrix(); end end end
Any properties or methods beyond those inherited from the
channel object can be added to the class definition. Methods can be created to overwrite those inherited from the
channel object, though this is discouraged in general.
Extending the Create Function
Channel objects in MFM are often created via
c = channel.create(type)
type is a string specifying the channel to create (e.g.,
To extend this
channel.create function to include a custom channel
channel_custom, do the following.
channel class definition in
At the top of the class definition is the static function
In its function definition, simply tack on the following
elseif statement with whatever unique string you’d like to use for the custom channel model.
elseif strcmpi(type,'my-custom-string') c = channel_custom();
Alternatively, you can create a
channel_custom object without adding it to this
create method by
c = channel_custom()
Setting Transmit and Receive Arrays
A custom channel object
c should always use the functions
array objects. These methods are already defined in the
channel object and should be used anytime the custom channel is used.
Using Your Custom Channel
To use your custom channel, simply execute the typical setup associated with a
channel object, such as
c = channel.create('my-custom-channel') c.set_transmit_array(atx) c.set_receive_array(arx) c.set_propagation_velocity(vel) c.set_carrier_frequency(fc)
along with whatever other setup your custom channel requires.
Then, a realization of your custom channel can be used via
H = c.realization()
or in any other fashion that
channel objects are used in MFM.