[Scilab-users] Copying an array

CRETE Denis denis.crete at thalesgroup.com
Mon Aug 5 10:04:01 CEST 2013


Hello,
Is it 
Data2=data1.*.ones(1,interpx)
?
HTH
Denis
-----Message d'origine-----
De : users-bounces at lists.scilab.org [mailto:users-bounces at lists.scilab.org] De la part de cactus_jack
Envoyé : vendredi 2 août 2013 00:16
À : users at lists.scilab.org
Objet : [Scilab-users] Copying an array

Hi, I'm pretty new to scilab and basically what I need to do is copy the following array into a new one but start the copying at the index that is half the interpx value, where interpx=64.

The array is:
data2 = zeros(1, bits*interpx); // initializing the array with dimensions

I'm not really sure how to do this, but from what i can gather, I need to use a for loop. 

The reason i need to do this is, i need to convert the following QPSK modulation code into offset QPSK modulation. In Offset QPSK, the Q channel is shifted by half a time symbol so that the I and Q channel signals do not transition at the same time and in order to do this, i was told that I would need to do what i explained above.

The complete code is as follows:

interpx = 64;
bits = 100;
data = round(rand(1, bits));
data1 = 2.*data - 1;
data2 = zeros(1, bits*interpx); // initializing the arrays with dimensions

for m = 1:interpx,
data2(m:interpx:bits*interpx) = data1 //Bit fattening end

t=0:1/2:(bits*interpx/2) - 1/2; //t=time
carrier1 =  sin(t); //Q channel
carrier2 =  cos(t); // I channel
//scf(0)
//plot(carrier1)
//scf(1)
//plot(carrier2)
bpskwave1= (carrier1.*data2);//Q channel bpskwave2= (carrier2.*data2);//I channel
//disp(bpskwave1)
qpsk=(bpskwave1+bpskwave2)
plot(qpsk)
//plot(bpskwave2,bpskwave1)

If anyone could show me how to do this, or show me an example or point me in the direction of some useful documentation, that would great. Thanks in advance. 



--
View this message in context: http://mailinglists.scilab.org/Copying-an-array-tp4027149.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



More information about the users mailing list