Rules | Recent posts | topic RSS | Search | Register  | Log in

convolutional code

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital communication
Author Message
aliazmat



Joined: 14 Mar 2008
Posts: 46
Helped: 2


Post24 Sep 2008 12:36   convolutional code

friends,

I am simulating a simple awgn channel with convolutional code but the code which I have developed is not working ..plz need some help....i want to see BER curve

code is

clc;
clear all;
N=1000;
tx_data=ones(1,N); %round(rand(1,N));
snr_db=[-10:2.5:15];
snr_linear=(10.^(snr_db/10));

t = poly2trellis([4 3],[4 5 17;7 4 2]); % Define trellis.
conv_enc_data = convenc(tx_data,t); % Encode a string of ones.
tb = 2; % Traceback length for decoding
pe=zeros(size(snr_db)); % initliaze pe vector

for i=1:size(snr_db,2)
sigma=1/sqrt(snr_linear(1,i));
nois=1/sqrt(2)*(randn(1,size(conv_enc_data,2))+j*randn(1,size(conv_enc_data,2)));
noise = nois*sigma;

rx_data = conv_enc_data + noise; % add awgn

detced_bits = (mean(rx_data,1)>=0);
decoded = vitdec(detced_bits,t,tb,'trunc','hard'); % Decode.
nr_of_bit_err = sum(not(decoded==tx_data));
pe(i)=nr_of_bit_err/N;
end
semilogy(snr_db,pe)
Back to top
omhr



Joined: 05 Mar 2008
Posts: 25
Helped: 2


Post25 Sep 2008 15:47   Re: convolutional code

Its hard to detect errors in someone's else program but here is a program i have of coonvolutional coding with MPSK modulation that might come in use.

By the way tell me how to chose the values in "poly2trellis([4 3],[4 5 17;7 4 2])" and can u make a conversion of codes given in Parity check matrix into the form required by this poly2trellis function?



Sorry, but you need login in to view this attachment

Back to top
aliazmat



Joined: 14 Mar 2008
Posts: 46
Helped: 2


Post26 Sep 2008 21:25   Re: convolutional code

friend sorry i could not run your program ..what is that

further in poly2trellis([4 3],[4 5 17;7 4 2])

the first I think show the constraint length which is the memory registers used in the convolution encoder and second is the polynomial description of the encoder

you can have better explanation at


http://www.mathworks.com/access/helpdesk/help/toolbox/comm/index.html?/access/helpdesk/help/toolbox/comm/ug/fp7405.html&http://www.google.com/search?hl=en&q=convolution+code+matlab+help&btnG=Google+Search&aq=f&oq=
Back to top
omhr



Joined: 05 Mar 2008
Posts: 25
Helped: 2


Post27 Sep 2008 1:43   convolutional code

Its a convolutional coding program with MPSK modulation and hard-decision decoding. It generates a BER performance graph where the blue curve indicates the uncoded system while the red curve indicates the convolutionally coded system.
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital communication
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap