I am currently working on a project on MATLAB, and I need to use interpolation and decimation on various low pass, band pass and high pass filters with sampling frequencies of 10kHz. There was no problem with interpolating my LP and BP filters. But trying to interpolate a HP filter by a factor of 4 gave me a resulting filter whose response is similar to that of a band pass filter. The figures below show my filters' response by using the freqz(.) command.
I used an anti-imaging filter in the form of an 8th order Chebyshev Type I filter, but I feel like I need to use another type of filter. But I don't know what to do. My code pieces are as following.
function [interp, y] = Interpolation(x, L)
len = length(x);
y = zeros(1,len*L);
y((0:len-1)*L+1) = x; % Spreading the values of x
[n, d] = cheby1(8, 0.5, 1/L); % Anti-imaging filter
interp = filter(n, d, y);
end
Code to run in the command window:
[int, y] = Interpolation(fltH, 4);
freqz(y, 1, 512)
figure
freqz(fltH, 1, 512)
Any help is appreciated.