DSPRelated.com
Forums

Spread Spectrum Modulation?

Started by gct July 27, 2007
I'm trying to simulate a spread spectrum signal (a spread version of a pure
tone).  But I'm not quite clear on how to apply the code to the signal.  My
data is 16-bit integer but the code produces a bit at a time.  So do I take
1 6 PN bits and XOR it with each element of the signal?  Confused.
On Jul 27, 4:55 pm, "gct" <smcal...@gmail.com> wrote:
> I'm trying to simulate a spread spectrum signal (a spread version of a pure > tone). But I'm not quite clear on how to apply the code to the signal. My > data is 16-bit integer but the code produces a bit at a time. So do I take > 1 6 PN bits and XOR it with each element of the signal? Confused.
If the PN code bit is zero, multiply the signal sample by -1. Otherwise don't. John
gct wrote:
> I'm trying to simulate a spread spectrum signal (a spread version of a pure > tone). But I'm not quite clear on how to apply the code to the signal. My > data is 16-bit integer but the code produces a bit at a time. So do I take > 1 6 PN bits and XOR it with each element of the signal? Confused.
You're confused enough that you're confusing me. I _think_ you're talking about direct sequence spread spectrum, I _think_ the 'tone' you're talking about is coded digital data, and I _think_ you think you clock the sequence at the same rate as your data. What you _do_ with direct sequence spread spectrum is to generate a pseudo-random sequence of bits at a much higher rate than the bandwidth of your unspread signal, then modulate the signal with the bits. Usually this is done by transmitting the signal straight through on a '1' and inverting it's phase on a '0' (or visa versa), although you could cook up fancier schemes. The result is a signal that, to the casual observer, has a high bandwidth with no particular spectral concentration. If you demodulate it with the right method and sequence, however, you reconstitute the original signal ready for demodulation. Dunno if this helps -- try doing a web search on "direct sequence spread spectrum". -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
>gct wrote: >> I'm trying to simulate a spread spectrum signal (a spread version of a
pure
>> tone). But I'm not quite clear on how to apply the code to the signal.
My
>> data is 16-bit integer but the code produces a bit at a time. So do I
take
>> 1 6 PN bits and XOR it with each element of the signal? Confused. > >You're confused enough that you're confusing me. > >I _think_ you're talking about direct sequence spread spectrum, I >_think_ the 'tone' you're talking about is coded digital data, and I >_think_ you think you clock the sequence at the same rate as your data. > >What you _do_ with direct sequence spread spectrum is to generate a >pseudo-random sequence of bits at a much higher rate than the bandwidth >of your unspread signal, then modulate the signal with the bits. >Usually this is done by transmitting the signal straight through on a >'1' and inverting it's phase on a '0' (or visa versa), although you >could cook up fancier schemes. > >The result is a signal that, to the casual observer, has a high >bandwidth with no particular spectral concentration. If you demodulate >it with the right method and sequence, however, you reconstitute the >original signal ready for demodulation. > >Dunno if this helps -- try doing a web search on "direct sequence spread
>spectrum". > >-- > >Tim Wescott >Wescott Design Services >http://www.wescottdesign.com > >Do you need to implement control loops in software? >"Applied Control Theory for Embedded Systems" gives you just what it
says.
>See details at http://www.wescottdesign.com/actfes/actfes.html >
No you're right. I should have been more specific. I'm doing DSSS and I've got the code written for generating my PN codes and such, I just wasn't sure how to apply the code to the data, since all the examples I've seen use binary signals. Thanks!
On Jul 27, 6:11 pm, "gct" <smcal...@gmail.com> wrote:
> No you're right. I should have been more specific. I'm doing DSSS and > I've got the code written for generating my PN codes and such, I just > wasn't sure how to apply the code to the data, since all the examples I've > seen use binary signals. Thanks!
The whole point of DSSS is that it replaces your bitstream with a sequence of chips at a higher frequency, thus spreading the signal's spectrum. To apply the spreading code, upsample your baseband symbols by the length of the spreading code, then element-wise multiply the upsampled vector by your spreading code, repeating the spreading code periodically every data bit. For example: Data: 1001 Spreading code: 1101 Convert these quantities into a baseband representation for your modulation scheme (I assume BPSK): BPSK symbols: 1 -1 -1 1 Upsampled symbols: 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 Spreading code symbols: 1 1 -1 1 Spread symbols: 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 The last line shows the 16 chips that now correspond to the 4 bits of data. The chip rate is 4 times the bitrate. Jason
> What you _do_ with direct sequence spread spectrum is to generate a > pseudo-random sequence of bits at a much higher rate than the bandwidth > of your unspread signal, then modulate the signal with the bits. > Usually this is done by transmitting the signal straight through on a > '1' and inverting it's phase on a '0' (or visa versa), although you > could cook up fancier schemes. > >
I realize that was a simplified explination..., if you literally switch from phase inversion to no phase inversion as described above, you will create a very wide spectrum with many sidelobes. I think you have to apply baseband filtering (i.e RRC) to the spreading sequence just like you do for the data sequence in order to control the sidelobes. Mark
> >> What you _do_ with direct sequence spread spectrum is to generate a >> pseudo-random sequence of bits at a much higher rate than the
bandwidth
>> of your unspread signal, then modulate the signal with the bits. >> Usually this is done by transmitting the signal straight through on a >> '1' and inverting it's phase on a '0' (or visa versa), although you >> could cook up fancier schemes. >> >> > >I realize that was a simplified explination..., if you literally >switch from phase inversion to no phase inversion as described above, >you will create a very wide spectrum with many sidelobes. I think you >have to apply baseband filtering (i.e RRC) to the spreading sequence >just like you do for the data sequence in order to control the >sidelobes. > >Mark > > >
OK here's what I'm doing. I'm taking my waveform (it's just a pure tone), and upsample it to my chip rate. Then I do a element-wise product, flippin g the sign when I have a one in my PN code. From my tests I've taken a tone at 1MHz and applied the spreading code and I get a nice flat spectrum from DC to 2MHz (chiprate is 2MHz). Does this sound right to everyone? I'm seeing the sidelobes mentioned above, but they're 30dB down. Since this is only going to be used for testing, I'm not gonna worry too much about them.
Mark wrote:
>> What you _do_ with direct sequence spread spectrum is to generate a >> pseudo-random sequence of bits at a much higher rate than the bandwidth >> of your unspread signal, then modulate the signal with the bits. >> Usually this is done by transmitting the signal straight through on a >> '1' and inverting it's phase on a '0' (or visa versa), although you >> could cook up fancier schemes. >> >> > > I realize that was a simplified explination..., if you literally > switch from phase inversion to no phase inversion as described above, > you will create a very wide spectrum with many sidelobes. I think you > have to apply baseband filtering (i.e RRC) to the spreading sequence > just like you do for the data sequence in order to control the > sidelobes. > > Mark > >
Indeed. I was going to mention that, but I wanted to get the basics across first. You can, in fact, modulate your signal in just about any way that a PSK signal can modulate a carrier. As long as there is no inter-"symbol" interference (interchip interference?) you won't destroy any information. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
>Data: 1001 >Spreading code: 1101 > >Convert these quantities into a baseband representation for your >modulation scheme (I assume BPSK): > >BPSK symbols: 1 -1 -1 1 >Upsampled symbols: 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 >Spreading code symbols: 1 1 -1 1 > >Spread symbols: 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 > >The last line shows the 16 chips that now correspond to the 4 bits of >data. The chip rate is 4 times the bitrate. > >Jason >
Well my PN code is a 10 bit code, so I'd have to do a 1024X upsample? That doesn't seem right to me. That'd put me up in the multi-GSPS range. Can't you just upsample to 2X your chip rate and then elementwise multiple?
gct wrote:
>> Data: 1001 >> Spreading code: 1101 >> >> Convert these quantities into a baseband representation for your >> modulation scheme (I assume BPSK): >> >> BPSK symbols: 1 -1 -1 1 >> Upsampled symbols: 1 1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 >> Spreading code symbols: 1 1 -1 1 >> >> Spread symbols: 1 1 -1 1 -1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 >> >> The last line shows the 16 chips that now correspond to the 4 bits of >> data. The chip rate is 4 times the bitrate. >> >> Jason >> > > Well my PN code is a 10 bit code, so I'd have to do a 1024X upsample? > That doesn't seem right to me. That'd put me up in the multi-GSPS range. > Can't you just upsample to 2X your chip rate and then elementwise multiple?
You want to upsample to the point where you have significantly spread the spectrum of your signal, regardless of the length of your PN code. First, because that's how you're going to get the advantages of spread spectrum, and second, because unless you have a side channel you need a relatively narrow baseband signal for synchronization to work. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html