How can I calculate and plot the spectral power density of Square Root Raised Cosine Pulse using fft?
古いコメントを表示
I was given the following Matlab function which takes 4 parameters as arguments and returns a Square Root Raised Cosine pulse.
function [phi, t] = srrc_pulse(T, Ts, A, a)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% phi = srrc_pulse(T, Ts, A, a) %
% OUTPUT %
% phi: truncated SRRC pulse, with parameter T, %
% roll-off factor a, and duration 2*A*T %
% t: time axis of the truncated pulse %
% INPUT %
% T: Nyquist parameter or symbol period (real number) %
% Ts: sampling period (Ts=T/over) %
% where over is a positive INTEGER called oversampling factor %
% A: half duration of the pulse in symbol periods (positive INTEGER) %
% a: roll-off factor (real number between 0 and 1) %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t = [-A*T:Ts:A*T] + 10^(-8); % in order to avoid division by zero problems at t=0.
if (a>0 && a<=1)
num = cos((1+a)*pi*t/T) + sin((1-a)*pi*t/T) ./ (4*a*t/T);
denom = 1-(4*a*t./T).^2;
phi = 4*a/(pi*sqrt(T)) * num ./ denom;
elseif (a==0)
phi = 1/(sqrt(T)) * sin(pi*t/T)./(pi*t/T);
else
phi = zeros(length(t),1);
disp('Illegal value of roll-off factor')
return
end
For example let's suppose that T=1, Ts=1/10, A=4 and a=0. So I invoke the method like that:
phi1 = srrc_pulse(1, 1/10, 4, 0)
What I want to do next is to find the Fourier Transform of this pulse at L equally spaced points (for example L=1000) across the frequency axis from -(Fs/2) to Fs/2 where Fs is the sampling frequency, using the fft function and then plot what I get so I can have a visual approach of the spectral power density of the pulse. My problem is that I can see the plot only for the positive values of frequency, and I cannot see the negative ones. I have also attached an image of what I get on the plot. My code is the following. Any help would be greatly appreciated!

%
2 件のコメント
Nishitha Ayyalapu
2013 年 10 月 17 日
attachment missing. Try again.
Konstantinos
2013 年 10 月 17 日
採用された回答
その他の回答 (1 件)
Nishitha Ayyalapu
2013 年 10 月 17 日
0 投票
However to answer how to get negative frequency axis:
1.) Do fftshit
2.) change frequency axis accordingly.
Below is the link which answered how to do that
カテゴリ
ヘルプ センター および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
