加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
PTscale2ref.m 890 Bytes
一键复制 编辑 原始数据 按行查看 历史
Brian White 提交于 2019-03-28 12:02 . Add files via upload
function [scaledOutput] = PTscale2ref(inputSig,inputRef)
%% [scaledSig] = PTscale2ref(sig,ref)
% Normalizes an input signal [inputSig] relative to a reference signal [inputRef]
% ----------------------------------------------------------------------------------
% "THE BEER-WARE LICENSE" (Revision 42):
% <brian.white@queensu.ca> wrote this file. As long as you retain this notice you
% can do whatever you want with this stuff. If we meet some day, and you think
% this stuff is worth it, you can buy me a beer in return. -Brian White
% ----------------------------------------------------------------------------------
c=1;% constant, scaling factor, though probably unnecessary
mRef = mean(abs(inputRef)); stdRef = std(abs(inputRef));
mSig = mean(abs(inputSig)); stdSig = std(abs(inputSig));
scaledOutput = (((inputSig - mSig)/stdSig) * stdRef + mRef) * c;
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化