Wideband autonomous SDR analysis engine forked from sdr-visual-suite
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

26 satır
604B

  1. //go:build cufft
  2. package gpudemod
  3. import (
  4. "math/cmplx"
  5. "sdr-visual-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. }