Fourier transform of an impulse response function
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
It seems that I have trouble calculating an integral (Fourier transform). Here is my code:
syms t tau w f u
% SYSTEM
h = piecewise(t>=0, 0.01005*(exp(-t))*sin(9.949874371*t), t<0, 0);
%% Autocorrelation of h
h1 = subs(h,t,t-tau/2);
h2 = subs(h,t,t+tau/2);
%%
hh = h1*h2;
hh_simple = simplify(hh);
%% Fourier transform of the autocorrelation function
hh_test = hh_simple*exp(-j*2*pi*f*tau);
f3 = int(hh_test,tau,[-2*t 2*t]);
"h" is the impulse response function of a 1-dof system, "hh" its autocorrelation function and "f3" is the Fourier transform of the autocorrelation function.
"f3" is a function of frequency f and time t. When I assign some values to time "t", I plot the function f3 which is now of one variable, f. Seems like my plotted function has singularities and is not smooth. I was expecting a smooth curve with 1 peak (at the natural frequency of the system). Could someone please tell me if there is something wrong with it? Is there any problem with the integration?
Here is f3 at 3 time instants.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1468776/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1468776/image.jpeg)
댓글 수: 2
답변 (1개)
Paul
2023년 8월 30일
편집: Paul
2023년 8월 30일
Hi Jason,
syms t tau f real
% SYSTEM
h = piecewise(t>=0, 0.01005*(exp(-t))*sin(9.949874371*t), t<0, 0);
%h = 0.01005*(exp(-t))*sin(9.949874371*t)*heaviside(t);
%% Autocorrelation of h
h1 = subs(h,t,t-tau/2);
h2 = subs(h,t,t+tau/2);
%%
hh = h1*h2;
hh_simple = simplify(hh)
Safer to use sym(pi) here
%% Fourier transform of the autocorrelation function
hh_test = hh_simple*exp(-1j*2*sym(pi)*f*tau)
f3 = int(hh_test,tau,[-2*t 2*t]);
%f3 = int(hh_test,tau,-inf,inf)
Plot f3 for some values of t
figure
fplot(subs(f3,t,1))
xline(9.949874371/2/pi,'r')
xlabel('f')
figure
fplot(subs(f3,t,5))
xline(9.949874371/2/pi,'r')
xlabel('f')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!