Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

8PSK output manipulation

8PSK output manipulation

8PSK output manipulation

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!!!!

RE: 8PSK output manipulation

Please send me a copy of the model and I will look at it.

RE: 8PSK output manipulation

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close