[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Direct Sequence Spread Spectrum Question.

From: Gerald Baier
Subject: Re: [Discuss-gnuradio] Direct Sequence Spread Spectrum Question.
Date: Mon, 3 Dec 2012 21:10:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

On 03.12.2012 02:58, Ahmed Zaheer wrote:
I am multiplying my file source with GLFSR source and then giving the product to modulation blocks in transmitting flowgraph. In the receiving flowgraph after demodulating the signal I am passing the demodulated signal through PN Correlator block having same values of degree, mask and seed parameters and then save the file into sink source. I am not able to receive the same data(it only works when I use degree=1, mask and seed =0 for both GLFSR and PN Correlator i.e. making GLFSR a constant source of magnitude 1).
You have to make sure that the chip-rate of your PN sequence is higher than the symbol-rate of your modulation block. Try setting the sample per symbol option of the modulation block to the length of the PN sequence. This way the period of the PN sequence is equal to one symbol duration.
Do I have to use the PN Correlator block in some other manner? Or I should use some other blocks after PN Correlator block to retrieve the original data?
I think your next problem are the following lines in the PN correlator, where d_pn is the current chip of the PN sequence and d_len the sequence's period:

 67   for (int i = 0; i < noutput_items; i++) {
 68     sum = 0.0;
 70     for (int j = 0; j < d_len; j++) {
71 if (j != 0) // retard PN generator one sample per period
 72         d_pn = 2.0*d_reference->next_bit()-1.0; // no conditionals
 73       sum += *in++ * d_pn;
 74     }
 76     *out++ = sum*gr_complex(1.0/d_len, 0.0);
 77   }

Basically after one complete period (line 70), the correlator keeps the old state of the PN generator's shift register, hereby retarding/changing the phase of the PN sequence (line 71). What you want do to, is to always correlate with the same phase, so removing line 71 should do the trick.

Keep in mind that the PN correlator is a decimator block, so for N samples, with N being the length of the PN sequence, it only outputs one sample. Therefore you can't demodulate with the same samples per symbol option as in the modulator.

I hope that helps,


*From:* Albert Chun-Chieh Huang <address@hidden>
*To:* Ahmed Zaheer <address@hidden>
*Cc:* "address@hidden" <address@hidden>
*Sent:* Saturday, December 1, 2012 7:46 AM
*Subject:* Re: [Discuss-gnuradio] Direct Sequence Spread Spectrum Question.

Ahmed Zaheer <address@hidden <mailto:address@hidden>> writes:

> I was trying to implement Direct Sequence Spread Spectrum in gnuradio. In the transmitting flowgraph I am using GLFSR source to multiply it with the file which I am transmitting. At the receiver end I am able to receive it by multiplying it with same GLFSR source with the same values. But there is no acquisition being done. I am seeing a block named PN Correlator. But I don't know what this block does and where should I use this block in the flowgraph. My question is does anybody know what the PN Correlator block does and is it performing the acquisition or not.
> Any help/comments would be greatly appreciated.
> Regards.


After taking a look at digital_pn_correlator_cc.cc <http://digital_pn_correlator_cc.cc/>, I think it's a
serial code acquisition block as described in its header. The output
will be cross-correlation of PN sequence and input samples. Input sample
pointer is advanced by noutput_items samples for each call, and the
output value is derived from multiplying input samples by PN sequence,
both are length of whole PN sequence. If you think noutput_items to be
one, then it will be easier to understand this code. So, yes, it's
serial search code acquisition to my understanding. If you monitor the
output of digital_pn_correlator, you should see a spike when the
acquisition is achieved, and the interval between two spikes will be
roughly the length of PN sequence due to noise effect. I think its input
is time domain samples from your front-end.

This is my understanding of this block. Hope it helps.

Best Regards,


Albert Chun-Chieh Huang(黃俊傑)
Blog: Random Notes, http://alberthuang314.blogspot.com/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]