-3

我需要使用矩形 16QAM 调制方案生成一个包含 0 到 15 的 40320 个整数的随机数字消息的输入信号,至少有 101 个错误,以确定误码率。

如何在 Matlab 中实现这一点?到目前为止,我已经编写了这段代码。任何人都可以启发我吗?

 M=16; %signal constellation size
 log2M =log2(M); %number of bits per symbol
 N= 40320; %No of random integers sent
 coderate =1;% FEC not required
 MinNoErr =101; %Minimum no of received symbol error 
 MaxNoErr =11e9; %Maximum no of received symbol error 
 nsamp =1; %No of samples per symbol
 B= randi([1, M-1],N,1); % Random integer data stream

% Modulate
hMod = comm.RectangularQAMModulator(M); % Create a 16-QAM modulator
txqam = modulate(modem.qammod(M),B);% Modulate using 16-QAM.
txqam =T; %transmited signal

% Send signal over an AWGN channel
EbNo = [5:1:15]; % In dB
SNR = EbNo + 10*log10(log2M*coderate) - 10*log10(nsamp);
hChan = comm.AWGNChannel('NoiseMethod', 'Signal to noise ratio (SNR)', ...
'SNR',SNR);

hChan.SignalPower = (T' * T)/ length(T);
ynoisy = step(hChan,T);
4

1 回答 1

1

据我了解,您只需要一个长度为 40320 的向量,其中包含区间 [1, 15] 中的随机整数。如果是这样,您只需要:

my_vector = randi(15 + 1, [1, 40320]) - 1;

如果这不是您想要的,请明确说明您需要什么。

于 2013-05-17T15:29:21.973 回答