📄 snrpolarity.m
字号:
% SNRPOLARITY Signal to Noise ratio%% [a,p] = snr(est,org)%% est = the estimate vector% org = the original vector% a = the SNR in dB% p = the est polarity with minimum snr %% tests for est and inverted est, function returns largest SNR%% 20Log10(Orig/Err)%% Paul D. O'Grady - 14-11-2003% (paul.ogrady@may.ie)function [a,p] = snrPolarity(est,org)orgNorm = org/norm(org);estNorm = est/norm(est);SNR(1) = norm(orgNorm)/norm(estNorm-orgNorm);estNorm = (est*-1/norm(est*-1));SNR(2) = norm(orgNorm)/norm(estNorm-orgNorm);[SNRResult polarity] = max(SNR);%return resultsa = 20*log10(SNRResult);if (polarity == 2)p = -1;elsep = 1;end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -