Created
June 9, 2014 19:41
-
-
Save shane5ul/1585478f346ef089ee36 to your computer and use it in GitHub Desktop.
Discete Cosine Series Tutorial: Snippet 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 15; % number of collocation points is (n+1) | |
nmodes = 5; % number of modes of the DCS | |
xi = [0:n]'/(n+1); % collocation points for DCS | |
V = zeros(n+1, nmodes); | |
% | |
% V: stack the nmodes DCS basis functions columnwise | |
% | |
for j = 1:nmodes | |
V(:,j) = cos(2*pi*(j-1)*xi); | |
endfor | |
(2/n+1)*V' * V |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment