DSPRelated.com
Forums

I'm going to use that module for detecting range, velocity and angle, for that radar.https://www.innosent.de/fileadmin/media/dokumente/datasheets/180222_Datenblatt_IVQ-3005.pdf

So I have read a lot of radar techniques and I'm going to use the mode FMCW, and the modulated signal will be a sawtooth (chirps).

I have 4 signals I1, Q1, I2, Q2.

I need to confirm my understanding of the signal processing algorithms



I wrote a basic algorithm, hope that's correct

/* FFT length must be a power of 2 */
    #define FFT_LENGTH 16
    #define M 4            /* must be log2(FFT_LENGTH) */
    #define ECHO_SIZE 12

    void main()
    {
      int            i,j,k;
      float          tempflt,rin,iin,p1,p2;
      static float   mag[FFT_LENGTH];
      static COMPLEX echos[ECHO_SIZE][FFT_LENGTH];
      static COMPLEX last_echo[ECHO_SIZE];

    /* read in the first echo */
      for(i = 0 ; i < ECHO_SIZE ; i++) {
         last_echo[i].real = getinput();
         last_echo[i].imag = getinput();
      }

 // Read in the Second channgel
// Add first channel I/Q to second channel.


      for(;;) {
        for (j=0; j< FFT_LENGTH; j++){

    /* remove stationary targets by subtracting pairs (highpass filter) */
          for (k=0; k< ECHO_SIZE; k++){
            rin = getinput();
            iin = getinput();
            echos[k][j].real = rin - last_echo[k].real;
            echos[k][j].imag = iin - last_echo[k].imag;
            last_echo[k].real = rin;
            last_echo[k].imag = iin;
          }
        }
    /* do FFTs on each range sample */
        for (k=0; k< ECHO_SIZE; k++) {

          fft(echos[k],M);

          for(j = 0 ; j < FFT_LENGTH ; j++) {
            tempflt  = echos[k][j].real * echos[k][j].real;
            tempflt += echos[k][j].imag * echos[k][j].imag;
            mag[j] = tempflt;
          }
    /* find the biggest magnitude spectral bin and output */
          tempflt = mag[0];
          i=0;
          for(j = 1 ; j < FFT_LENGTH ; j++) {
            if(mag[j] > tempflt) {
              tempflt = mag[j];
              i=j;
            }
          }
    /* interpolate the peak loacation */
          p1 = mag[i] - mag[i-1];
          p2 = mag[i] - mag[i+1];
          sendout((float)i + (p1-p2)/(2*(p1+p2+1e-30)));
        }
      }
    }


rn4ah_48747.png