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.

Gaussian pulse sequence modulated by a bit sequence (MATLAB)

Status
Not open for further replies.

axristos86

Newbie level 2
Joined
Feb 9, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
Hello!I can't find how to programm equations like this

E(t)= Σbn*g(t-nTs)

in Matlab
Specifically I want to generate a gaussian pulse sequence modulated by a bit sequence.The mathematical expression is

E(t)=c(1)exp[-(t-Tb/2)^2/2To^2] + c(2)exp[-(t-3Tb/2)^2/2To2]+…. +c(i)exp[-(t-(i-1/2)Tb)^2/2To^2]

c is the bit sequence.

i have written a code for the three terms of the equation which works and shows the pulses with amplitude 0 or 1 in time.

that's the code

d=randint(127,1);
c(1)=xor(1,d(1));

for i=2:127
c(i)=xor(d(i),c(i-1)); % dpsk mod data

end

Tb=100; %ps
To=0.158*Tb;

E=c(1)*exp(-(t-(Tb/2)).^2/(2*To*To)) + c(2)*exp(-(t-3*(Tb/2)).^2/(2*To*To)) +c(3)*exp(-(t-5*(Tb/2)).^2/(2*To*To));

t=0:500;
plot(t,E);

how can i programm it for all the 127 pulses of course without writting them one by one?I have tried some loops but it wouldn't work because i can't give simultaneously values to i and t.

Thank you!
 

Re: Gaussian pulse sequence modulated by a bit sequence (MAT

call you pulse samples matrix A : a 1 X 43 matrix, say.
put your bit sequence into another array B, a binary (or +/- 1) array of 1x127 (say)
C = A' * B; Now you have all numbers you want but in "incorrect" order.
Transpose,
C = C';
and string them into one long vector D = C:));
- B
 

Re: Gaussian pulse sequence modulated by a bit sequence (MAT

thanks but i finally managed it!this is the code that gives me the result i want

d=randint(127,1);
c(1)=xor(1,d(1));

for i=2:127
c(i)=xor(d(i),c(i-1)); % dpsk mod data

end

Tb=100; %ps
To=0.158*Tb;

Too = 2*To*To;
Tb2 = Tb/2;
% βασικό loop
E=0;
S=0;
t=0:1:12700;
for i=1:127
E = E + c(i) * exp( -( t -(2*i-1)*Tb2 ) .^2 / Too) ;
S = S + d(i) * exp( -( t -(2*i-1)*Tb2 ) .^2 / Too) ;


end;

subplot(2,1,1), plot(t,S)
title ('Random Bit Input')
xlabel ('Time in psec')
ylabel ('Magnitude')
subplot(2,1,2), plot(t,E)
title('DPSK Modulation')
xlabel ('Time in psec')
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top