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 = decimator(x,h,K)
% This function performs decimation on the input signal x[n]
% by a factor K, using the low-pass filter h.
% x is a row vector containing the signal to be interpolated.
% h is a row vector containing the low-pass filter to be used
% for decimation (designed externally with Gain = 1 and cutoff freq.= pi/K).
% K is the decimation factor.
% First, pass the input signal xdn through the low-pass filter h:
x1 = conv(x,h);
% Next, downsample the input signal x[n] by a factor K:
y = my_downsample(x1,K);