Project

General

Profile

Bug #4373 ยป compute_edge_ci.diff

pespin, 01/22/2020 01:29 PM

View differences:

Transceiver52M/Transceiver.cpp
668 668
  }
669 669

  
670 670
  type = (CorrType) rc;
671
  rxBurst = demodAnyBurst(*burst, mSPSRx, ebp.amp, ebp.toa, type, &ebp);
671 672
  bi->toa = ebp.toa;
672 673
  bi->tsc = ebp.tsc;
673 674
  bi->ci = ebp.ci;
674
  rxBurst = demodAnyBurst(*burst, mSPSRx, ebp.amp, ebp.toa, type);
675 675

  
676 676
  /* EDGE demodulator returns 444 (gSlotLen * 3) bits */
677 677
  if (rxBurst->size() == EDGE_BURST_NBITS) {
Transceiver52M/sigProcLib.cpp
1833 1833
  return bits;
1834 1834
}
1835 1835

  
1836
static float computeEdgeCI(const signalVector *rot)
1837
{
1838
  float err_pwr = 0.0f;
1839
  float step = 2.0f * M_PI_F / 8.0f;
1840

  
1841
  for (int i=8; i<rot->size()-8; i++) {
1842
    /* Compute the ideal symbol */
1843
    complex sym = (*rot)[i];
1844
    float phase = step * roundf(sym.arg() / step);
1845
    complex ideal = complex(cos(phase), sin(phase));
1846

  
1847
    /* Compute the error vector */
1848
    complex err = ideal - sym;
1849

  
1850
    /* Accumulate power */
1851
    err_pwr += err.norm2();
1852
  }
1853

  
1854
  return 3.0103f * log2f(1.0f * (rot->size() - 16) / err_pwr);
1855
}
1856

  
1836 1857
/*
1837 1858
 * Demodulate an 8-PSK burst. Prior to symbol rotation, operate at
1838 1859
 * 4 SPS (if activated) to minimize distortion through the fractional
......
1844 1865
 * nearly unrecoverable.
1845 1866
 */
1846 1867
static SoftVector *demodEdgeBurst(const signalVector &burst,
1847
                                  int sps, complex chan, float toa)
1868
                                  int sps, complex chan, float toa,
1869
                                  struct estim_burst_params *ebp)
1848 1870
{
1849 1871
  SoftVector *bits;
1850 1872
  signalVector *dec, *rot, *eq;
......
1856 1878
  /* Equalize and derotate */
1857 1879
  eq = convolve(dec, GSMPulse4->c0_inv, NULL, NO_DELAY);
1858 1880
  rot = derotateEdgeBurst(*eq, 1);
1881
  ebp->ci = computeEdgeCI(rot);
1859 1882

  
1860 1883
  /* Soft slice and normalize */
1861 1884
  bits = softSliceEdgeBurst(*rot);
......
1868 1891
}
1869 1892

  
1870 1893
SoftVector *demodAnyBurst(const signalVector &burst, int sps, complex amp,
1871
                          float toa, CorrType type)
1894
                          float toa, CorrType type,
1895
                          struct estim_burst_params *ebp)
1872 1896
{
1873 1897
  if (type == EDGE)
1874
    return demodEdgeBurst(burst, sps, amp, toa);
1898
    return demodEdgeBurst(burst, sps, amp, toa, ebp);
1875 1899
  else
1876 1900
    return demodGmskBurst(burst, sps, amp, toa);
1877 1901
}
Transceiver52M/sigProcLib.h
135 135

  
136 136
/** Demodulate burst basde on type and output soft bits */
137 137
SoftVector *demodAnyBurst(const signalVector &burst, int sps,
138
                          complex amp, float toa, CorrType type);
138
                          complex amp, float toa, CorrType type,
139
                          struct estim_burst_params *ebp);
139 140

  
140 141
#endif /* SIGPROCLIB_H */
    (1-1/1)
    Add picture from clipboard (Maximum size: 48.8 MB)