如何理解信噪比?

信噪比(英语:Signal-to-noise ratio,缩写为SNR或S/N),又称訊噪比,是科学和工程中所用的一种度量,用于比较所需信号的强度与背景噪声的强度。其定义为信号功率与噪声功率的比率,以分贝(dB)为单位表示。大于比率1:1(高于0分贝)表示信号多于噪声。信噪比通常用于描述电子信号,也可以应用在各种形式的信号,比如冰芯内的同位素量,或细胞间的生物化学信号。

计算公式:
所指为有用信号功率(Power of Signal)与噪声功率(Power of Noise)的比。因此为幅度(Amplitude)平方的比:
在这里插入图片描述
这里是不是说这样计算:
合成信号的方差/噪声的方差
欢迎交流
matlab代码:

% Copyright(c) Naushad Ansari, 2017.
% %% Please feel free to use this open-source code for research purposes only. 
% %%
% %% contact at naushadansari09797@gmail.com in case of any query.
% %%
% %%
% %% This function calculates the snr of a signal with reference to original 
% signal. SNR can be calculated for 1-D/2-D/3-D signals.
%%-----------------------------------------------------------------------%%
%%-----------------------------------------------------------------------%%
% %% output: snr-> snr in dB
%            
% %% input:  orgSig-> original 1-D/2-D/3-D signal (or reference signal)
%            recSig-> reconstructed (1-D/2-D/3-D) signal/ signal obtained 
%            from the experiment/ signal, of which snr is to be calculated 
%            with reference to original signal.
%            boun-> boun is the boundary left at the corners for the 
%            snr calculation.  default value = 0
%%-----------------------------------------------------------------------%%
%%-----------------------------------------------------------------------%%
function snr = calSNR(orgSig,recSig,varargin)
 
if isempty(varargin)
    boun = 0;
else boun = varargin{1};
end
 
if size(orgSig,2)==1       % if signal is 1-D
    orgSig = orgSig(boun+1:end-boun,:);
    recSig = recSig(boun+1:end-boun,:);
else                       % if signal is 2-D or 3-D
    orgSig = orgSig(boun+1:end-boun,boun+1:end-boun,:);
    recSig = recSig(boun+1:end-boun,boun+1:end-boun,:);
end
sigEner = norm(orgSig(:))^2;
errEner = norm(orgSig(:)-recSig(:))^2;
snr = 10*log10(sigEner/errEner);

你可能感兴趣的:(如何理解信噪比?)