フィルターのクリア

Adding noise to a signal and which caculation of Signal to Noise Ratio is correct ?

9 ビュー (過去 30 日間)
Mohamad
Mohamad 2020 年 11 月 4 日
コメント済み: Mohamad 2020 年 11 月 5 日
Hi , Please I need to add white gaussain noise with a variance = (4/9)*var(sig) to the signal in ( noise_test.mat) .
I need to know which caculation of Signal to Noise Ratio is correct , is it SNR1 or SNR2 ?
Is it ratio of variances of the original signal to Noise or the corrupted signal to Noise ?
load noise_test.mat
noise=(2/3)*std(y)*randn(size(y)); %% generate zero-mean white gaussian noise with a variance = (4/9)*var(sig)
sig=y+noise; % Add generated noise to get the corrupted signal
SNR1 = var(y)/var(noise); % caculate ( SNR ) using the corrupted signal
SNR2 = var(sig)/var(noise); % caculate (SNR ) uisng the original signal
SNR1dB=10*log10(SNR1); % caculate noisy ( SNR ) in dB
SNR2dB=10*log10(SNR2); % caculate noisy ( SNR ) in dB
Thanks
  4 件のコメント
Mathieu NOE
Mathieu NOE 2020 年 11 月 4 日
uh..
be careful your definition of SNR2 says
% uisng the original signal
"
whereas you actually use sig in the computation (signal + noise)
Mohamad
Mohamad 2020 年 11 月 5 日
Ok , I modified , Thanks alot
load noise_test.mat
noise=(2/3)*std(y)*randn(size(y)); %% generate zero-mean white gaussian noise with a variance = (4/9)*var(sig)
sig=y+noise; % Add generated noise to get the corrupted signal
SNR = var(y)/var(noise); % caculate ( SNR ) using the corrupted signal
SNRdB=10*log10(SNR); % caculate noisy ( SNR ) in dB

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by