From f2858ac8656c22e8d300cba42883bf3008206c1c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 13 May 2022 10:12:28 -0700 Subject: Resample before frequency analysis We want to resample before minimum phase reconstruction since that changes the phase relationship of the sampled signal, introducing a slight bit of noise from truncated sampling. It's not clear that the frequency domain resampling method is accurate, so resampling prior to frequency analysis is an alternative to ensure the resulting frequencies are given the proper phase for sampling. This also cleans up some micro allocations in loops. --- common/polyphase_resampler.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/polyphase_resampler.h') diff --git a/common/polyphase_resampler.h b/common/polyphase_resampler.h index e9833d12..0b343d5a 100644 --- a/common/polyphase_resampler.h +++ b/common/polyphase_resampler.h @@ -4,6 +4,8 @@ #include +using uint = unsigned int; + /* This is a polyphase sinc-filtered resampler. It is built for very high * quality results, rather than real-time performance. * @@ -32,8 +34,6 @@ */ struct PPhaseResampler { - using uint = unsigned int; - void init(const uint srcRate, const uint dstRate); void process(const uint inN, const double *in, const uint outN, double *out); -- cgit v1.2.3