问题
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
回答1:
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,:));
来源:https://stackoverflow.com/questions/31335831/remove-known-harmonic-from-from-frequency-response-function