MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".
29 Oct 2012
25 Nov 2013)
These files are the MatLab solutions of exercises contained in the above DSP lab textbook.
function y = fraction_sample(x,h,M,N)
% Fractional Sampling Rate Conversion function by a factor of M/N.
% x : this is a vector containing the input sequence to be fractionaly sampled .
% h : this is the lowpass filter with gain M and cutoff frequency pi/max(M,N) rad.
% The filter kernel h is assumed to be designed externally to meet those specs.
% M : Upsampling factor.
% N : Downsampling factor.
% First upsample x[n] by a factor of M.
r = my_upsample(x,M);
s = conv(h,r); % Filter the sequence r[n] using the given low-pass filter h.
% Finally, downsample by a factor of N:
y = my_downsample(s,N);