๐งต Spread spectrum with acoustics
Anonymous at Thu, 4 Jul 2024 00:47:49 UTC No. 16266953
I was fascinated by spread spectrum techniques recently and thought I would try implementing them with audio, using Python to transmit sound and record it.
The pic shows the result of transmitting/recording 3 consecutive identical chirps that sweep from 4-8kHz in 1s, and convolving the recorded data with that of a single chirp. 4-8kHz was chosen because my speaker-to-mic system has relatively good/even gain over this range. The chirp waveforms are clearly visible in the recorded data, so I would expect the convolution to contain 3 delta functions but as you can see it's garbage.
I've tried direct sequence as well as some other schemes, but the results are always terrible. Direct sequence was produced by generating a random sequence of bits and then replacing each "0" in the sequence with a 4kHz sine wave lasting T seconds and each "1" with an 8kHz sine wave lasting T seconds. This also produces terrible results.
I've tried some other schemes but basically I'm wondering if anyone has tried implementing or knows anything about spread spectrum techniques. There is some literature I've found on the subject, but I'm just starting to dive into it, e.g. https://instrepo-prod7.cc.uregina.c
Anonymous at Thu, 4 Jul 2024 03:18:46 UTC No. 16267095
I see I need to be using something like Gold Codes. I would like to get to the point where I can test bit error and demonstrate Shannon's theorem.
Anonymous at Thu, 4 Jul 2024 03:29:45 UTC No. 16267115
One thing I've noticed is that for RF the ratio of bandwidth to center frequency is very small, whereas for me it is ~0.5. I assume that's significant but I'm not sure how.
Anonymous at Fri, 5 Jul 2024 01:15:05 UTC No. 16268304
The gist of direct sequence spread spectrum (DSSS) is that when you are transmitting your signal, you cross correlate it with a code. On the receiving end, you do a cross correlation of the received signal with the same code to recover the transmitted signal. It is similar to the first year CS exercise of XORing with a binary password and doing the XOR again to recover a message.
There are many different sets of codes (e.g Gold codes). They have special properties - and important one is that the codes are orthogonal to one another. This is so that your code only de-spreads your message, and not other people's spread messages. This is the basis of code division multiple access (CDMA), which allows many users to transmit and receive in the same band of frequencies and in the same block of time. CDMA allows multiplexing in both time and frequency.
Codes are generated using math. They have unique properties. A good place to start learning is Primitive Primes and Galois Fields.
Anonymous at Fri, 5 Jul 2024 01:18:20 UTC No. 16268306
Here is what you should try to start. Let the transmitted message (before spreading) be a 1 second linear upchirp. Then before transmitting, cross correlate it with a gold code.