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.

QPSK passband demodulation - For Experts

Status
Not open for further replies.

Communications_Engineer

Advanced Member level 3
Joined
Oct 10, 2008
Messages
894
Helped
179
Reputation
358
Reaction score
105
Trophy points
1,323
Location
Sindh, Pakistan
Activity points
5,542
Hi,

I have created a QPSK modulator for passband in matlab; created baseband BPSK and then upconverted.

Code:
Fs = 10000;
fc = 1000;
n = 0:1/Fs:1;
M = 4;
datlen = 100;

I = cos(2*pi*fc*n);
Q = sine(2*pi*fc*n);

Dat = randint(1,datlen);

Sym = pskmod(Dat,M); % I know simply writing pskmod won't be the correct QPSK (incorrect constellation)
                                   % but lets ignore it for a while

Sig = real(Sym) * I + j*imag(Sym) * Q;

So, how to demodulate it?

Use a bandpass filter centered at 1KHz (wouldn't have much affect would it?) and then start to sample it (bandpass sampling)

This is the first time I'm doing this and even though I can think of many things, I would like if someone can share their views on how to demodulate it.


PS. Its nice to see that our experts have started to participate in discussions
 

Hi friend,
In fact i am very busy last days and still busy, But I will write here what i know in simple words:

To do demodulation for this type of modulation you need to multiply each filtered signal with its corresponding carrier such as the cos by the cos and the sin by the sin, If you have only a sin then you must shift it by 90 degrees to get the cos to use it.

If i am not right please correct me.

Thanks
 
I'm working on this problem for the hole year...

during the modulation muliplying with SINE will kill the signal for some reason I don't realy understand, one way to handle this problem is using none zero initial phase.

here is one of the many not working programs I'v writen:


M=16;
Fs=200;
Fc=1e3;
Fd=0.2; % baud - symbol/second
Ts=1/Fd; %time of sym
%t=0:1/Fs:Ts-1/Fs;
t=0:Ts:100*Ts-Ts;

header = randint(5, 32, [0 1]);
IPdata = randint(395, 32, [0 1]);
sig = [header ;IPdata];
sigB = reshape(sig,4 ,[]) ;
i=sqrt(-1);

% Base Band modulation/demodulation
%--------------------------------------------------------
h1=modem.qammod(M);
h1.inputtype = 'bit';
h2=modem.qamdemod(h1);


y=modulate(h1, sigB);
y=awgn(y, 15, 'measured');

yde_bb=demodulate(h2, y);
Nerr=biterrfnd(yde_bb, sigB); %num of bit errors
%-------------------------------------------------------


%Pass Band modulation/demodulation
%-------------------------------------------------------------
t_up=0:Ts:length(y)*Ts-Ts;

y1=y.*exp(2*i*pi*Fc*t_up); %BASE BAND TO PASS BAND

yI=y1.*cos(2*pi*fc*t_up); %Pass BAND TO BASE BAND
yQ=y1.*sin(2*pi*fc*t_up);

%Here we should have Low pas filter

%Demap the constaltion

%-------------------------------------------------------------


If you ever got to finish you project please send me your code, I'll do the same if I'll finish first, apperantly we just have the same problem.
 

why do you upconvert by multiplying it with complex exponential signal, I think the method I've used is correct? If it is not then please tell me as I have followed the way QPSK modulator diagrams are.

Actually, I'm kinda busy with other work.... anyway I think that first we need to pulse shape before upconversion so that we have definite bandwidth, so that at the receiver after multiplying our passband signal with for e.g. a cosine, we can design a proper low pass filter.

What do you think?
 

Communications_Engineer said:
why do you upconvert by multiplying it with complex exponential signal, I think the method I've used is correct? If it is not then please tell me as I have followed the way QPSK modulator diagrams are.

Actually, I'm kinda busy with other work.... anyway I think that first we need to pulse shape before upconversion so that we have definite bandwidth, so that at the receiver after multiplying our passband signal with for e.g. a cosine, we can design a proper low pass filter.

What do you think?


completely I agree with all what you have said above. for the first thing... yes, why you are multiplying by the exponential function?

secondly, you have to never multiply by cos or sin without shaping the pulse. You must reshape the pulse using one of many types of windows such as hamming or hanning or rised cosine window, see this command for rised cosine pulse reshaping that i have checked and it is working very good:

rcosflt

regards
 

Do you have any 'direct' reference using which we can calculate the "Beta" factor pulse shaping filter.

Lets say I want to simulate transmission at 100 KSyms/Sec so I want my signal to occupy 100KHz.

Any reference?
 

Communications_Engineer said:
Do you have any 'direct' reference using which we can calculate the "Beta" factor pulse shaping filter.

Lets say I want to simulate transmission at 100 KSyms/Sec so I want my signal to occupy 100KHz.

Any reference?

sorry My brother,

I did not understand you.

Added after 1 minutes:

would you explain more please?
 
Well, I was asking that if you know of an equation that computes the pulse shaping factor for a particular bandwidth. For e.g. in UMTS an RRC filter is used at the transmitter with a pulse shaping factor (beta) of 0.22 (I hope I'm not mistaken when I say this)

Any formula? As I don't really have enough time at this moment to go through books for details. Will try it during vacations. At this moment of time I want to test if this idea (discussed in previous posts) works
 

%adding a rectangular pulse shaping;
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);
SNR=input('SNR in dB = ')
%%

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);

