⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dct_profile.m

📁 英文书《Digital Signal Processing with Examples in MATLAB》附带的MATLAB实例
💻 M
字号:
function step=dct_profile(x,N,n)
% Computes quantizing profile for N-component DCT of x.
% The profile is based on avg. periodogram measured in octaves.
% Each component gets at least one bit, unless the component is zero.
% 
%
% Inputs:  x = any vector or waveform.
%          N = size of DCT (segment size when compressing x).
%          n = avg. number of bits/DCT component, >=1.
% Output:  step = vector of N step sizes to use when quantizing the
%                 DCT components.
%              

if nargin~=3,
    error('dct_profile must have 3 arguments.');
elseif N>length(x),
    error('length of x cannot be < segment size N.');
elseif n<1,
    error('n must be at least 1 bit per component.');
end
x=row_vec(x);
[P,Nseg,v]=pds(x,x,2*N,1,0);            %avg. periodogram of x.
P=resamp(P(1:N+1),N);                   %components of P at N freqs.
if min(P)==0,
    error('Power component =0 - step cannot process.');
elseif max(P)/min(P)>1000,
    error('Cannot process if power component ratio >1000.');
end
sp_fig(1);
plot(log2(P),'or'); grid;
step=P;


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -