% kT/C noise spectrum

N = 1000;
fs = 1;
f = linspace(0, 0.5, N) * fs;

c = [ 'b'; 'r'; 'c'; 'm' ];
a = [ 1; 3 ];
for i=1:length(a)
    ai = a(i);
    Syy = 1/fs * (1-exp(-2*ai)) ./ (1 - 2*exp(-ai)*cos(2*pi*f/fs) + exp(-2*ai));
    plot(f, 10*log10(Syy), c(i));
    hold on;
    integral = sum(Syy)/N
end

xlabel('Normalized Frequency   f/f_s');
ylabel('Normalized Noise Density S(f)/(2kT/C)');
fixfig;
legend('T/\tau = 1', 'T/\tau = 3');
grid on;
hold off;