在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 3094|回复: 0

[求助] CT SDM计算SNR的matlab代码

[复制链接]
发表于 2011-7-26 16:33:17 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
谁能给个代码的框架啊。。用simulink仿真后不知怎么计算信噪比,郁闷。。或者谁能帮我看看下面的代码:
W=blackman(np); %Define a window of length np
[ys,f] = psd(ya,np,fs,W,[ ]);
%Use build-in Matlab ‘psd’ function
psdy = ys*norm(W)^2/sum(W)^2/(fs/np);
%Reverse norm and windowing
Subtraction of the input signal at fsig from the PSD:
fsignr = round(fsig/(fs/(np));
% Which bin contains the signal peak
%Find approx. number of bins (n) with leakage
comp = psdy(fsignr); n = 1; %Start at signal frequency
while (min(psdy((fsignr+n)fsignr1+n+10)))<vergl),。。。。。。。。。。。。。。。。。。(1)
comp=psdy(fsignr+n); n=n+1; % Enlarge n while there is
end; % still signal over the noise
psdy2 = psdy; %Copy the PSD-vector
psdy2(fsignr-n:fsignr+n) =
~~~~~~~~~~~~~(psdy(fsignr-n)+psdy(fsignr-n))/2;
%Replace signal peak by medium
% PSD-noise-magnitude around it
Determination of the integrated in-band noise [0, fB] from the PSD:
psdy2_bin = psdy2*(fs/np);
%Calculate the power of each bin
fbnr = round(fb/(fs/(np));
%Which bin is at the bandwidth’s edge
IBN = sum(psdy2_bin(0:fbnr))
214 A Program Code
Calculation of the output signal-to-noise ratio from the PSD:
psdy_bin = psdy*(fs/np); %Calculate power of each bin,
%here including the signal peak
SNR = sum(psdy_bin) - sum(psdy2_bin);
%Total integrated power minus
% total integrated power without signal
标着。。。(1)的那行中的fsignr1和verg1是什么东西啊?前面也没有定义。。跪求高人。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-29 01:02 , Processed in 0.012845 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表