10-16-2008 01:14 PM
Hi it is me again.
Let me explain better what Im trying to do. Im trying to create a modulation (qpsk), but I dont want to use the MT Modulation toolkit, because I'm trying to creat it spte byt step.
1 Step: To create a bit stream 8 bits... (done it)
2 Step: Slit the bit stream in groups of 2 bits ( done it)
3 Step: Then the 2 bits are divided. One "goes" trough the Channel I (in phase) and the other goes troug the Channel Q (in quadrature). (done it)
4 Step: Each bit changes its value, 1 logic= +1 and 0 logic = -1 It means that if bit valued 1 goes trough channel I its changes its value to +1, and if its is a 0, it changes its value to -1, and the same for the channel Q ( done it)
5 Step: Every bit that goes trough channel I must be multiply by a Sin (wct), so the posible answers comming from Channel I are: +Sin (wct) or - Sin (wct), and every bit that goes trough channel Q must be multiply by a Cos (wct), so the possible answers are +cos(wct) or - cos(wct).
6 Step: Add the answers of every channel. The possible answers are:
+sin(wct)+cos(wct)
+sin(wct)-cos(wct)
-sin(wct)+cos(wct)
-sin(wct)-cos(wct)
By doing all this, I have created a qpsk modulation.
I have done this by creating a sine wave and a cosine wave.... and then multiply each by -1 or +1 and add them... and it works, but what I want to know is if I could do it diferently because I would like to see the answers or the combinations exactly like e.g sin(wct)+cos(wct).... The reason I want this, is becasuse afterwards I have to demodulate.....
To demodulate:
Each combination (sen+cos, sen-cos, etc...) goes, at the same time, again troug a channel I and a channel Q, the combiantion trough channel I, multiplies itself, again for sin(wct), and in channel Q for cos (wct)
example
Combination: -Sin(wct)+Cos(wct)
Channel I: (-sin(wct)+cos(wct))*(sin(wct))
Channel Q: (-sin(wct)+cos(wct))*(cos(wct))
Matematically:
(-sinwct+coswt)(sinwct)=
(-sinwct)(sinwct)+(coswct)(sinwct)=
-sin^2(wct)+ (coswct)(sinwct)=
-1/2(1-coswct)+1/2sen(wc+wc)t+1/2sen(wc-wc)t
so channel I = -1/2+1/2cos2wct+1/2sen2wct+1/2sen0...
after filtering 1/2cos2wct+1/2sen2wct and 1/2 sen0 = 0
The answer is -1/2= 0 logic... or a bit value 0.... it the answer where 1/2 = 1 logic or bit valued 1
That is what I would like to create.. I dont mind about frecuency or wct does not have a especific value... I just want to be able of doing this. I have done it with waves but at the time of demodulait, it does not work the way I would like.
Please I hope someone can help me!
10-16-2008 04:03 PM
All of that can be done in LabVIEW.
You need to be careful about keeping track of array indexing since the modulation (I and Q data) arrays may have far fewer elements than the carrier {sin(wct) and cos(wct)} arrays.
I put together a simple demonstration. It needs some cleaning up at the output. I was not particularly careful about preallocating buffer for arrays, so this works OK for small datasets but may not scale well.
It is also not documented well. The for loops on the left generate the bit streams and do the I and Q modulation. On the right the multipliers and filters demodulate the carriers and the while loops decode the result.
Change the noise levels and the filter frequency to see the effects.
Lynn
Note: I had to add a .txt extension to the file so it would attach. Please remove that before opening it.