Technical discussion about Matlab and issues related to Digital Signal Processing.
Hi everybody
I am trying to implement a block using level-2 m-file s-fucntion with different input and
output sample rates. I am writting following code but it doesn't work. The problem is that Can
anyone me please
Regards
Anser
function QPSK_Mapper(block)
setup(block);
function setup(block)
block.NumInputPorts = 1;
block.NumOutputPorts = 2;
block.InputPort(1).DatatypeID = -1;
block.InputPort(1).Complexity = -1;
block.InputPort(1).SamplingMode = 'Frame';
block.InputPort(1).Dimensions = [1 8];
block.OutputPort(1).DatatypeID = 0;
block.OutputPort(1).Complexity = -1;
block.OutputPort(1).SamplingMode = 'Sample';
block.OutputPort(1).Dimensions = 1;
block.OutputPort(2).DatatypeID = 0;
block.OutputPort(2).Complexity = -1;
block.OutputPort(2).SamplingMode = 'Sample';
block.OutputPort(2).Dimensions = 1;
block.InputPort(1).SampleTime = [1 0];
block.OutputPort(1).SampleTime = [1/4 0];
block.OutputPort(2).SampleTime = [1/4 0];
block.RegBlockMethod('SetInputPortSampleTime',@SetInputPortSampleTime1);
block.RegBlockMethod('SetOutputPortSampleTime',@SetOutputPortSampleTime1);
block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData);
block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims);
block.RegBlockMethod('SetOutputPortDimensions', @SetOutPortDims);
block.RegBlockMethod('Outputs', @Outputs);
block.RegBlockMethod('Terminate', @Terminate);