Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

8PSK output manipulation

Status
Not open for further replies.

spand

Computer
Nov 15, 2003
2
I'm trying to simulate an 8psk modulator/demodulator in simulink. The model works but the output data is "shifted" by 15 entries so BER calculations turn out wrong. There is a way of manipulating output arrays with matlab code but I'm not too good with that. Does anyone know how to do it in Simulink and if not is there another way of doing it?! Please help!!!!
Thanks
 
Replies continue below

Recommended for you

Please send me a copy of the model and I will look at it.
 
Here is my example:

Model {
Name "PSK_Demo"
Version 5.0
SaveDefaultBlockParams on
SampleTimeColors off
LibraryLinkDisplay "none"
WideLines off
ShowLineDimensions on
ShowPortDataTypes off
ShowLoopsOnError on
IgnoreBidirectionalLines off
ShowStorageClass off
ExecutionOrder off
RecordCoverage off
CovPath "/"
CovSaveName "covdata"
CovMetricSettings "dw"
CovNameIncrementing off
CovHtmlReporting on
covSaveCumulativeToWorkspaceVar on
CovSaveSingleToWorkspaceVar on
CovCumulativeVarName "covCumulativeData"
CovCumulativeReport off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
MinMaxOverflowArchiveMode "Overwrite"
BlockNameDataTip off
BlockParametersDataTip off
BlockDescriptionStringDataTip off
ToolBar on
StatusBar on
BrowserShowLibraryLinks off
BrowserLookUnderMasks off
Created "Wed Jan 14 18:04:03 2004"
UpdateHistory "UpdateHistoryNever"
ModifiedByFormat &quot;%<Auto>&quot;
LastModifiedBy &quot;jfield&quot;
ModifiedDateFormat &quot;%<Auto>&quot;
LastModifiedDate &quot;Wed Jan 14 18:28:33 2004&quot;
ModelVersionFormat &quot;1.%<AutoIncrement:9>&quot;
ConfigurationManager &quot;None&quot;
SimParamPage &quot;Solver&quot;
LinearizationMsg &quot;none&quot;
Profile off
ParamWorkspaceSource &quot;MATLABWorkspace&quot;
AccelSystemTargetFile &quot;accel.tlc&quot;
AccelTemplateMakefile &quot;accel_default_tmf&quot;
AccelMakeCommand &quot;make_rtw&quot;
TryForcingSFcnDF off
ExtModeMexFile &quot;ext_comm&quot;
ExtModeBatchMode off
ExtModeTrigType &quot;manual&quot;
ExtModeTrigMode &quot;normal&quot;
ExtModeTrigPort &quot;1&quot;
ExtModeTrigElement &quot;any&quot;
ExtModeTrigDuration 1000
ExtModeTrigHoldOff 0
ExtModeTrigDelay 0
ExtModeTrigDirection &quot;rising&quot;
ExtModeTrigLevel 0
ExtModeArchiveMode &quot;off&quot;
ExtModeAutoIncOneShot off
ExtModeIncDirWhenArm off
ExtModeAddSuffixToVar off
ExtModeWriteAllDataToWs off
ExtModeArmWhenConnect on
ExtModeSkipDownloadWhenConnect off
ExtModeLogAll on
ExtModeAutoUpdateStatusClock on
BufferReuse on
RTWExpressionDepthLimit 5
SimulationMode &quot;normal&quot;
Solver &quot;ode45&quot;
SolverMode &quot;Auto&quot;
StartTime &quot;0.0&quot;
StopTime &quot;inf&quot;
MaxOrder 5
MaxStep &quot;auto&quot;
MinStep &quot;auto&quot;
MaxNumMinSteps &quot;-1&quot;
InitialStep &quot;auto&quot;
FixedStep &quot;auto&quot;
RelTol &quot;1e-3&quot;
AbsTol &quot;auto&quot;
OutputOption &quot;RefineOutputTimes&quot;
OutputTimes &quot;[]&quot;
Refine &quot;1&quot;
LoadExternalInput off
ExternalInput &quot;[t, u]&quot;
LoadInitialState off
InitialState &quot;xInitial&quot;
SaveTime on
TimeSaveName &quot;tout&quot;
SaveState off
StateSaveName &quot;xout&quot;
SaveOutput on
OutputSaveName &quot;yout&quot;
SaveFinalState off
FinalStateName &quot;xFinal&quot;
SaveFormat &quot;Array&quot;
Decimation &quot;1&quot;
LimitDataPoints on
MaxDataPoints &quot;1000&quot;
SignalLoggingName &quot;sigsOut&quot;
ConsistencyChecking &quot;none&quot;
ArrayBoundsChecking &quot;none&quot;
AlgebraicLoopMsg &quot;warning&quot;
BlockPriorityViolationMsg &quot;warning&quot;
MinStepSizeMsg &quot;warning&quot;
InheritedTsInSrcMsg &quot;warning&quot;
DiscreteInheritContinuousMsg &quot;warning&quot;
MultiTaskRateTransMsg &quot;error&quot;
SingleTaskRateTransMsg &quot;none&quot;
CheckForMatrixSingularity &quot;none&quot;
IntegerOverflowMsg &quot;warning&quot;
Int32ToFloatConvMsg &quot;warning&quot;
ParameterDowncastMsg &quot;error&quot;
ParameterOverflowMsg &quot;error&quot;
ParameterPrecisionLossMsg &quot;warning&quot;
UnderSpecifiedDataTypeMsg &quot;none&quot;
UnnecessaryDatatypeConvMsg &quot;none&quot;
VectorMatrixConversionMsg &quot;none&quot;
InvalidFcnCallConnMsg &quot;error&quot;
SignalLabelMismatchMsg &quot;none&quot;
UnconnectedInputMsg &quot;warning&quot;
UnconnectedOutputMsg &quot;warning&quot;
UnconnectedLineMsg &quot;warning&quot;
SfunCompatibilityCheckMsg &quot;none&quot;
RTWInlineParameters off
BlockReductionOpt on
BooleanDataType on
ConditionallyExecuteInputs on
ParameterPooling on
OptimizeBlockIOStorage on
ZeroCross on
AssertionControl &quot;UseLocalSettings&quot;
ProdHWDeviceType &quot;Microprocessor&quot;
ProdHWWordLengths &quot;8,16,32,32&quot;
RTWSystemTargetFile &quot;grt.tlc&quot;
RTWTemplateMakefile &quot;grt_default_tmf&quot;
RTWMakeCommand &quot;make_rtw&quot;
RTWGenerateCodeOnly off
RTWRetainRTWFile off
TLCProfiler off
TLCDebug off
TLCCoverage off
TLCAssertion off
BlockDefaults {
Orientation &quot;right&quot;
ForegroundColor &quot;black&quot;
BackgroundColor &quot;white&quot;
DropShadow off
NamePlacement &quot;normal&quot;
FontName &quot;Helvetica&quot;
FontSize 10
FontWeight &quot;normal&quot;
FontAngle &quot;normal&quot;
ShowName on
}
BlockParameterDefaults {
Block {
BlockType ComplexToRealImag
Output &quot;Real and imag&quot;
}
Block {
BlockType Constant
Value &quot;1&quot;
VectorParams1D on
ShowAdditionalParam off
OutDataTypeMode &quot;Inherit from 'Constant value'&quot;
OutDataType &quot;sfix(16)&quot;
ConRadixGroup &quot;Use specified scaling&quot;
OutScaling &quot;2^0&quot;
}
Block {
BlockType DataTypeConversion
DataType &quot;auto&quot;
SaturateOnIntegerOverflow on
}
Block {
BlockType Display
Format &quot;short&quot;
Decimation &quot;10&quot;
Floating off
SampleTime &quot;-1&quot;
}
Block {
BlockType FrameConversion
OutFrame &quot;Frame-based&quot;
}
Block {
BlockType Ground
}
Block {
BlockType Inport
Port &quot;1&quot;
PortDimensions &quot;-1&quot;
SampleTime &quot;-1&quot;
ShowAdditionalParam off
LatchInput off
DataType &quot;auto&quot;
OutDataType &quot;sfix(16)&quot;
OutScaling &quot;2^0&quot;
SignalType &quot;auto&quot;
SamplingMode &quot;auto&quot;
Interpolate on
}
Block {
BlockType Outport
Port &quot;1&quot;
OutputWhenDisabled &quot;held&quot;
InitialOutput &quot;[]&quot;
}
Block {
BlockType RelationalOperator
Operator &quot;>=&quot;
ShowAdditionalParam off
InputSameDT on
LogicOutDataTypeMode &quot;Logical (see Advanced Sim. Parameters)&quot;
LogicDataType &quot;uint(8)&quot;
ZeroCross on
}
Block {
BlockType &quot;S-Function&quot;
FunctionName &quot;system&quot;
PortCounts &quot;[]&quot;
SFunctionModules &quot;''&quot;
}
Block {
BlockType SubSystem
ShowPortLabels on
Permissions &quot;ReadWrite&quot;
RTWSystemCode &quot;Auto&quot;
RTWFcnNameOpts &quot;Auto&quot;
RTWFileNameOpts &quot;Auto&quot;
SimViewingDevice off
DataTypeOverride &quot;UseLocalSettings&quot;
MinMaxOverflowLogging &quot;UseLocalSettings&quot;
}
Block {
BlockType ZeroOrderHold
SampleTime &quot;1&quot;
}
}
AnnotationDefaults {
HorizontalAlignment &quot;center&quot;
VerticalAlignment &quot;middle&quot;
ForegroundColor &quot;black&quot;
BackgroundColor &quot;white&quot;
DropShadow off
FontName &quot;Helvetica&quot;
FontSize 10
FontWeight &quot;normal&quot;
FontAngle &quot;normal&quot;
}
LineDefaults {
FontName &quot;Helvetica&quot;
FontSize 9
FontWeight &quot;normal&quot;
FontAngle &quot;normal&quot;
}
System {
Name &quot;PSK_Demo&quot;
Location [375, 682, 1269, 966]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor &quot;white&quot;
PaperOrientation &quot;landscape&quot;
PaperPositionMode &quot;auto&quot;
PaperType &quot;usletter&quot;
PaperUnits &quot;inches&quot;
ZoomFactor &quot;100&quot;
ReportName &quot;simulink-default.rpt&quot;
Block {
BlockType Reference
Name &quot;AWGN\nChannel&quot;
Ports [1, 1]
Position [355, 84, 435, 126]
FontSize 10
SourceBlock &quot;commchan2/AWGN\nChannel&quot;
SourceType &quot;AWGN Channel&quot;
seed &quot;1237&quot;
noiseMode &quot;Signal to noise ratio (Es/No)&quot;
EsNodB &quot;15&quot;
SNRdB &quot;10&quot;
Ps &quot;1&quot;
Tsym &quot;3&quot;
variance &quot;1&quot;
}
Block {
BlockType Reference
Name &quot;Bernoulli Binary\nGenerator&quot;
Ports [0, 1]
Position [55, 83, 135, 127]
FontName &quot;Arial&quot;
FontSize 10
SourceBlock &quot;commrandsrc2/Bernoulli Binary\nGenerator&quot;
SourceType &quot;Bernoulli Binary Generator&quot;
P &quot;0.5&quot;
seed &quot;12345&quot;
Ts &quot;1&quot;
frameBased on
sampPerFrame &quot;300&quot;
orient off
}
Block {
BlockType Reference
Name &quot;Discrete-Time\nScatter Plot\nScope&quot;
Tag &quot;ScatterPlot&quot;
Ports [1]
Position [520, 180, 565, 230]
FontSize 10
SourceBlock &quot;commsink2/Discrete-Time\nScatter Plot\nScope&quot;
SourceType &quot;Discrete-Time Scatter Plot Scope&quot;
showPlotting on
sampPerSymb &quot;1&quot;
offsetEye &quot;0&quot;
numTraces &quot;40&quot;
numNewFrames &quot;10&quot;
showRendering off
LineMarkers &quot;.&quot;
LineColors &quot;b&quot;
fading on
render on
AxisGrid on
showAxes on
xMin &quot;-1.5&quot;
xMax &quot;1.5&quot;
yMin &quot;-1.5&quot;
yMax &quot;1.5&quot;
inphaseLabel &quot;In-phase Amplitude&quot;
quadratureLabel &quot;Quadrature Amplitude&quot;
showFigure on
openScopeAtSimStart on
FrameNumber off
FigPos &quot;[360 447 560 487]&quot;
figTitle &quot;Scatter Plot&quot;
numLinesMax &quot;8&quot;
block_type_ &quot;scatter&quot;
}
Block {
BlockType Display
Name &quot;Display&quot;
Ports [1]
Position [755, 36, 845, 154]
FontSize 10
Decimation &quot;1&quot;
}
Block {
BlockType Reference
Name &quot;Error Rate\nCalculation&quot;
Ports [2, 1]
Position [630, 67, 705, 118]
FontSize 10
SourceBlock &quot;commsink2/Error Rate\nCalculation&quot;
SourceType &quot;Error Rate Calculation&quot;
N &quot;0&quot;
st_delay &quot;0&quot;
cp_mode &quot;Entire frame&quot;
subframe &quot;[]&quot;
PMode &quot;Port&quot;
WsName &quot;ErrorVec&quot;
RsMode2 off
stop off
numErr &quot;100&quot;
maxBits &quot;1e6&quot;
}
Block {
BlockType Reference
Name &quot;M-PSK\nDemodulator\nBaseband&quot;
Ports [1, 1]
Position [510, 80, 585, 130]
FontSize 10
SourceBlock &quot;commdigbbndpm2/M-PSK\nDemodulator\nBaseband&quot;
SourceType &quot;M-PSK Demodulator Baseband&quot;
M &quot;8&quot;
OutType &quot;Bit&quot;
Dec &quot;Binary&quot;
Ph &quot;pi/8&quot;
numSamp &quot;1&quot;
}
Block {
BlockType Reference
Name &quot;M-PSK\nModulator\nBaseband&quot;
Ports [1, 1]
Position [205, 79, 280, 131]
FontSize 10
SourceBlock &quot;commdigbbndpm2/M-PSK\nModulator\nBaseband&quot;
SourceType &quot;M-PSK Modulator Baseband&quot;
M &quot;8&quot;
InType &quot;Bit&quot;
Enc &quot;Binary&quot;
Ph &quot;pi/8&quot;
numSamp &quot;1&quot;
}
Line {
SrcBlock &quot;Bernoulli Binary\nGenerator&quot;
SrcPort 1
Points [35, 0]
Branch {
DstBlock &quot;M-PSK\nModulator\nBaseband&quot;
DstPort 1
}
Branch {
Points [0, -55; 440, 0]
DstBlock &quot;Error Rate\nCalculation&quot;
DstPort 1
}
}
Line {
SrcBlock &quot;M-PSK\nModulator\nBaseband&quot;
SrcPort 1
DstBlock &quot;AWGN\nChannel&quot;
DstPort 1
}
Line {
SrcBlock &quot;AWGN\nChannel&quot;
SrcPort 1
Points [0, 0; 35, 0]
Branch {
Points [0, 100]
DstBlock &quot;Discrete-Time\nScatter Plot\nScope&quot;
DstPort 1
}
Branch {
DstBlock &quot;M-PSK\nDemodulator\nBaseband&quot;
DstPort 1
}
}
Line {
SrcBlock &quot;M-PSK\nDemodulator\nBaseband&quot;
SrcPort 1
DstBlock &quot;Error Rate\nCalculation&quot;
DstPort 2
}
Line {
SrcBlock &quot;Error Rate\nCalculation&quot;
SrcPort 1
DstBlock &quot;Display&quot;
DstPort 1
}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor