フィルターのクリア

I have this error, and I don't know how to solve it.Can someone help me please?

5 ビュー (過去 30 日間)
Error in p5_6_Simulate_Ceiling_Bounce_Model_and_Eye_Diagram (line 32)
channel_output = conv(Tx_signal,h,'same');
  5 件のコメント
M
M 2018 年 8 月 28 日
編集済み: M 2018 年 8 月 28 日
What are Tx_signal and h ? The error message says they must be vectors.
Alexandra Diaconu
Alexandra Diaconu 2018 年 8 月 28 日
Tx is a signal generator. the entire code is:
Rb=200e6;
% Bit rate
Tb=1/Rb;
% bit duration
sig_length = 1e3;
% number of bits
nsamp = 10;
% samples per symbols
Tsamp = Tb/nsamp;
% sampling time
%%*****Channel Impulse response (using Ceiling bounce model)*************
Dt = 0.5;
% Normalized delay spread
Drms = Dt*Tb;
%RMS delay spread
a = 12*sqrt(11/13)*Drms;
K = 30*nsamp;
% number of channel taps
k = 0:K;
h = ((6*a^6)./(((k*Tsamp) + a).^7));
% channel impulse response
h = h./sum(h);
% normalizing for conservation of energy
% **************** filter definitions****************
pt = ones(1,nsamp);
% tranmitter filter
c = conv(pt,h,'same');
OOK = randi(1,sig_length);
% random signal generation
Tx_signal = rectpulse(OOK,nsamp);
%Pulse shaping function (rectangular pulse);
channel_output = conv(Tx_signal,h,'same');
% channel output
eyediagram(channel_output, 3*nsamp);

サインインしてコメントする。

採用された回答

M
M 2018 年 8 月 28 日
編集済み: M 2018 年 8 月 28 日
The problem is that Tx_signal is not a vector but a matrix of size 1000 x 1000.
From the help of conv function:
C = conv(A, B) convolves vectors A and B..
You can look at conv2:
C = conv2(A, B) performs the 2-D convolution of matrices A and B.
  2 件のコメント
Alexandra Diaconu
Alexandra Diaconu 2018 年 8 月 28 日
Thank you so much. It's ok now.
M
M 2018 年 8 月 28 日
you're welcome.

サインインしてコメントする。

その他の回答 (2 件)

KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 8 月 28 日
編集済み: KALYAN ACHARJYA 2018 年 8 月 28 日
The complete code is available in this Book
Optical Wireless Communications: System and Channel Modelling with MATLAB By Z. Ghassemlooy, W. Popoola, S. Rajbhandari
  2 件のコメント
Alexandra Diaconu
Alexandra Diaconu 2018 年 8 月 28 日
I have the code from the book but it doesn't work properly.
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 8 月 28 日
In the following lines more terms there
pt = ones(1,nsamp);
Ensure that Tx_signal and h both should be the vector to avoid the error.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2018 年 8 月 28 日
OOK = randi(1,sig_length);
That line says that the rand values should be integers in the range 1 to 1, and that you want sig_length rows and columns of them.
If you want random binary you should use
randi([0 1], 1, sig_length)

カテゴリ

Help Center および File ExchangeDetection, Range and Doppler Estimation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by