在 matlab 中的离散余弦变换我要分享

dct in the matlab

others

关注次数: 293

下载次数: 0

文件大小: 1.19 kB

代码分类: 其他

开发平台: matlab

下载需要积分: 2积分

版权声明:如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

代码描述

中文说明:功能 b=dct(a,n)%Dct 离散余弦变换。%%Y = DCT(X) 返回 X 的离散余弦变换。%Y 向量是 X 的大小相同,并且包含%离散余弦变换系数。%%Y = DCT(X,N) 垫或截断长度为 N 的向量 X在转型之前的 %。%如果 X 是一个矩阵,离散余弦变换操作 %应用于每个%列。这种转换可以倒置使用离散余弦逆变换。%%请参阅 FFT IFFT,离散余弦逆变换。%作者: C.汤普森,93/2/12%S.Eddins 94/10/26,订正%数学,Inc.版权所有 1988 年 2002 年%$Revision: 1.7 元 $Date: 2002年/04/15 1:10:40 元%的参考文件:%1) A.K.耆那教,"数字图像的基本要素%加工",第 150-153 页。%2) 华莱士,"JPEG 静止图片压缩标准",%的 ACM 通信,1991 年 4 月。如果 nargin = = 0,错误 (足够的 'Not 输入参数.') ;结束如果 isempty(a)b = [];返回结束%如果输入是一个向量,使它的列:do_trans = (size(a,1) = = 1) ;如果 do_trans,= a(:) ; 结束如果 nargin = = 1,n = size(a,1) ;结束m = size(a,2) ;%垫或截形的输入,如有必要如果 size(a,1) < n,aa = zeros(n,m) ;aa(1:size(a,1),:) = a;其他a


English Description:

function b=dct(a,n)%DCT  Discrete cosine transform.%%   Y = DCT(X) returns the discrete cosine transform of X.%   The vector Y is the same size as X and contains the%   discrete cosine transform coefficients.%%   Y = DCT(X,N) pads or truncates the vector X to length N %   before transforming.%%   If X is a matrix, the DCT operation is applied to each%   column.  This transform can be inverted using IDCT.%%   See also FFT, IFFT, IDCT.%   Author(s): C. Thompson, 2-12-93%              S. Eddins, 10-26-94, revised%   Copyright 1988-2002 The MathWorks, Inc.%   $Revision: 1.7 $  $Date: 2002/04/15 01:10:40 $%   References: %   1) A.


代码预览