MATLAB Newsgroup

Good Morning,

I've delivered the following Matlab implementation of a QPSK

modulator, to test it I also arrange a

simple QPSK demodulator, the problems I have are the following :

1) For the noise introduced by the channel I use the relations

SNR_x_bit_dB = 6 ;

SNR_dB = SNR_x_bit_dB -10*log10(0.5) - 10*log10(f_clk / (data_rate)) ;

QPSK_et_noise = awgn( (QPSK_I + QPSK_Q) , SNR_dB, 'measured' , [],'dB' );

I'm not sure about these, especially for the second one, could you confirm

to me it's validity ?? In the simulation I found BER = 0.01234 while the

theoretical one is BER = 0.00238829

2) The same following code could work also for data rate of 82.5Mbps

or 110Mbps but respect to the same simulation at 55Mbps the result are

really bad, for example having SNR_x_bit_dB = 6 I have

BER = 0.0354462 at 82.5Mbps and BER = 0.079483 at 110Mbps.

How you explain this ??

3) When the noise grows it is normal I think that the eye close, if

you run the following code you'll see the eye diagram at the output of

the SRRC filter that isreally dirty, you think is normal for a

SNR_x_bit = 6dB ??

4) I use to demap the Matlab function demodmap :

simboli = demodmap(data_rx , [symbol_rate 0] , f_clk , 'qask', 4) ;

this is a 4-PSK demodulator and it's equivalent to a 4-QAM demodulator but

why these two matlab constellations have a phase difference of pi/4 ??

For the 4-PSK in fact the constellation that matlab expect have all symbols

on the axis. Why this ?? How can I use 4-PSK demap ??

And finally here it is the Matlab code, I hope you'll test it and

suggest me how to solve these

problems and enhance it. Thanks ...

Antonio D'Ottavio

clear all ;

close all ;

clc ;

f_clk = 165e6 ;

data_rate = 55e6 ;

n_bits = 12000 ;

symbol_rate = data_rate / 2 ;

SpS = f_clk / symbol_rate ;

n_symb = n_bits / 2 ;

n_sample = n_symb * SpS ;

bit_tx = randint(n_bits, 1, [0 1] ) ;

bit_I = bit_tx(1 : 2 : n_bits) ;

bit_Q = bit_tx(2 : 2 : n_bits) ;

data_in_SRRC_tx_I = -2*bit_I + 1 ;

data_in_SRRC_tx_Q = -2*bit_Q + 1 ;

%********************************** SRRC DESIGN

delay = 3 ;

roll_off = 0.35 ;

input_rate_SRRC = symbol_rate ;

output_rate_SRRC = f_clk ;

num_fir=rcosine(input_rate_SRRC, output_rate_SRRC, 'fir/sqrt', roll_off, delay);

% **********************************************

% ************************************ QPSK MODULATOR

% **********************************************

% ******************************** CARRIER FREQUENCY = f_clk/4

t_clk = 1 / f_clk ;

t = 0 : t_clk : (n_sample-1)*t_clk ;

theta = 2*pi*(f_clk/4)*t ;

coseno = [cos(theta)] ;

seno = [sin(theta)] ;

data_out_SRRC_I = applica_polifase(data_in_SRRC_I, SpS , num_fir);

data_out_SRRC_Q = applica_polifase(data_in_SRRC_Q, SpS , num_fir);

