1
$\begingroup$

I am using a Radar Sensor. So applying Signal Processing on the Radar Sensor Data. PrevSample and PastSample are Radar IQ samples for a present and previous Sweep detecting tiny movement. In the source code I have some doubts that . Here I am adding the portion of Python Code . Can anyone please explain the following signal processing, and the significance of that, please describe what each term indicate

import numpy as np

Envelope   = np.abs(PresentSample)
Delta = PresentSample * np.conj(PreviousSample)
PhaseWeights = np.imag(Delta)
Weights = np.abs(PhaseWeights) * Envelope
DeltaDist = np.dot(Weights, np.angle(Delta))
DeltaDist *= 2.5 / (2.0 * pi * sum(Weights))

Present and prev samples are 1D array consisting of iq samples. For each processing . Is Delta is cross correlation ? Please give explanation for rest of the codes Why multiply the DetltaDist ?

DeltaDist is the tiny movement, which is used to store in a Buffer. I am asking the signal processing logic of this code/algorithm. I know the code and the functions conj, imag, etc... I just want to know for example why we take conjugate product/ why we take imaginary part like that

$\endgroup$
5
  • 1
    $\begingroup$ do you know what the result DeltaDist is used for. We can tell you what each of these operations are (but honestly, conj, imag, abs and angle are all well-documented and also self-explanatory, so not quite sure what the value for you would be; also, askiung about that many things, it's a bit broad), but we can't tell you what they're for without understanding the application here. What kind of signals are in the IQ signal? What is the thing your system does, overall? $\endgroup$ Aug 2, 2022 at 10:10
  • $\begingroup$ but: no. Delta is not cross-correlation; it's the conjugate product of PresentSampleand PreviousSample. $\endgroup$ Aug 2, 2022 at 10:11
  • 1
    $\begingroup$ Sorry I dont understand the problem and this community is not here to explain you the code you found somewhere which you are trying to use. You dont tell us where your doubts are and what you would expect from the code? Neither you dont tell us whether the results are fulfilling the expectation. I would not consider this question to be in the scope of DSP.SE. $\endgroup$ Aug 2, 2022 at 10:50
  • $\begingroup$ Welcome to SE.SP! As others have said, please give us more information about what you are trying to achieve with the code. Also, please include code that has all the included and used libraries. For example, your code should probably have import numpy as np. Please edit your question with this extra information. $\endgroup$
    – Peter K.
    Aug 2, 2022 at 11:58
  • $\begingroup$ Ok. I am using a Radar Sensor. So applying Signal Processing on the Radar Sensor Data. PrevSample and PastSample are Radar IQ samples for a Sweep. DeltaDist is the tiny movement, which is used in a Buffer. I am asking the signal processing logic of this code. I know the code and the functions conj, imag, etc... I just want to know for example why we take conjugate product/ why we take imaginary part $\endgroup$
    – Rohith R
    Aug 2, 2022 at 12:46

1 Answer 1

1
$\begingroup$

It's not clear what your code is doing, but my understanding is:

Delta = PresentSample * np.conj(PreviousSample)

gets the difference between the previous sample and the present one. This might look like:

$$ \Delta = e^{j\omega n} \cdot e^{-j\omega (n-1)} = e^{j \omega} $$

provided the signal you're interested in is like a complex exponential signal.

Then

PhaseWeights = np.imag(Delta)

is taking the imaginary part of

$$ e^{j\omega} = \cos(\omega) + j\sin(\omega). $$

If $\omega$ is small enough, then $$ \Im (\Delta) = \sin(\omega) \approx \omega $$ because $\sin(x) \approx x$ for small $x$.

It's not clear to me why this is a good thing.

$\endgroup$
1
  • 1
    $\begingroup$ yeah, I'm just as confused about the taking of the imaginary part as "importance" of anything. This would make (some) sense for say, BPSK lying on the imaginary axis, but not for a radar signal. Rohith really needs to define in more detail what "radar signal" they're actually considering. $\endgroup$ Aug 2, 2022 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.