The “Mean” Block in Simulink meets errors when the input is complex number

조회 수: 5 (최근 30일)
As show in this model, the binary bit stream is modulated by 16-QAM, followed by the 8 up-sampling and AWGN module. In the scenario, the optimal receiver is calculating the average value of each 8 samples.
However, the model report error:
Unsigned integer or fixed-point signals must be real. (See the figure below)
By examining the setting of “Mean” block, I found that the relative setting of fixed-point is system default. In MATLAB Help system, it’s described that the mean of a complex input is computed independently for the real and imaginary components.(showed below)
Hence, I tried other method of calculating mean value of complex number, including the following 4 kinds(Screenshot is below):
  1. Calculate the real part and imaginary part of the complex number. The result showed that it’s right.
  2. I built the block calculating the mean value using the “Submatrix” module. The result showed that it’s right.
  3. Let the output of “Mean” block to Workspace. The result showed that it’s right.
  4. I write the m code calculating the mean value in “MATLAB Fun” block. The result showed that it’s right.
I find a strange phenomenon that the output of “Mean” block cannot connect to “Rectangular QAM Demodulator Baseband” block. Otherwise MATLAB will report error.
I have examined the data type and data dimension. It shows that there’s no problem.
My Operating System: Windows 7 with 64Bit.
MATLAB: R2015a
The right and wrong mdl modle file is attached in the last.

채택된 답변

jibrahim
jibrahim 2016년 3월 4일
Hi Li,
This is a bug in the Mean block. A workaround is to insert a 'Complex to Real-Imag' block followed by a 'Real-Imag to Complex' block after the Mean block (see attached snapshot).
Thanks, Jihad
  댓글 수: 3
jibrahim
jibrahim 2016년 3월 7일
Hi Li,
The bug will be fixed in R2016b. For R2016a, unfortunately you will have to use the workaround. Sorry about the inconvenience.
Li Zhang
Li Zhang 2016년 3월 8일
Thanks for your reply! I got it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by