DSSS encoding/ decoding

Hello,

I am trying to implement DSSS encoding/ decoding in Julia.

Any hints how to start?

Encoding:

  • input: low frequent signal
  • input: digital secret sequence
  • filter: bandwidth filter
  • output: analog (sampled) spread spectrum signal

Decoding:

  • input: analog (sampled) spread spectrum signal
  • input: digital secret sequence
  • output: low frequent signal

Questions:

  • how can I generate the spreading sequence?
  • how can I implement the coding?
  • how can I implement the decoding?

See: Direct-sequence spread spectrum - Wikipedia

Some closed source Matlab code: Direct Sequence Spread Spectrum(DS SS) - File Exchange - MATLAB Central

Some open source Matlab code: GitHub - mahmut-aksakalli/DirectSequenceSpreadSpectrum: it contains MATLAB simulation of Direct Sequence Spread Spectrum technique.

Here’s a quick approximation, using CommunicationsSequences.jl to generate the spreading sequence.

using CommunicationsSequences

# 7-bit spreading sequence
l = LFSR(lfsrtaps[3], mapping = (1, -1))
seq = first(l, 7)

# 10 data bits to be transmitted
tx_data = rand((0,1),10)

# generate DSSS sequence
dsss = Int[]
for i in 1:10
    if tx_data[i] == 1
        append!(dsss, seq)
    else
        append!(dsss, -seq)
    end
end

# recover bits from DSSS sequence
rx = reshape(dsss, 7, 10) # one bit per column
rx_data = Int[]
for i in 1:10
    if sum(rx[:,i] .* seq) > 0
        append!(rx_data, 1)
    else
        append!(rx_data, 0)
    end
end

# verify
tx_data .== rx_data

You also mentioned generating an analog sampled spread spectrum signal. How to do this depends on the details: are you using pulse shaping? Adding noise? Matched filtering?

1 Like