%% dftdemo1
%% show a signal and dft pair

% define signal, sample rate, sample domain
N = 128;
t = (0:1:(N-1))/N;
I = sqrt(-1);
sig = 2*cos(5*2*pi*t)+0.5*sin(24*2*pi*t);
%k = 96; sig = [ones(1,k),zeros(1,N-k)]*(N/k);
%sig = rand(1,N);
%sig = 2*rand(1,N)-1;
SD = 0:(N-1);

% get dct and frequency domain
csig = dct(sig); 
FD = (0:(N-1))/2;

% display results 
figure(1)
subplot(2,1,1)
plot(SD, sig,'k-')
title('sampled signal');
axis tight
subplot(2,1,2)
plot(FD, csig,'k-')
title('DCT of signal')
axis tight


