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

📄 c13_tiv1.m

📁 时变通信系统的仿真
💻 M
字号:
% File: c13_tiv1.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.
%
f1 = 512;					% default signal frequency
bdoppler = 64;				% default doppler sampling
fs = 8192; 					% default sampling frequency
tduration = 1;				% default duration   
%
ts = 1.0/fs;				% sampling period 
n = tduration*fs;			% number of samples
t = ts*(0:n-1);			    % time vector
x1 = exp(i*2*pi*f1*t);	    % complex signal
zz = zeros(1,n);
%
% Generate Uncorrelated seq of Complex Gaussian Samples
%
z = randn(1,n)+ i*randn(1,n);
%
% Filter the uncorrelated samples to generate correlated samples
%
coefft = exp(-bdoppler*2*pi*ts);
h = waitbar(0,'Filtering Loop in Progress');
for k=2:n
   zz(k) = (ts*z(k))+coefft*zz(k-1);
   waitbar(k/n)
end
close(h)
y1 = x1.*zz; 			% filtered output of LTV system
%
% Plot the results in time domain and frequency domain
%
[psdzz,freq] = log_psd(zz,n,ts);
figure;
plot(freq,psdzz); grid;
ylabel('Impulse Response in dB')
xlabel('Frequency')
title('PSD of the Impulse Response');
zzz = abs(zz.^2)/(mean(abs(zz.^2)));
figure; 
plot(10*log10(zzz)); grid;
ylabel('Sq. Mag. of h(t) in dB')
xlabel('Time Sample Index')
title('Normalized Magnitude Square of the Impulse Response in dB');
[psdx1,freq] = log_psd(x1,n,ts); 
figure; 
plot(freq,psdx1); grid;
ylabel('PSD of Tone Input in dB')
xlabel('Frequency')
title('PSD of Tone Input to the LTV System');
[psdy1,freq] = log_psd(y1,n,ts);
figure; 
plot(freq,psdy1); grid;
ylabel('PSD of Output in dB')
xlabel('Frequency')
title('Spread Output of the LTV System');
% End of script file.

⌨️ 快捷键说明

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