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.
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.
Ahmed,
After taking a look at 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.
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;
69
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 }
75
76 out++ = sumgr_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.
what kind of digital modulation are you using? im working on a DS with
802.11b Barker sequence but my receiver isn’t working yet. What version
of GNU-radio are you working with? and in what SDR are you implementing
your DS?
On 03.12.2012 02:58, Ahmed Z. wrote:
[stuff deleted]
70 for (int j = 0; j < d_len; j++) {
the old state of the PN generator’s shift register, hereby
Gerald
Hi, Gerald,
Thank you for clarifying this block! I think I misunderstood the code in
pn_correlator.
If I read it correctly, pn_correlator acts like one finger in a RAKE
receiver in that it correlates input samples by PN sequence and
transforms chips to symbols. I don’t see “sequential search” part as
described in its comment. As far as I know, sequential search means to
correlate input samples by PN sequence and advance one sample after each
correlation. If that’s the case, may I suggest GNU Radio developers
modify its comment in pn_correlator_cc.h from “PN code sequential search
correlator” to “PN code correlator” without using “sequential search”?
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). 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 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.
Ahmed,
After taking a look at 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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.