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

5 ビュー (過去 30 日間)
Li Zhang
Li Zhang 2016 年 3 月 3 日
コメント済み: Li Zhang 2016 年 3 月 8 日
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 件)

Community Treasure Hunt

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

Start Hunting!

Translated by