Frequency Response Function and Delay

조회 수: 1 (최근 30일)
Evenor
Evenor 2018년 11월 5일
댓글: Evenor 2018년 11월 6일
I have two time-series, the input u and the response y (both are raw vectors of the same length). I want to calculate the (Fourier) response function and the delay per frequency. Let Fu and Fy be the Fourier transforms of u and y respectively (e.g. Fx = fft(x)). Then for a linear system the response function R(f) is given by
R(f) = Fy(f)/Fu(f)
and the delay is given by
tau(f) = -arg( R(f) )/(2*pi*f)
since R(f)exp(i*2*pi*f*t) = abs(R(f))exp(i*2*pi*f*t)*exp(i*arg) = exp(i*2*pi*f*(t-tau)).
I tried to implement it in the following code:
%%Fourier analysis and delay per frequency
uM = ... % input
yM = ... % response
fs=1; % sampling frequency
N=length(uM);
% enforce evenness
if mod(N,2)==1
uM1 = uM(1:N-1);
yM1 = yM(1:N-1);
N = N-1;
else
uM1 = uM;
yM1 = yM;
end
% Fast Fourier Transform (symmetric to zero)
Fu = fftshift(fft(uM1));
Fy = fftshift(fft(yM1));
ff = (-N/2:N/2-1)*(fs/N); % zero-centered frequency range
mid = find(ff==0);
if isempty(mid)
mid = 0;
end
% The delay time per frequency = tau(f)
ftau = -unwrap(angle(Fy./Fu))./(2*pi*ff); % delay per freq = tau_w
figure
plot(ff((mid+1):end),ftau((mid+1):end))
xlabel('\fontsize{14} Frequency: f [Hz]')
ylabel('\fontsize{14} Delay per freq: \tau [sec]')
title('\fontsize{14} STRSF14')
grid on
I attach the data and the plots obtained by this code.
Example 1:
However, this results seems wrong, since for a causal linear system the delay time should be non-negative.
Example 2:
The signal in time:
The delay (via the response function):
However, this results seems wrong, since for a causal linear system the delay time should be non-negative. There is a point with a jump of about -5.6818 pi, which also seems odd.
Where am I wrong?
(P.S. I don't have the signal processing toolbox.)

답변 (1개)

Bruno Luong
Bruno Luong 2018년 11월 5일
When you compute the phase there is always an arbitrary shift of (k*2*pi), k integer.
I think a reasonable assumption is make your unwrap phase = 0 for ff = 0, that will probably resolve the negative phase-shift.
  댓글 수: 5
Bruno Luong
Bruno Luong 2018년 11월 6일
Have to tried to apply window function to your data as I told earlier?
Evenor
Evenor 2018년 11월 6일
I am now reading about it. Can you please elaborate on this and what intended use do you offer?

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

카테고리

Help CenterFile Exchange에서 Digital Filtering에 대해 자세히 알아보기

제품


릴리스

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by