How to fix Rician Channel Model Error?
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am using the rician channel model directly from the tutorial from MATLAB.
Then i decided to change up the last line of code: ricianchan(channelInput)
I changed ChannelInput to a bpsk modulated signal. It is any number of characters (the user can input any text they want, then it is changed to 8 bits per character) then adding a Hamming(7,4) code. This creates 14 bits per character.
so ChannelInput is still inputing modulated data, but I am getting an error.
Error: Number of Columns of the signal input must be equal to the number of transmit antennas.
How do I go about changing the number of transmit antennas? The tutorial has channel input length of 1024, but if i give it any other length it fails. How would I go about changing this so it can be used with a dynamic input?
Thank you.
0 Commenti
Risposte (1)
Shushant
il 17 Feb 2023
Hi @Nick,
My understanding of your problem is that you want to make the "ricianchan" function execute with dynamic input which is generated by converting the text into 14 bits per character and then modulated using "bpskModulator". I have tried to achieve this by using a dynamic string "s" changing it to a 14 bits per character array, passing it to the "bpskModulator" and then running the function "ricianchan". The function does work without any issues with dynamic input length. As you can observe with the code below.
s='abcdefgh'
p=dec2bin(double(s),14)'
out=double(p(:))-48
pskModulator = comm.PSKModulator;
bpskModulator = comm.BPSKModulator;
%insig = randi([0,pskModulator.ModulationOrder-1],1024,1)
%data = randi([0 1],100,1);
%channelInput = pskModulator(insig);
modData = bpskModulator(out);
ricianchan = comm.RicianChannel( ...
'SampleRate',1e6, ...
'PathDelays',[0.0 0.5 1.2]*1e-6, ...
'AveragePathGains',[0.1 0.5 0.2], ...
'KFactor',2.8, ...
'DirectPathDopplerShift',5.0, ...
'DirectPathInitialPhase',0.5, ...
'MaximumDopplerShift',50, ...
'DopplerSpectrum',doppler('Bell', 8), ...
'RandomStream','mt19937ar with seed', ...
'Seed',73, ...
'PathGainsOutputPort',true);
[RicianChanOut1,RicianPathGains1] = ricianchan(modData)
release(ricianchan);
ricianchan.RandomStream = 'Global stream';
rng(73)
[RicianChanOut2,RicianPathGains2] = ricianchan(modData);
isequal(RicianChanOut1,RicianChanOut2)
I suggest you recheck your code as the function "ricianchan" has no issues with input of dynamic length.
0 Commenti
Vedere anche
Categorie
Scopri di più su BPSK in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!