分享

升余弦滤波器 matlab代码

 昵称4074875 2010-11-12

关于信号波形成型:  中国通信网-无限分享-|M?9Y8]v!{"K(\
     升余弦滤波器    中国通信网-无限分享+C9R3qFUH8}HZ
(1)  升余弦滤波器的 matlab函数 -- rcosine, rcosflt
R;g2PsDpJ H'JK0     这个问题的代码已经在 “关于‘Matlab Demos’的学习”项目中得到了总结。
Iwd(];R)H0     优点:参数明了,容易设置;中国通信网-无限分享+MDrD{.r
     缺点:实现方法不透明。

(2)  升余弦滤波器的 matlab代码
4[2J#}!O-Ue0     升余弦公式:
P%l`J%[)\].{0

程序代码之一:
gZ!}%?;U'M0% -------------------------------------------------------------------------
n0l:E-^ TS0% File: c5_rcosdemo.m中国通信网-无限分享M w%Z}c
% -------------------------------------------------------------------------中国通信网-无限分享;@VAp/V*Bg0I\/]
% Software given here is to accompany the textbook: W.H. Tranter,
*mx p;o t1T\;jJ4m@0% K.S. Shanmugan, T.S. Rappaport, and K.S. Kosbar, Principles of
A^(x7O1D%_0% 《 Communication Systems Simulation with Wireless Applications 》
gzs*E*q@4Z0% Prentice Hall PTR, 2004.中国通信网-无限分享 qJ'Z L*L @
% -------------------------------------------------------------------------
+O"wb |nz6n#j1f0%  用卷积的办法求升余弦滤波器的冲击响应
'Wp a B4I#P0% -------------------------------------------------------------------------中国通信网-无限分享*q I0{fx:q2v[o
%                                       revised by lavabin  2006.08.04中国通信网-无限分享'[ \E,z_;{w4m l4|
% -------------------------------------------------------------------------中国通信网-无限分享hD&y-Sr4N
clc;clear all;close all;echo off;tic;

% -------------------------------------------------------------------------
za2Xh m0%                      Parameter Definition中国通信网-无限分享9n Q8R1F Ob&j E$s
% -------------------------------------------------------------------------中国通信网-无限分享$py op#fZ/r+NI
k = 10;        % Samples per symbol

m = 4;        中国通信网-无限分享-Ti]!h*J(F,P
% (1) time span for the display or impulse response width
9\FNgY+yE$?u0% 正半轴时间轴的跨距,单位:符号周期,这里缺省的符号周期是default T = 1,中国通信网-无限分享Gx(Sw,v#D| k$mM
% 这里m = 4,则左右跨度4个符号周期。
!K$rFyc0rp0% (2) Delay  中国通信网-无限分享'Ya6DWb
% 相位延迟的问题,要产生真正的因果信号,输入信号必须是经过延时的,m是延时参数之一

beta  = [ 0.32 0.80 1.00 ] ;     % Bandwidth Factor or Roll-Off Factor

for ii = 1:length(beta)
@d?UE3E4p'l!K"{0h      = rcos(k,m,beta(ii));      % impulse response
u j _9[4E I4^#b0in     = zeros(1,101); in(11) = 1;     % input
3U5o%T:^9i*l0out(ii,:) = conv(in,h);     % output中国通信网-无限分享"d1m4u~.zDU
end

t = 0:0.1:10;      % time vector for plot
"_ Z+Ui,Y$t0% 关于时间index的问题,这里的时间并不是按照前面的在t=11*T=11处的标准来定义的
#vs2^d8h u_xd?0% 这里的时间仅仅是为了显示图形的时候保持图形对称

figure;
O-UO I"T-d9J(p0plot(t,out(1,1:101),'r*-',t,out(2,1:101),'bo-',t,out(3,1:101),'k+-'); 中国通信网-无限分享D5d/U"sD|0L
grid on;
!quG@h*lWyw3G0xlabel('Time');中国通信网-无限分享^ uV`!K5~6?N!edW
ylabel('Amplitude');title('Impulse Response of Rcosine');
'x4R7qQU r0legend('Roll-Off = 0.32','Roll-Off = 0.80','Roll-Off = 1.00' );

simulation_time = toc
[J:\~SP t0% -------------------------------------------------------------------------
P4[a}6q y.NL$O~0%                           End of script file.中国通信网-无限分享g&M$[QB%D B'n
% -------------------------------------------------------------------------
X&SV6XS/@*G0

% -------------------------------------------------------------------------
y+EK%c4z nr/`0% File: rcos.m
N/a?pn6bhC0% -------------------------------------------------------------------------
qW#wDF!};U?l0% Software given here is to accompany the textbook: W.H. Tranter,
+YI i/uc!G2|0% K.S. Shanmugan, T.S. Rappaport, and K.S. Kosbar, Principles of
nHv&f%_5M U0% 《 Communication Systems Simulation with Wireless Applications 》
{r X\T0% Prentice Hall PTR, 2004.中国通信网-无限分享 j"tl+\h
% -------------------------------------------------------------------------
W^1aA(|9O0%                                       revised by lavabin  2006.08.04中国通信网-无限分享)O7X)Z.h!@TyBG B
% -------------------------------------------------------------------------
`]3BS ^0function h = rcos(k,m,beta)中国通信网-无限分享/\;l9X0oWl
% k - samples per symbol
R3m&xs5T T*~0% m - delay is mT中国通信网-无限分享'QD VU8Kc
% beta - bandwidth factor中国通信网-无限分享1U\?p \T4d(e
% default T = 1
G:}IigNj0beta = beta;
.d6Wa$|D U0n    = 0:2*m*k;           %  中国通信网-无限分享%Rx#R EbK.Y-Fb
z    = (n/k) - m + eps;   % time: t中国通信网-无限分享.Ct YoW:f]*R
t1   = cos(beta*pi*z);中国通信网-无限分享Fq },|u$^c)C
t2   = sin(pi*z)./(pi*z);中国通信网-无限分享 V1o?t^,[,|
t3   = 1 - 4*(beta^2)*z.^2;
c'v` p8y@_@0h    = t2.*t1./(t3);

length(n)中国通信网-无限分享 Kyd&Pt ?Yo
length(z)

if beta == 0.32
{-il9y"o:j1J1`?0figure;中国通信网-无限分享Qn3]f:|!h7z$} j
subplot(211);中国通信网-无限分享F:DjO(C;YJ{m:L }
plot(n,h,'ro-');grid on;
:GYaw f*Q!QBKI0title('n = 0:2*m*k');

subplot(212);
? r fV5^7i0plot(z,h,'ro-');grid on;
)s!k]%G R:p0iA0title('z = (n/k) - m + eps');中国通信网-无限分享@@/VH,v!a0w~
end

% -------------------------------------------------------------------------中国通信网-无限分享kLM1B!z5K+U
%                       End of function file.
Li\L N6q0% -------------------------------------------------------------------------

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多