Skip to content

Instantly share code, notes, and snippets.

@cyanreg
Created March 13, 2021 19:27
Show Gist options
  • Save cyanreg/cc0ff5a6387aad49c6523e66f200c877 to your computer and use it in GitHub Desktop.
Save cyanreg/cc0ff5a6387aad49c6523e66f200c877 to your computer and use it in GitHub Desktop.
Forward QMF
void forward_qmf(float *out_low, float *out_high, float *delay, const float *in,
int samples, int delay_samples)
{
memcpy(delay, delay + samples, delay_samples * sizeof(float));
memcpy(delay + delay_samples, in, samples * sizeof(float));
for (int i = 0; i < samples; i += 2) {
float low = 0.0f, high = 0.0f;
/* Can be done via float_dsp */
for (int j = 0; j < (delay_samples + 2); j += 2) {
low += qmf_window[j + 0] * in[i - j + 47];
high += qmf_window[j + 1] * in[i - j + 46];
}
out_low [i >> 1] = low + high;
out_high[i >> 1] = low - high;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment