Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with MIMO BER MATLAB Simulation

Status
Not open for further replies.

sarmadalani

Newbie level 3
Joined
Nov 18, 2007
Messages
3
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,308
Hello everyone I have made the following code but there was a problem and am seeking help

% the first task is to generate a bpsk signal and simulate the BER and the second task is to convert this to MIMO

clear;clc;
N = 1e4; % Number of data bits
Nt = 1; % Number of Tx antennas
Nr = 1; % Number of Rx antennas
SNR = 0:2:20; % Signal to Noise Ratio range
x = sign (randn(Nt,N)); % BPSK data signal generation
for mm = 1:length(SNR)
Y=0;
Pe = 0;
for i = 1:10000
H = sqrt(1/2) * (randn(Nr,Nt) + j*(randn(Nr,Nt))); % Rayleigh channel
[ U L V ] = svd(H); % Singular Value Decomposition
n = sqrt(1/2)*(10^(-SNR(mm)/10)) * (randn(Nr,N) + j*(randn(Nr,N))); % Additive White Gaussian Noise, 0dB Variance
y = (L*x)+ n; % Channel and Noise addition
Y = y./L; % Equalization
Ydig = sign(real(Y)); %%l ine 17
Diff = (x - Ydig)/2;
AbsDiff = abs(Diff);
Err = sum(AbsDiff);
Pe = Pe + Err;
end
mm
Per(mm) = (Pe)/(N*10000);
end
semilogy(SNR,Per,'-g*')
hold on
grid on
xlabel('SNR, dB')
ylabel('Bit Error Rate')
title('BER for BPSK in a Rayleigh channel')

The problem is when I change Nt & Nr to 4 instead of 1 the following error occur
Error using ==> rdivide Matrix dimensions must agree. Error in ==> test1 at 16 Y = y./L;
What I want to do is change Nt & Nr to 4, them make sum to y so the matrix will be in 1 row then divide by 4 and then do error count starting from line 17

thanks in advance
 

Hi,

I am using Matlab 7. But it is showing error in the following line.


Y = y./L; [/b] % Equalization

Please correct.


Sudan
 

sudan said:
Hi,

I am using Matlab 7. But it is showing error in the following line.


Y = y./L; [/b] % Equalization

Please correct.


Sudan

Hi sudan
I had modified the code and it is now working but i am facing the same problem, could you check and let me know and thanks in advance.
 
  • Like
Reactions: TEBE

    TEBE

    Points: 2
    Helpful Answer Positive Rating
Hi sudan
I had modified the code and it is now working but i am facing the same problem, could you check and let me know and thanks in advance.

Please, could you kindly post the modified code?
Thanks
 

Hi sarmadalani, kindly if you share with me the modified code, it will be so help ful for me. I will be waiting for you reply.
thanks
 

Hi,

Use the Matlab debugger.
Set up a breakpoint in the line with the problem and step through the commands.

This may give you a hint on what is going on.
 

I am curious about this question also, should I use a "for" expression to sum them?
Actually I am not familiar with the array structure?
Anyone can help?

- - - Updated - - -

Thanks for the break point suggestion, now I can RUN 2I1O setting, and later I believe I can run 4I4O.
Thanks for the Lord.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top