資源簡介
實(shí)現(xiàn)對信號的信道化接收。且具有良好的可拓展性,可修改信道數(shù)、濾波器階數(shù)、自由改變輸入信號
代碼片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%??????????parameters
m=16; %channels
N=8192; %data?length
fs=512; %sampling?rate
f1=N/m*7+35; %freq.?of?signal_1
f2=N/m*13-20; %freq.?of?signal_2
x1=cos(2*pi*(0:(N-1))*f1/N);
x2=3*cos(2*pi*(0:(N-1))*f2/N);
clength=18;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% input?signal
xx=x1+x2;??????????????%signal
figure(1)
subplot(211)
plot(xx(1:200));
grid
title(‘input?signal‘)
ww=kaiser(fs8)‘;
ww=ww/sum(ww);
subplot(212)
plot((0:(N-1))/Nabs(fft(xx))); %Spectrum?of?input?signal
grid?on
title(‘Spectrum?of?input?signal‘)
hold?on?
a=0.5/m:1/m:1+0.5/m;
for?i=1:m
plot([a(i)?a(i)][0?20000]‘r--‘) %divide?into?m_channels
end
hold?off
%%%%%%%%%%%%%%%%%%%%%%%%% M_path?resampled?signal
xs=zeros(mN/m+m);
for?p=1:m
for?q=1:N/m
xs(pq)=xx(m*(q-1)+m-p+1);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%% original?LP_filter
dh=m*clength; %lenghe?of?LP_filter
h=fir1(dh-11/m); %coefficient?vector?of?LP_filter
[Hw]=freqz(h1);
figure(2)
subplot(211)
plot(h) %Impulse?Response
grid
title(‘Impulse?Response:?Prototype?Filter‘)
xlabel(‘Normalized?time?nT/T‘)
ylabel(‘Amplitude‘)
subplot(212)
plot(w/pi20*log10(abs(H))); %amplitude-frequency?response
grid
title(‘Amplitude-frequency?Response‘)
xlabel(‘Frequency?‘)
ylabel(‘|H|db‘)
%%%%%%%%%%%%%%%%%%% channels
gg=zeros(mdh);
plot((-0.5:1/512:.5-1/512)*2*pifftshift(20*log10(0.000001+abs(fft(h512)))))
grid?on
title(‘m?channels‘)
axis([-pi?pi?
- 上一篇:粒子群pso算法
- 下一篇:matlab計(jì)算器源代碼
評論
共有 條評論