%% Example 6.9
% Calculation of the discrete Chebyshev coefficients


%% Initialization

close all;
clear N j X u U


N = 8;
j = [N:-1:0]';
X = cos(j*pi/N);

%% Coefficients of x^4

dct1(X.^4)


%% u(x) = 4*(x²-x^4)*e(-x²/2)

u = @(x) 4*(x.^2).*(1 - x.^2).*exp(-x/2);
U = u(X);

plot([0:N],abs(dct1(U)),'k-o','LineWidth',2);
xlabel('n'); ylabel('|a_n|');
grid on;
