Wideband autonomous SDR analysis engine forked from sdr-visual-suite
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

26 行
661B

  1. //go:build cufft
  2. package gpudemod
  3. import (
  4. "testing"
  5. "sdr-wideband-suite/internal/dsp"
  6. )
  7. func TestValidateFreqShiftRejectsMismatchedLength(t *testing.T) {
  8. iq := []complex64{1 + 0i, 0 + 1i}
  9. shifted := []complex64{1 + 0i}
  10. if ValidateFreqShift(iq, 2048000, 12500, shifted, 1e-3) {
  11. t.Fatal("expected mismatched lengths to fail validation")
  12. }
  13. }
  14. func TestValidateFreqShiftAcceptsCPUReference(t *testing.T) {
  15. iq := []complex64{1 + 0i, 0.5 + 0.25i, -0.25 + 0.75i, 0.1 - 0.3i}
  16. shifted := dsp.FreqShift(iq, 2048000, 256000)
  17. if !ValidateFreqShift(iq, 2048000, 256000, shifted, 1e-6) {
  18. t.Fatal("expected CPU reference shifted IQ to pass validation")
  19. }
  20. }