CT SDM计算SNR的matlab代码
录入:edatop.com 阅读:
谁能给个代码的框架啊。用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是什么东西啊?前面也没有定义。跪求高人。
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是什么东西啊?前面也没有定义。跪求高人。
申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习本站推出的微波射频专业培训课程。
上一篇:修改标准单元库
下一篇:本科两年,何去何从。