Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

For loop and Fast Fourrier Transfrom

조회 수: 4 (최근 30일)
Xuan Hiep Dinh
Xuan Hiep Dinh 2017년 3월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Dear colleagues, I have a question related to Fast fourier transfrom. I want to calculate the phase and make FFT to draw power spectral density. However when calculate the phase "theta", there was some errors. So sorry because I am new to Matlab. This is my program code. Please help. Thanks so much !
n = 1:32768;
T = 0.2*10^-9; % Sampling period
Fs = 1/T; % Sampling frequency
Fn = Fs/2; % Nyquist frequency
omega = 2*pi*200*10^6; % Carrier frequency
L = 32768; % % Length of signal
t = (0:L-1)*T; % Time vector
x_signal(n) = cos(omega*T*n + 0.1*randn(size(n))); % Additive phase noise (random)
y_signal(n) = sin(omega*T*n + 0.1*randn(size(n))); % Additive phase noise (random)
theta(n) = atan(y_signal(n)/x_signal(n));
f = (theta(n)-theta(n-1))/(2*pi)
Y = fft(f,t);
PSD = Y.*conj(Y); % Power Spectral Density
%Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
  댓글 수: 3
Xuan Hiep Dinh
Xuan Hiep Dinh 2017년 3월 12일
Thanks for help. However, I need to calculate the phase "theta" before doing fft.
Xuan Hiep Dinh
Xuan Hiep Dinh 2017년 3월 12일
And I am stuck when calculating the frequency.

답변 (0개)

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by