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

📄 rms.m

📁 本程序的目的是通过变化DCT系数以及寻找可以应用的DCT系数的最小值来进行可扩展的MPEG压缩
💻 M
字号:


%
% Root-Mean-Square value(s) for input data
%
% Efficient MATLAB function for finding RMS values. Accepts N-Dimensional 
% matrices, and computes the column-wise RMS value for N>1, or across any 
% dimension dim if specified by the user.
% 
% Usage:        output = rms(input, dim)
%

% Hazem Saliba Baqaen. Hazem@brown.edu
% MATLAB 7.0
% Credit due to Duane Hanselman for important suggestions


function out = rms(in,dim)

if nargin == 1      % Default (no dim argument specified)
    dim = 1;
end

if nargin==1 & ndims(in)==2 & any(size(in)==1)        % Can replace this condition with nargin==1 && isvector(in) in MATLAB 7 or higher
    out = norm(in)/sqrt(length(in));        % Faster, but requires 1-Dim data vector
else
    out = sqrt(sum((in.^2),dim)/size((in),dim));        % Column-wise RMS for [row x column] array or matrix if dim = 1
end

% For increased speed it is advised to bypass the function call altogether
% and copy and paste part or all of the internal code into your program

⌨️ 快捷键说明

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