QPSK_I = [coseno .* data_out_SRRC_tx_I(1:length(coseno)] ;

QPSK_Q = - [seno .* data_out_SRRC_tx_Q(1:length(coseno)] ;

[Pyy , f_out] = pwelch(QPSK, [] , [] , 'onesided', length(QPSK) - 1 , f_clk) ;

Pyy_dB = 10*log10(Pyy) ;

figure ; plot(f_out , Pyy_dB - max(Pyy_dB) );

grid ; xlim([0 f_clk/2]) ;

title(['PSD QPSK FLP con data rate ',num2str(data_rate/1e6),' Mbps']);

xlabel('Frequency (Hz)'); ylabel('dB / Hz');

% *****************************************************

% *************************************** CHANNEL EFFECT

% *****************************************************

SNR_x_bit_dB = 6 ;

SNR_dB = SNR_x_bit_dB -10*log10(0.5) - 10*log10(f_clk / (data_rate) );

QPSK_et_noise = awgn( (QPSK_I + QPSK_Q) , SNR_dB, 'measured' , [] ,'dB' );

% *****************************************************

% ********************************* QPSK DEMODULATOR

% *****************************************************

data_in_SRRC_rx_I = coseno .* QPSK_et_noise ;

data_in_SRRC_rx_Q = -seno .* QPSK_et_noise ;

data_out_SRRC_rx_I = filter(num_fir, 1 , data_in_SRRC_rx_I);

data_out_SRRC_rx_Q = filter(num_fir, 1 , data_in_SRRC_rx_Q);

data_rx = [data_out_SRRC_rx_I' data_out_SRRC_rx_Q'];

scatterplot(data_rx , SpS , 18) ;

eyediagram(data_out_SRRC_rx_I(601:2400) , SpS , 1/symbol_rate , 0);

simboli = demodmap(data_rx , [symbol_rate 0] , f_clk , 'qask' , 4) ;

for i = 1:length(simboli)

switch simboli(i)

case 0

simboli_I(i) = 1 ; simboli_Q(i) = 1 ;

case 1

simboli_I(i) = -1 ; simboli_Q(i) = 1 ;

case 2

simboli_I(i) = 1 ; simboli_Q(i) = -1 ;

case 3

simboli_I(i) = -1 ; simboli_Q(i) = -1 ;

otherwise

error('Nun ce prova ''nfame !!! ')

end

end

bit_rx_I = ( simboli_I - 1) / (-2) ;

bit_rx_Q = ( simboli_Q - 1) / (-2) ;

bit_rx = 4*ones(1,n_bits) ;

bit_rx(1 : 2 : n_bits) = bit_rx_I ;

bit_rx(2 : 2 : n_bits) = bit_rx_Q ;

delta = 10 ;

[wrong BER]=biterr(bit_tx(1:(n_bits-delta)),bit_rx((delta+1):n_bits)')

expBER_matlab = 0.5 .* erfc( sqrt ( 10.^ (SNR_x_bit_dB(:) .* 0.1) ) )

THE FOLLOWING CODE HAVE TO BE IN A FILE NAMED applica_polifase.m

% MODULE NAME : applica_polifase.m

% DESCRIPTION : Applica il filtraggio secondo lo schema polifasepolifase

% RELEASE :

% PROBLEMS :

% DATE : 3-6-2001

function data_out_polifase = applica_polifase(data_in_polifase, SpS , coefficienti)

n_fir = SpS ;

n_symb = length(data_in_polifase) ;

n_coefficienti = length(coefficienti) ;

max_dim_fir = ceil( n_coefficienti / n_fir) ;

matrice_dei_fir = zeros(n_fir, max_dim_fir) ;

for i = 1 : n_fir

fir_i = coefficienti(i : n_fir : n_coefficienti) ;

matrice_dei_fir(i , 1:length(fir_i) ) = fir_i ;

end

matrice_fir_out = zeros( n_fir , n_symb ) ;

for i = 1 : n_fir

matrice_fir_out(i,:) = filter(matrice_dei_fir(i,:) , 1 , data_in_polifase');

end

data_out_polifase = zeros( 1 , n_symb * n_fir ) ;

k = 0 ;

for colonna = 1 : n_symb

for riga = 1 : n_fir

k = k + 1 ;

data_out_polifase(k) = matrice_fir_out(riga , colonna);

end

end

You can think of your watch list as threads that you have bookmarked.

You can add tags, authors, threads, and even search results to your watch list. This way you can easily keep track of topics that you're interested in. To view your watch list, click on the "My Newsreader" link.

To add items to your watch list, click the "add to watch list" link at the bottom of any page.

To add search criteria to your watch list, search for the desired term in the search box. Click on the "Add this search to my watch list" link on the search results page.

You can also add a tag to your watch list by searching for the tag with the directive "tag:tag_name" where tag_name is the name of the tag you would like to watch.

To add an author to your watch list, go to the author's profile page and click on the "Add this author to my watch list" link at the top of the page. You can also add an author to your watch list by going to a thread that the author has posted to and clicking on the "Add this author to my watch list" link. You will be notified whenever the author makes a post.

To add a thread to your watch list, go to the thread page and click the "Add this thread to my watch list" link at the top of the page.

*No tags are associated with this thread.*

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

The newsgroups are a worldwide forum that is open to everyone. Newsgroups are used to discuss a huge range of topics, make announcements, and trade files.

Discussions are threaded, or grouped in a way that allows you to read a posted message and all of its replies in chronological order. This makes it easy to follow the thread of the conversation, and to see what’s already been said before you post your own reply or make a new posting.

Newsgroup content is distributed by servers hosted by various organizations on the Internet. Messages are exchanged and managed using open-standard protocols. No single entity “owns” the newsgroups.

There are thousands of newsgroups, each addressing a single topic or area of interest. The MATLAB Central Newsreader posts and displays messages in the comp.soft-sys.matlab newsgroup.

**MATLAB Central**

You can use the integrated newsreader at the MATLAB Central website to read and post messages in this newsgroup. MATLAB Central is hosted by MathWorks.

Messages posted through the MATLAB Central Newsreader are seen by everyone using the newsgroups, regardless of how they access the newsgroups. There are several advantages to using MATLAB Central.

**One Account**

Your MATLAB Central account is tied to your MathWorks Account for easy access.

**Use the Email Address of Your Choice**

The MATLAB Central Newsreader allows you to define an alternative email address as your posting address, avoiding clutter in your primary mailbox and reducing spam.

**Spam Control**

Most newsgroup spam is filtered out by the MATLAB Central Newsreader.

**Tagging**

Messages can be tagged with a relevant label by any signed-in user. Tags can be used as keywords to find particular files of interest, or as a way to categorize your bookmarked postings. You may choose to allow others to view your tags, and you can view or search others’ tags as well as those of the community at large. Tagging provides a way to see both the big trends and the smaller, more obscure ideas and applications.

**Watch lists**

Setting up watch lists allows you to be notified of updates made to postings selected by author, thread, or any search variable. Your watch list notifications can be sent by email (daily digest or immediate), displayed in My Newsreader, or sent via RSS feed.

- Use a newsreader through your school, employer, or internet service provider
- Pay for newsgroup access from a commercial provider
- Use Google Groups
- Mathforum.org provides a newsreader with access to the comp.soft sys.matlab newsgroup
- Run your own server. For typical instructions, see: http://www.slyck.com/ng.php?page=2