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.
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