%% RF modulation
Icomp=ammod(real(ypulse),20e3,50e3);
Qcomp=1i*ammod(real(ypulse),20e3,50e3);
passbandsignal=Icomp+Qcomp;
figure;
subplot(211); plot(1:length(passbandsignal),real(passbandsignal))
subplot(212); plot(1:length(passbandsignal),imag(passbandsignal))
 
Hey guys,

It took me a while to remmember why in first place I multiplayed by exp..
because exp(i*x) = cos(x) + i*sin(x)
and that how I thought I can build the Inphase and Quadrature componets.


anyway Aya's algorithem is much more helpful for my project then mine.
But in the following lines:

Icomp=ammod(real(ypulse),20e3,50e3);
Qcomp=1i*ammod(real(ypulse),20e3,50e3);
are you shore Qcomp shoulden't be pi/2 phase shifted?



Aya can you please post here the code for demodulator it will help me a lot.
 

Why should it be pi/2 shifted?

I and Q would be orthogonal to each other regardless because of "i/j"


Here is a graph for the frequency contents of the modulated pass-band signal

My questions are:

1) Have you set any bandwidth for the signal?


...more after I look in detail at the code
 

That's a good question, I don't know how to set a band width for the signal.
I think that the pulse shaping filter suppose to limit the band width of the signal...

in our case it seems that the carrier is at 20khz and sampling frequency is 50khz
and according to the matlab help : Fs > 2(Fc + BW)
 
shlomyss, Montadar lets try to find a relation which can tell us the type of pulse shaping filter to use in order to band-limit (theoritically) our signal within a certain band.
 

there are a lot of windows:

barthannwin, bartlett, blackman, blackmanharris, bohmanwin, chebwin, flattopwin, gausswin, hamming, hann, kaiser, nuttallwin, parzenwin, rectwin, triang, taylorwin, tukeywin

check them in Matlab's help.
 

yes, but these windows are not going to helpful in our case, as these windows will convert the discontinuity into a transition. You cannot really use them to define bandwidth
 

but the window will reshape the pulses

do you think so?
 

Thanks Mathuranathan you helped me understand how to define the band width of a filter.

but how do I define the bit rate W?
which kind of parameter is will change the W?
 

bit rate = symbol rate * bits/symbol

Added after 1 minutes:

but you should know what bit rate you want to have, its the symbol rate you have calculate
 

I'ts not what I was meaning mate,

What I meant is how in matlab code can I define the bitrate?

while using modem objects in matlab or using Aya's code there is no consideration of the symbol rate or bitrate.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top