Bregalad wrote:
main volume and echo volume are controllable separately in the SPC700.
Yeah, but that's
main volume, not channel volume, unless the manual is wrong (or I've misunderstood something). So you can't have any direct signal from the other channels either.
I like the inverted playback idea. It burns an extra channel, but the other six are still available for dry sounds if you want them.
Quote:
I'm thinking that if you cutoff the lower bits of the echo buffer, to maybe 6bits, the sound quality might resemble the original unfiltered sound.
Quote:
you can build a filter that can do some kinda high-frequency boost with the echo FIR.
Quote:
That sounds like a good approach if you don't plan to use echo functionality at all, but in my honnest opinion it is a huge sacrifice just to get better trebble.
Is this for on-chip synthesis of BRR samples? If you're using prepared samples, I don't see why you couldn't just apply a treble boost filter before the conversion to BRR.
If my calculations are correct, the
effect of the gaussian interpolator on the spectrum is constant when normalized to the input sample rate (leaving aside special behaviour near the output Nyquist*). This means that in principle you can exactly counter it, at least in the frequency domain, by convolving all your samples with a single boost filter in the sample domain. (This is kinda hard to explain; I don't know if I'm doing a good job. What I mean is that if the FIR for the boost filter is treated as being at the same sample rate as the input sample, such that the convolution is done 1:1 with no interpolation, it will work right
regardless of the frequency the DSP plays back the sample at.)
The flip side of this is that if you're playing back samples at various rates, a single FIR filter on the 32 kHz output (as suggested with the echo trick) will
NOT properly correct for the gaussian interpolator... similarly, software resampling (as suggested
here) of a prefiltered sample will mess up the frequency correspondence between the prefilter and the interpolator and it will sound wrong; you'd have to do the filtering live in software for each sample rate (or exploit the echo buffer to do it for you**) rather than baking it in beforehand.
...
BRRTools has an optional FIR filter that attempts to correct for the gaussian rolloff, but it falls a bit short, partly because it's optimized for speed rather than accuracy and partly because it targets the 32 kHz case specifically rather than the general case.
I prepared a filter using PLParEQ3 that looks like it tracks the general case well, and took a 24-bit impulse response of it. It's labeled "16 kHz", and the sample rate is 16 kHz, but it should work fine if you convolve it with your audio data sample-by-sample (ie: treat both of them as being at the same sample rate) in Matlab or numpy or something, and don't reinterpolate your audio afterwards. (I don't really trust audio convolution plugins like SIR; I've heard they tend to take shortcuts.) Due to the length of the filter, you'll want to trim the result before converting it to BRR... oh, and watch the gain; I attenuated the impulse somewhat, but I can't guarantee it will never clip...
The "32 kHz" version is only for 32 kHz, and doesn't account for the analog filter (see footnote), so I wouldn't bother with it.
Attachment:
gpre_ir_v2.7z [19.94 KiB]
Downloaded 76 times
Has anyone tried my filter? I've posted it before and got nothing but download stats as feedback. Any comments? Does it work properly on miscellaneous material? Should I dust off my signal processing training and try to come up with a shorter one that does the same thing? (The latest "16 kHz" filter is especially long, I imagine partly because I had to use two instances of PLParEQ3 - it does 2x oversampling internally, and the resampling filter is very accurate...)
*
There is a bit of a spike, or rather a reduction in gain reduction, at the Nyquist for 32 kHz (ie: 16 kHz in the output spectrum), but I'm pretty sure the analog filter on the output produces at least as strong an effect in the other direction, so I don't think there's a need to take it into account when preparing samples.**
It seems to me that if you decompressed the sample and stuck it in the echo buffer, and set echo volume to zero, you could get the DSP to filter the sample for you, and then pick it up and re-encode to BRR. Playing it back at 32 kHz (with a phase-inverted version playing without echo, or main volume at zero, to prevent the user from hearing anything) would accomplish much the same thing, but the filter would have to be much more drastic and artifacting would probably be much worse.