DFT

bins

% sampling and windowing

global_decl;

platform('octave'); %put either 'octave' or 'matlab'

a = - 10.0; b = 100;

s0 = a + i * b;

t = [0:0.001:1];

y = exp(s0*t); % complex exponential

subplot(2,2,1);

title('Exponentially-decayed sinusoid');

xlabel('t [s]'); ylabel('y');

eval(myreplot);

pause;

f = [0:0.1:100];

Y = 1 ./ (i * 2 * pi * f - s0*ones(size(f)));

title('Frequency response of a damped sinusoid');

xlabel('f [Hz]'); ylabel('|Y| [dB]');

hold on;

Fs = 50;

Ysamp = 1 ./ (1 - exp(s0/Fs) * exp(- i*2*pi*f/Fs)) / Fs;

n = [0:6];

y = exp(s0*n/Fs);

Ysampw = y * exp(-i*2*pi/Fs*n'*f) / Fs;

% obtained by vector-matrix multiply

rectangular window. The frequency sampling points (called bins) are equally

spaced between 0 and F

elements of two N -component vectors y and Y related by