[Scilab-users] Copying an array
cactus_jack
jasonryan57 at hotmail.com
Fri Aug 2 00:16:19 CEST 2013
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.
More information about the users
mailing list