# upsample impulse response

I have a system and I know its impulse response $$h$$, this impulse response was recorded at $$f_s = 48000 \texttt{Hz}$$, now I can use Matlab to get the system output to an arbitrary signal ($$x$$) by convolving it with $$h$$, right?

So now I want to use an input signal that its at a higher frequency [$$3.072 \texttt{MHz}$$ (factor $$64$$)] but want to use the same IR, I was hopping to just upsample the IR, either by zero padding or by interpolating the $$63$$ spaces between coefficients, but the output was not matching, using Matlab I got the frequency response of the Impulse response, in blue the original sampled at $$48 \texttt{KHz}$$, the red one is the upsampled one, yellow the interpolated.

They kind of match, but there are several gaps in the plot, is this even doable? This is my Matlab code (top_ir is the impulse response of the system):

[h, w] = freqz(top_ir,1,[],48000);
plot(w,20*log10(abs(h)));
top_ir_3m = upsample(top_ir, 64);
[h, w] = freqz(top_ir_3m,1,[],48000*64);
plot(w,20*log10(abs(h)));
top_ir_3m = interp(top_ir, 64);
[h, w] = freqz(top_ir_3m,1,[],48000*64);
plot(w,20*log10(abs(h)));


EDIT (adding info): I understand that the original IR only contains information up to 24kHz, that is fine, we are actually going to lowpass filter everything up to 24kHz.

• We need slightly more information: Do you want to use this impulse response with the same absolute frequency characteristics? that is, I see max gain is at about $8 \texttt{Khz}$ . Do you want max gain to be at $8\texttt{Khz}$ in your "new" impulse response as well? Or do you want it at $8\cdot 64=512\texttt{Khz}$ ? In the first case interpolating is fine. In the second, you can just apply your filter as is...
– Jdip
Commented Aug 30, 2023 at 8:24
• @JdipL correct. Brain freeze on my part, too early in the morning :-) Commented Aug 30, 2023 at 8:40
• MATLAB has a resample() function that you can use to interpolate between samples of your original impulse response. Commented Aug 30, 2023 at 17:39

After some testing I found out that Matlab caps the frequency response result, changing the taps for the freqz to the length of the coefficients give the actual result, upsampling does generate a usable impulse response, to use an interpolated impulse response, you just need to divide the coefficients by the oversample rate