Code covered by the BSD License  

Highlights from
MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

image thumbnail

MatLab Solutions: "Introduction to Digital Signal Processing: A Computer Laboratory Textbook".

by

 

29 Oct 2012 (Updated )

These files are the MatLab solutions of exercises contained in the above DSP lab textbook.

decimator(x,h,K)
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.
% Inputs: 
%              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);

Contact us