Wideband autonomous SDR analysis engine forked from sdr-visual-suite
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

26 рядки
606B

  1. //go:build cufft
  2. package gpudemod
  3. import (
  4. "math/cmplx"
  5. "sdr-wideband-suite/internal/dsp"
  6. )
  7. // ValidateFreqShift compares a candidate shifted IQ stream against the CPU DSP
  8. // reference. This is intended for bring-up while the first real CUDA launch path
  9. // is being wired in.
  10. func ValidateFreqShift(iq []complex64, sampleRate int, offsetHz float64, shifted []complex64, tol float64) bool {
  11. if len(iq) != len(shifted) {
  12. return false
  13. }
  14. ref := dsp.FreqShift(iq, sampleRate, offsetHz)
  15. for i := range ref {
  16. if cmplx.Abs(complex128(ref[i]-shifted[i])) > tol {
  17. return false
  18. }
  19. }
  20. return true
  21. }