Author Topic: Chirps, down-chirps and quadrature signals  (Read 1045 times)

0 Members and 1 Guest are viewing this topic.

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: us
Chirps, down-chirps and quadrature signals
« on: October 03, 2024, 06:30:34 pm »
I'm struggling a bit to understand some LoRa details based on: https://www.youtube.com/watch?v=jHWepP1ZWTk.

Specifically:
  • LoRa encodes each symbol as a complex up-chirp with varying start frequency (it starts and rolls-over at different F for different symbols)
  • The first step in receiving the signal is called "de-chirping" by multiplying the incoming signal by a complex conjugate; supposedly the conjugate of a up-chirp is a down-chirp, this is called the "base down-chirp"
  • The output of the de-chirped signal is a single frequency tone, that corresponds with the original symbol (i.e. the start frequency of the symbol down-chirp); assuming no noise and perfect mixing

All that makes some amount of intuitive sense, however when I get into the Matlab script presented in the video and the math, the main confusing thing that emerges to me is:
*both* the symbol (up-chirp) and the basis down-chirp's real and complex time-domain waveforms look similar: they start at a low frequency, ramp up, and then down. If I were to plot it as a frequency plot, they would both look like a up-down chirp, with minor phase differences due to the complex part of one of them being inverted. So, what gives? The de-chirping process was always shown as some kind of multiplication by a opposing direction chirp, but intuitively that doesn't seem to make sense to me, and the Matlab code doesn't seem to agree with that interpretation either.
 

Offline Marsupilami

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Chirps, down-chirps and quadrature signals
« Reply #1 on: October 04, 2024, 01:09:20 pm »
I’m not familiar with LoRa at all, but what you (and the video) might be missing is that complex signals can have negative frequencies. When the signal is on a modulated carrier the up chirp is rising in frequency from below the carrier to above, while the downchirp is falling from above the carrier to below. (Assuming the carrier is at the center of the chirp) However in complex baseband both look the same. This is because the difference between a positive and a negative frequency is encoded in the relative phase of the I and Q components. Depending on whether I leads or lags 90degrees to Q the complex quantity represents a positive or negative frequency.
You should be able to see this when looking at both I and Q of the chirps.

HTH
 
The following users thanked this post: uer166

Offline Marsupilami

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Chirps, down-chirps and quadrature signals
« Reply #2 on: October 04, 2024, 01:14:16 pm »
Oh and I forgot:
The reason why the complex conjugate turns an upchirp into a downchirp is that when you negate the Q (imaginary) component of the signal you effectively flip the +90 relative phase to the I component to -90 degrees, thus turning a positive frequency into negative.
 
The following users thanked this post: uer166

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: us
Re: Chirps, down-chirps and quadrature signals
« Reply #3 on: October 04, 2024, 08:58:06 pm »
I’m not familiar with LoRa at all, but what you (and the video) might be missing is that complex signals can have negative frequencies. When the signal is on a modulated carrier the up chirp is rising in frequency from below the carrier to above, while the downchirp is falling from above the carrier to below. (Assuming the carrier is at the center of the chirp) However in complex baseband both look the same. This is because the difference between a positive and a negative frequency is encoded in the relative phase of the I and Q components. Depending on whether I leads or lags 90degrees to Q the complex quantity represents a positive or negative frequency.
You should be able to see this when looking at both I and Q of the chirps.

HTH

Ah, so the lora symbol and base down-chirp are only a up and down-chirp respectively in up-converted RF, but I am looking at I/Q only. I'll try some experiments mixing up the I/Q signals to RF with 2 mixers and a 90-deg phase shift of LO on one of them to see if that does it (in Matlab).
« Last Edit: October 04, 2024, 09:04:18 pm by uer166 »
 

Offline Marsupilami

  • Frequent Contributor
  • **
  • Posts: 278
  • Country: us
Re: Chirps, down-chirps and quadrature signals
« Reply #4 on: October 04, 2024, 11:48:40 pm »
Yep, if you're centered around DC (baseband) you can't tell by frequency alone if it's up or down.


 
The following users thanked this post: uer166

Offline uer166Topic starter

  • Super Contributor
  • ***
  • Posts: 1001
  • Country: us
Re: Chirps, down-chirps and quadrature signals
« Reply #5 on: October 09, 2024, 11:24:31 pm »
Ah I'm 98% sure I get it now. There's a myriad of confusion when it comes to FFT to me in Octave/Matlab:

  • The off-by-one FFT output bin error due to Matlab having 1 as a start index. Unless you look closely all frequency bins might be shifted by 1
  • The first half of the FFT output array is the real part, second part is the imaginary. To get it back to the "normal" way with zero being in the center, and negative frequencies in left, have to use fftshift to move it back to center. Really dumb convention.
  • Simply mixing signals by multiplying creates both sum and difference of input frequencies, so it looks like a mess in time domain (nothing like your pretty +-5Hz/10Hz graphs). This is a duh moment, however with all the other stuff going on it got lost.
  • When shifting up/down the frequencies need to be spread apart enough to filter out the sideband; After that the time domain part should look as expected..
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf