Resampler reduces quality a bit

Issue #34 resolved
Wohlstand created an issue

While listening VGM songs with YM2612 chip, I hearing that sound is smoothed which can be better recognized while listening FM-generated drums.

Here is my shitty attempt which fixes quality of VGM, but damages quality of SPC even more:

https://bitbucket.org/Wohlstand/game-music-emu/commits/branch/better-resampler

I have attached next files:

Comments (9)

  1. Michael Pyne repo owner

    Fir_Resampler has templated parameters to adjust quality of resampling, it would be possible to use different settings for VGM vs. SPC. VGM seems to use Dual_Resampler (which uses Fir_Resampler<12> behind the scenes), do you think it makes sense to try increasing the resampler width for VGM to fix audio quality instead?)

  2. Wohlstand Account Deactivated reporter

    I also have tried to increase this number, however, nothing is changing. Anyway, FM chips doesn’t needs resampling and their output should be passed non-distorted. This resampler does distorsion of sound by unnecessary smoothing.

  3. Michael Pyne repo owner

    resampler: Don't resample when sample rates are matched.

    The FIR resampler is always in use on some emulators (VGM in particular but also SPC). The resampler produces high quality output when we have to resample, but we don't always have to resample and in that situation it's better to avoid adding noise.

    This is a rework of a patch Wohlstand submitted [1] since it felt cleaner to me and doesn't rely on floating point arithmetic to be exact.

    This fixes #34. I can't even tell apart the "bad" and "good" quality samples though so if I've still got it wrong, please reopen.

    [1] https://bitbucket.org/Wohlstand/game-music-emu/commits/03d70998bbbb065231c8c70f58c62ccd24e6896a

    → <<cset 06b0125cb5fc>>

  4. Log in to comment