B=0.5; %Beta value
Ts = 0.01; %Sampling interval
N=2000; %Number of samples
t=-20:Ts:(N-1)*Ts;
%Formula
pt_RootRaisedCosine = ((sin(pi*t.*(1-B)) + 4*B*t.*cos(pi*t*(1+B))) ./ (pi*t.*(1-(4*B*t).^2)));
plot(pt_RootRaisedCosine);
Hello,
I am trying to plot root raised cosine pulse for Beta equal to 0.5. But the issue in graph is, there is a little space. I am unable to figure out. Can someone help!

 채택된 답변

Walter Roberson
Walter Roberson 2020년 8월 21일

1 개 추천

t.*(1-(4*B*t).^2) is 0 at indices 1951 2001 2051 . For one of those it is because t == 0, and for the other two it is because 4*B*t == 1 so the 1 minus equals 0.

댓글 수: 3

Image Analyst
Image Analyst 2020년 8월 22일
편집: Image Analyst 2020년 8월 22일
And pt_RootRaisedCosine is a NaN (not a number) at those locations. When there is a nan in the array, the plotting routine does not put a marker there, or connect the valid points on either side of the nan with a line.
Besides the denominator being 0, the numerator is also zero. So while a zero in the denominator normally gives inf (infinity) as a result, 0/0 is undefined - it's neither 0 nor infinity - so that's why it's a nan rather than inf. And therefore does not plot that point.
B=0.5; % Beta value
t=0;
numerator = sin(pi*t.*(1-B)) + 4*B*t.*cos(pi*t*(1+B)) % It's 0.
denominator = pi*t.*(1-(4*B*t).^2) % It's 0.
pt_RootRaisedCosine = numerator ./ denominator % It's NaN
0/0 % It's NaN
5/0 % It's Inf
t = [-N*T:Ts:N*T] + 10^(-8); % in order to avoid division by zero problems at t=0.
This is what i did to not get that space
Walter Roberson
Walter Roberson 2020년 8월 22일
inf points are also not plotted, though.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2020년 8월 21일

댓글:

2020년 8월 22일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by