Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | Port-based Sample time using Level-2 m-file S-functions

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

Port-based Sample time using Level-2 m-file S-functions - anse...@yahoo.com - Mar 5 21:15:07 2008



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);



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )