Files
soothe2-re/dsp/fft_stage.cpp
T
Matiq b1b4f2bdf7 roadmap: detector decrypted in soothe_mem.bin, SNR 19.8dB; integrate twiddle loader
- fft.cpp: build_twiddle via soothe::twiddle_load (Cody-Waite sin/cos); drop dup init_plan
- fft_stage.cpp: cplx_mul/stage_complex/stage_double kernels -> phase fixed (corr +0.995)
- detect.cpp: level-dependent regional floor (no bell-boost), mask 10^(-1.041*depth*floor/20)
- burst500 metrics: ref -26.07 / ours -26.13 dBFS, corr 0.99475, SNR 19.80 dB, diff -0.065 dB
- KEY: FUN_180535880/536f90 bodies are decrypted real SSE in soothe_mem.bin; dispatch
  table 0x182616008[0]=idx=4 -> 0x180009860 -> FUN_180040d40; region 0x18004xxxx = full
  detector algorithm, absent from prior fun_map/decomp (Ghidra ran on encrypted file)
2026-08-17 20:02:32 +03:00

37 lines
1.2 KiB
C++

#include "fft_stage.hpp"
#include <cstring>
namespace fft_stage {
// cplx_mul — complex elementwise multiply: out = in1 * in2 (conjugated 2nd)
void cplx_mul(double* out, const double* in1, const double* in2, uint32_t n) {
for (uint32_t i = 0; i < n * 2; i += 2) {
double re1 = in1[i + 0];
double im1 = in1[i + 1];
double re2 = in2[i + 0];
double im2 = in2[i + 1];
out[i + 0] = re1 * re2 - im1 * im2;
out[i + 1] = re1 * im2 + im1 * re2;
}
}
// stage_complex — reformat: read interleaved complex [re,im][n], write [re][n],[im][n]
void stage_complex(double* out, const double* in, const double* tw, uint32_t n) {
for (uint32_t i = 0; i < n; i++) {
double re1 = in[i * 2 + 0];
double im1 = in[i * 2 + 1];
double re2 = tw[i * 2 + 0];
double im2 = tw[i * 2 + 1];
out[i * 2 + 0] = re1 * re2 - im1 * im2;
out[i * 2 + 1] = re1 * im2 + im1 * re2;
}
}
// stage_double — scalar multiply (FUN_180008500): out[i] = in[i] * tw[i]
void stage_double(double* out, const double* in, const double* tw, uint32_t n) {
for (uint32_t i = 0; i < n; i++) {
out[i] = in[i] * tw[i];
}
}
}