SrinivasAluri
Mechanical
- Jun 24, 2004
- 62
I am trying to compute an impulse response function from a one-sided Frequency Response Function. How do I do that in Matlab?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
load frf_et.txt % load the text file containing the data
frf = frf_et(:,1)+i*frf_et(:,2); % form the complex FRF
fn = 640; % Nyquist frequency
df = fn/8192; % frequency spacing
freq = [0:df:fn-df]; % frequency vector
frf2 = [0 frf(2:end).' 0 frf(end:-1:2)']; % form 2-sided FRF
irf = ifft(frf2); % calculate IRF
dt = 1./2./fn; % sampling interval
time = 0:dt:16383*dt; % vector of sampling times
% plot the results
figure;
subplot(3,1,1);
plot(freq,abs(frf));
xlabel('Frequency (Hz)');
ylabel('FRF Magnitude');
subplot(3,1,2);
plot(freq,angle(frf));
xlabel('Frequency (Hz)');
ylabel('FRF Phase (rad)');
subplot(3,1,3);
plot(time,real(irf));
xlabel('Time (s)');
ylabel('IRF');