1
votes

I have an input sine wave which is in time domain with a frequency of 10Hz. I am trying to code in MATLAB to develop a Frequency Response Function for a 2dof modal analysis problem.

enter image description here

In the output, there is a dominating peak at 10Hz, which is clearly due to the input harmonic wave

Question:

Which is the best way to remove this known harmonic disturbance from the response(output) in matlab?

Also, what should I do when the disturbing harmonic is not known?

Fs=1/dt;
NFFT = 2 ^ nextpow2 (L);                       %L is the length of signal
Y = fft (Output_time(1,:), NFFT) / L;          %Response in time domain to frequency domain
X=fft(Input_time,NFFT)/L;                      %Input in time to frequency domain
f = Fs / 2 * linspace (0,1, NFFT / 2 + 1);     %Frequencies
Output_frequency=2 * abs (Y (1: NFFT / 2 + 1));
Input_frequency=2 * abs (X (1: NFFT / 2 + 1));
FRF=(Y(1: NFFT / 2 + 1)./X(1: NFFT / 2 + 1));  %Frequency Response Functions
1
You can filter it if you know it! Learn a bit about filters, as maybe just a bandpass filter can do the jobAnder Biguri
The site Signal Processing may be helpful for such questionsuser3717023

1 Answers

0
votes

Thanks for the suggestions;I found the answer required.

I used band stop filter to solve this problem:

order=2;
lowFreq=9.5;
hiFreq=10.5;
[b,a] = butter(order, [lowFreq hiFreq]/(Fs/2), 'stop');
filtered_response = filter(b,a,u(1,:));