👨🎓个人主页:研学社的博客
💥💥💞💞欢迎来到本博客❤️❤️💥💥
🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。
⛳️座右铭:行百里者,半于九十。
📋📋📋本文目录如下:🎁🎁🎁
目录
💥1 概述
电平交叉速率(LCR)和平均淡入淡出持续时间(AFD)是描述通道如何随时间变化的两个统计数据。虽然LCR和AFD提供与通道相干时间和多普勒扩频相同的信息,但它们更容易推导并允许实际测量。
📚2 运行结果
部分代码:
% AutoCorrelation
hv=subs(h_f,f,fr); % filter gain for each frequency
hv_double=double(hv); % convert gains into double
Autocorr=xcorr(hv_double); % Autocorrelation
Autocorr=real(Autocorr*(1/max(Autocorr))); % normalize AutoCorr
%% choose the values from AutoCorrelation to plot
L=ceil(length(Autocorr)/4);
AutocorrPlot=Autocorr(L:end-L+1); % remove the first and fourth quarters
plot(fr/fd,AutocorrPlot) % Plot AutoCorrelation with rexpect to f/fd
title('Third Order Filter (fd=100Hz, w0=2*pi*fd/1.2 , zeta=0.175)')
xlabel('f/fd')
ylabel('AutoCorrelation')
xlim([-5 5])
grid on
[pks,locs] = findpeaks(AutocorrPlot); % find peak values and their locations
hold on
scatter(fr(locs)./fd,AutocorrPlot(locs),'filled','blue')
stem(fr(locs)./fd,AutocorrPlot(locs),':r','linewidth',2)
%% plot autcorrelation at positive side
L2=ceil(length(AutocorrPlot)/2);
AutocorrPlot_P=AutocorrPlot(L2:end); % Positive side of autocorr.
fr_P=fr(L2:end); % Positive frequencies
figure
plot(fr_P/fd,AutocorrPlot_P)
title('Third Order Filter (fd=100Hz, w0=2*pi*fd/1.2 , zeta=0.175)')
xlabel('f/fd (positive frequencies)')
ylabel('AutoCorrelation at Positive frequencies')
xlim([0 5])
grid on
%% using autocorrelatio function
figure
autocorr(hv_double,length(hv_double)-1);
% PSD
a=abs((hv_double).^2);
figure
plot(fr/fd,a)
xlim([-2 2])
title('Third Order Filter (fd=100Hz, w0=2*pi*fd/1.2 , zeta=0.175)')
xlabel('fr/fd')
grid on
ylabel('PSD')
[pks,locs] = findpeaks(a);
% max_pks_L=locs(find(max(pks)));
hold on
scatter(fr(locs)/fd,a(locs),'filled','r')
stem(fr(locs)/fd,a(locs),'filled','.-.r','linewidth',1.5)
plot([-2 2],[max(a) max(a)],'.-.green','linewidth',1.5)
%% Impulse response of Digital Filter (channel)
[numZ denZ ts]=tfdata(tf_z,'v');
figure
[h,n] = impz(numZ,denZ);
%% find n0 : at this point h(n) become negligible
[pks,locs] = findpeaks(h);
nv=0.01; % negligible value as a percentage of maximum value
b=find(pks>=(nv*max(pks)));
peak_no=min(pks(b));
n0=max(locs(b));
%% plot impulse response
subplot(2,1,1)
plot(n.*ts,h)
xlabel('time [sec]')
title('Impulse response of channel "3rd order filter" using plot')
grid
hold on
scatter(n0.*ts,peak_no,'filled','r')
subplot(2,1,2)
stem(n,h)
xlabel('n [samples]')
title('Impulse response of channel "3rd order filter using stem"')
grid
hold on
scatter(n0,peak_no,'filled','r')
%% normalizing the filter H(Z)
numZ_N=numZ./sqrt(sum(h.^2)); % normalize numerator of H(z)
tf_Z_N=tf(numZ_N,denZ,ts);
%% Generating an input signal with unit power => (power_db = 0)
% Ip is vector (n0 ,1) , simulation time:T=0.1 sec
IP_no=(1/(sqrt(2))).*(randn(1,n0)+(1j*randn(1,n0)));
IP_T=(1/(sqrt(2))).*(randn(1,length(t))+(1j*randn(1,length(t))));
IP=[IP_no IP_T]; % first n0 bits for transient response
% Output from filter
Y=filter(numZ_N,denZ,IP); % output from filter
Y_T=Y(n0+1:end); % output after removing transients
% Output in DB
Y_T_db=20.*log10(abs(Y_T)); % output when length of input=T in dB
% root mean square value of input signals
rms_Y_T=rms(abs(Y_T)); % rms of output length = T
rms_Y_T_db=20.*log10(abs(rms_Y_T)); % rms of output length = T in dB
ten_dB_below=rms_Y_T_db-10;
%% plotting output from filters
🎉3 参考文献
部分理论来源于网络,如有侵权请联系删除。
[1]黄敏,李兵兵,贾琼,曾海.基于电平交叉率的多普勒频移估计方法[J].华中科技大学学报(自然科学版),2012,40(03):18-21.DOI:10.13245/j.hust.2012.03.010.