Why do I receive "Error using RectangularQAMModulator"
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
% Set the OFDM and QAM parameters
N = 64; % Number of subcarriers
M = 16; % Size of QAM constellation
CP = 16; % Cyclic prefix length
% Set the number of nodes in the network
numNodes = 4;
% Set the frame length and number of slots
frameLength = 1000;
numSlots = numNodes;
% Create an OFDM modulator object
ofdmMod = comm.OFDMModulator('FFTLength', N, 'NumGuardBandCarriers', [0;0], 'CyclicPrefixLength', CP);
% Create an OFDM demodulator object
ofdmDemod = comm.OFDMDemodulator('FFTLength', N, 'NumGuardBandCarriers', [0;0], 'CyclicPrefixLength', CP);
% Create a QAM modulator object
qamMod = comm.RectangularQAMModulator('ModulationOrder', M, 'NormalizationMethod', 'Average power');
% Create a QAM demodulator object
qamDemod = comm.RectangularQAMDemodulator('ModulationOrder', M, 'NormalizationMethod', 'Average power');
% Generate a random data sequence for each node
data = randi([0 M-1], frameLength, numNodes);
% Modulate the data using QAM
modData = qamMod(data);
% Modulate the QAM symbols using OFDM
txSignal = ofdmMod(modData);
% Perform DCT on the OFDM symbols
txSignal = dct(txSignal);
% Create a TDMA schedule
schedule = repmat((1:numNodes)', 1, frameLength/numSlots);
schedule = schedule(:);
% Transmit the data using TDMA
txSignal = txSignal(:,schedule);
% Add channel noise to the transmitted signal
rxSignal = awgn(txSignal, 10);
% Perform IDCT on the received signal
rxSignal = idct(rxSignal);
% Demodulate the received signal using OFDM
rxModData = ofdmDemod(rxSignal);
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu QAM finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!