⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c3_sna.m

📁 好东东
💻 M
字号:
% File: c3_sna.m
% Software given here is to accompany the textbook: W.H. Tranter, 
% K.S. Shanmugan, T.S. Rappaport, and K.S. Kosbar, Principles of 
% Communication Systems Simulation with Wireless Applications, 
% Prentice Hall PTR, 2004.
% 
k = 50;			                % samples per lobe
nsamp = 50000;		            % total frequency samples
snrdb = zeros(1,17);		    % initialize memory
x = 4:20;			            % vector for plotting
for m = 4:20
   signal = 0; noise = 0;       % initialize sum values
   f_fold = k*m/2;		        % folding frequency
   for j = 1:f_fold
      term = (sin(pi*j/k)/(pi*j/k))^2;
      signal = signal+term;
   end
   for j = (f_fold+1):nsamp
      term = (sin(pi*j/k)/(pi*j/k))^2;
      noise = noise+term;
   end
   snrdb(m-3) = 10*log10(signal/noise); 
end
plot(x,snrdb)			        % plot results
xlabel('Samples per symbol')
ylabel('Signal-to-aliasing noise ratio')
% End of script file.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -