I'm testing a 4-fold up/downsampler based on FIR filters, for alias-reduced non-linear effects, and sharing my preliminary results in axoloti-contrib/patches/jt/devel/updownsampler_x4.axp
I'm using 16-tap filters for both up- and downsampling. The coefficients are generated with Scilab:
fs = 48000;
overx = 4;
fcut = 15000;
order = 16;
// for upsampling: equiripple
hn_up=eqfir(order,[0 fcut/fs/overx;0.49/overx 0.5],[1 0],[1 8]);
// for downsampling: attenuate aliases harder that we are most sensitive for
hn_down1=eqfir(order-3,[0 fcut/fs/overx;0.47/overx 0.5],[1 0],[1 1.5]);
hn_down = conv(hn_down1,{.25 .25 .25 .25});
(and further scaled/rounded to 16 bit coefficients for use with the dual-MAC instructions...)
Filter responses:
(upsampling in black, downsampling in blue)
The motivation for using a different filter than equiripple is that aliases showing up at low frequencies are far more disturbing than aliases above 10kHz, those are likely psychoacoustically masked by other frequencies.
The advantage is more evident on a reprojected frequency plot:
There should be a better way to compute coefficients, probably using a rough equal loudness contour function as error weights in remez()...
Feedback/suggestions welcome before I re-assemble the test-patch into library objects...
(cross-references to related topics:)