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.

hartley.m
% Relation of Hartley Transform with DFT:

clc; clear; close all;

x = randn(1,128);

Fx = fft(x);

Hx = real(Fx) - imag(Fx);

ReFx =  (Hx + circshift(fliplr(Hx),[0 1]))/2;
ImFx  = -(Hx  - circshift(fliplr(Hx),[0 1]))/2;

figure();
subplot(1,2,1);
%stem(real(Fx) - ReFx)
hold on;
stem(real(Fx));
hold on;
stem(ReFx,'g.');
grid on;

subplot(1,2,2);
% stem(imag(Fx) - ImFx)
hold on;
stem(imag(Fx));
hold on;
stem(ImFx,'g.');
grid on;

Contact us