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.

question about BER in convolutional coding

Status
Not open for further replies.

sa269

Newbie level 4
Joined
Apr 27, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,322
bit error ratio in c program

I am doing a project in convolutional coding and i have to write a program about modulation with AWGN channel or noise, doesnt mater. I have this program which doesn't give me good BER. i am confused and dont know how to di it. after i finish this i have to apply convolutional coding and observe the change in BER. here is the program: (the program is a bit of mess like my state of mind)

% this program build communication system with bpsk modulation, adds noise,
% and find the BER for it.

x=rand(64,1);%64 symbols
data=round(x)'; %64 1s and 0s

l = 64; %length of modulation steps
BER=[]; %define bit error rate
e=0;% number of errors is defined at 0

% bpsk modulation gives -1 for 0s bits and 1s for 1s bits
for b = 1 : l
if data(b) == 0
temp1(b) = -1;
else temp1(b) = 1;
end
end

% AWGN channel noise and SNR loop
for snr=0:0.1:6.3 %100 steps
e=0;
% AWGN channel
temp2 = awgn(temp1, snr);

% demodulation
for c= 1 : l
if temp2(c) <= 0
data_dec(c) = 0 ; %recovers the -1 back to 0 as in the original data before modulation
else data_dec(c) = 1;
end
end

% BER caculation
for m= 1:l
if (data(m) ~=data_dec(m)),%compare the demodulated with the original signal. if error adds 1.
e = e + 1;
end
end
BER = [BER e/l];
end

anyone knows how to do it? i apprecaiteyour help. thanks in advanve.
 

rayleigh and racien channel

why you do not used the built in functions in matlab for your work?
 

Re: question about BER

I can use them but the problem is how can i use them with qam or qpsk system. i dont know how to cmbine them both together..

any idea any one???
 

Re: question about BER

what do you mean by "combine them together"

which matlab version do you have?

see this program for matlab 2008:

clc;
clear all;
disp('M-Array PSK Modulation')
%create a random digital message
M=input ('M= '); %alphabet size
x=randint(input('Number of binary bit stream = '),1,M);
nsample=40; %oversampling rate.
%use M-PSK modulation to produce y
y=modulate(modem.pskmod(M),x);
%follow with rectangular pulse shaping.
ypulse=rectpulse(y,nsample);
stem(y(1:10),'filled'),grid;
ynoisy=awgn(ypulse,input('SNR in dB = '),'measured');
%Create scattet plot from noisy data
scatterplot(ynoisy),grid;
%%
%Downsample at the reciever.
ydownsample=intdump(ynoisy,nsample);
%%
%Demodulate ynoisy to recover the message.
z=demodulate(modem.pskdemod(M),ydownsample);
figure;
subplot(2,1,1);
stem(x(1:10),'filled'),grid;
subplot(2,1,2);
stem(z(1:10),'filled'),grid;
%%
%Check symbole erroe rate.
[num ty]=symerr(x,z)


let me know your results and your comments

---------------------------------------------------------------------------------------
OFDM and Matlab: **broken link removed**
---------------------------------------------------------------------------------------
 

Re: question about BER

thanks for the program firstly.

I have matlab 2007 so i cant simulate the program.. i will try to adjust the program but i is kind of mission impossible. any suggestions??

cos I need to see the BER for this and then apply convolutional coding and see the BER difference. i dont know what to do. i really need help with this.

thanks alot
 

question about BER

my friend, in the above program there is a BER calculation at the last which is

[num ty]=symerr(x,z)
 

Re: question about BER

sa269 said:
thanks for the program firstly.

I have matlab 2007 so i cant simulate the program.. thanks alot

Wow !! :!: :!:

Any way I understand what you want to do... open the Help for Matlab Communication toolbox and try to search fpr bercoding... I think thats it. But anyway see the examples given there for Convolutional coding... You may get what you are looking for

An advise... just asking for Matlab code on these forums won't help you learn. What ever assignment you have got is given to you for learning, you should try to do it yourself first, otherwise the assignment becomes worthless as far as learning is concerned, but hey, that is the whole reason you are studying!
 

question about BER

I agreed with you communication engineer
 

Re: question about BER

hye i need to plot a ber(bit error rate graph) on the graph but coouldnt find any command for that.
my assignment is to analyze the code for ofdm over awgn , rayleigh and racien channel ,anylyze in teh form of symerr and ber..i have a problem that how to calculate the symbol error rate and bit error rate and then c it on the matlab,i dnt need any simulink help . or any already made tool ,i need a command only .
Furthermore the symerr in this code is not showing me the value of symbol error ,bcz it is showing undefined num .

ur early help will be highly appreciated
.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top