Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7d69e57b authored by hhakim's avatar hhakim
Browse files

Minor fix in matfaust.dct

parent eb655ac8
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
%> Returns the Direct Cosine Transform (Type II) Faust of order n. %> Returns the Direct Cosine Transform (Type II) Faust of order n.
%========================================= %=========================================
function D = dct(n, varargin) function D = dct(n, varargin)
import matfaust.Faust
DFT = matfaust.dft(n, varargin{:}, 'normed', false); DFT = matfaust.dft(n, varargin{:}, 'normed', false);
P_ = zeros(n); P_ = zeros(n);
for i=1:n/2 for i=1:n/2
...@@ -17,7 +18,7 @@ function D = dct(n, varargin) ...@@ -17,7 +18,7 @@ function D = dct(n, varargin)
f_end = sparse(factors(DFT, numfactors(DFT)) * P_); f_end = sparse(factors(DFT, numfactors(DFT)) * P_);
F_mid = factors(DFT, 2:numfactors(DFT)-1); F_mid = factors(DFT, 2:numfactors(DFT)-1);
if ~ matfaust.isFaust(F_mid) if ~ matfaust.isFaust(F_mid)
F_mid = matfaust.Faust(F_mid); F_mid = Faust(F_mid);
end end
D = matfaust.Faust(f0) * F_mid * Faust(f_end); D = Faust(f0) * F_mid * Faust(f_end);
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment