git-svn-id: http://moon:8086/svn/matlab/trunk@153 801c6759-fa7c-4059-a304-17956f83a07c
36 lines
922 B
Matlab
Executable File
36 lines
922 B
Matlab
Executable File
% [h] =fir_rrc(fa,Tsym,Alpha,N)
|
|
function [b,k,delay] =fir_rrc(fa,Tsym,Alpha,N)
|
|
|
|
if rem(N,2),
|
|
delay = (N-1)/2;
|
|
else
|
|
delay = N/2;
|
|
end
|
|
|
|
n = ((0:N-1)-delay)/fa;
|
|
|
|
ind1 = find(n == 0);
|
|
if ~isempty(ind1),
|
|
b(ind1) = - sqrt(2./Tsym) ./ (pi.*fa) .* (pi.*(Alpha-1) - 4.*Alpha );
|
|
end
|
|
|
|
ind2 = find(abs(abs(8.*Alpha.*n./Tsym) - 1.0) < sqrt(eps));
|
|
if ~isempty(ind2),
|
|
b(ind2) = sqrt(2./Tsym) ./ (2.*pi.*fa) ...
|
|
* ( pi.*(Alpha+1) .* sin(pi.*(Alpha+1)./(4.*Alpha)) ...
|
|
- 4.*Alpha .* sin(pi.*(Alpha-1)./(4.*Alpha)) ...
|
|
+ pi.*(Alpha-1) .* cos(pi.*(Alpha-1)./(4.*Alpha)) ...
|
|
);
|
|
end
|
|
|
|
ind = 1:length(n);
|
|
ind([ind1 ind2]) = [];
|
|
nind = n(ind);
|
|
|
|
b(ind) = -4.*Alpha./fa .* ( cos((1+Alpha).*2.*pi.*nind./Tsym) + ...
|
|
sin((1-Alpha).*2.*pi.*nind./Tsym) ./ (8.*Alpha.*nind./Tsym) ) ...
|
|
./ (pi .* sqrt(1./(2./Tsym)) .* ((8.*Alpha.*nind./Tsym).^2 - 1));
|
|
|
|
b = sqrt(2./Tsym) .* b;
|
|
k=0.5*fa*Tsym;
|