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 X = my_DHT2(x,time_ind)
% This function calculates the Discrete Hartley Transform of a real
% sequence. In addition to the input signal x[n], this function takes
% as an input the time indices as well.
% Attention: length(x) must be odd for this to work properly.
% Note that time indices are common to frequency indices for the DHT.
N = length(x);
freq_ind = time_ind;
Half_Time_Size = (time_ind(end)-time_ind(1))/2;
Half_Freq_Size = Half_Time_Size;
X = zeros(1,N);
X(k+Half_Freq_Size+1) = X(k+Half_Freq_Size+1) + ...
x(n+Half_Time_Size+1)*(cos(2*pi*n*k/N) + sin(2*pi*n*k/N));