In MATLAB, there is a d2d function which resample the biquad filter directly.
Does anyone know how the d2d function works?
or the method to resample directly biquad filters?
Thank you for reading my question.
Is it that you have some coefficients for lets say 44.1kHz filter but you don't know how they are calculated? If situation is this and those coefficients are calculated using standard methods then, this should work (Octave/Matlab code):
function [b, a] = BiquadCoefficientConverter(b, a, inFS, outFS)
% inFS = original sample rate % outFS = target sample rate
Thank you. I will try this.
If you want to know/see/understand the algorithms (there are two options, ZOH and Tustin) involved in detail, you can always step thru the source code. I'm assuming of course that since you referenced the d2d function, you have access to the code. The core of the conversation algorithm is here:
But, you can always just set a breakpoint at the call site of d2d and continue to "step-in" until you hit the crux of the algorithm. It's about 15 lines and easy to read, written back in the mid 80's.
Is every code available?
I didn't know that MATLAP provides source codes.