Azzera filtri
Azzera filtri

FFT Analysis Issue: Unexpected Harmonic Multiples in Vibration Signal Frequency Plot

14 visualizzazioni (ultimi 30 giorni)
Hi everyone,
I'm currently working on analyzing a vibration signal with a frequency of around 300Hz using FFT. I've encountered an issue in my results—I'm observing dominant harmonics at 289 Hz, but along with those, there are unexpected multiples in the frequency plot.
I've attached screenshots of the plots and the code I used for reference. I'm not entirely sure whether this phenomenon is due to spectrum leakage, aliasing, or if these harmonics are actually present in the original signal.
Could someone explain what might be causing this and suggest solutions to address the issue? Thanks!
Attachments:
% Load the data from the .csv file
data = csvread('adc.csv', 1, 0);
% Extract time and ADC value columns
time = data(:, 1);
adc_value = data(:, 2);
% Calculate the sampling frequency
fs = 1000;
% Perform FFT with windowing
N = 2^nextpow2(length(adc_value));
frequencies = (0:N-1) * fs / N;
% Apply Hamming window
window = hamming(length(adc_value));
windowed_signal = adc_value .* window;
fft_result = fft(windowed_signal, N);
amplitude_spectrum = abs(fft_result);
% Plot the signal
figure;
subplot(2, 1, 1);
plot(time, adc_value);
title('Signal');
xlabel('Time (s)');
ylabel('ADC Value');
% Plot the amplitude spectrum
subplot(2, 1, 2);
plot(frequencies, amplitude_spectrum);
title('Amplitude Spectrum');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
% To find the dominant frequency component:
[max_amplitude, dominant_freq_index] = max(amplitude_spectrum);
dominant_frequency = frequencies(dominant_freq_index);
disp(['Dominant Frequency: ' num2str(dominant_frequency) ' Hz']);

Risposte (2)

Star Strider
Star Strider il 14 Ott 2023
It appears that the fft plot as actually a double-sided fft that the function normally produces.
The ‘frequencies’ should probably be:
frequencies = (0:(N/2)-1) * fs / 2;
and then in the plot:
plot(frequencies, amplitude_spectrum(1:numel(frequencies)))
to plot a one-sided Fourier transform.
That may resolve some of the problems.
Any other spectral characteristics may be due to the material under test and the instrumentation acquiring the signal.

William Rose
William Rose il 14 Ott 2023
Modificato: William Rose il 14 Ott 2023
[edit: corect typos]
I agree with @Star Strider that you are plotting the 2-sided spectrum, and that is why you see mirrored peaks above the Nyquist frequency, which is 500 Hz in this case, where fs=1000 Hz.
Your first plot is inconsistent with fs=1000. The sampling rate in the first plot (ADC value versus Time) is clearly more than 1000 Hz. I recommend that you do
fs=(length(time)-1)/(time(end)-time(1);
The time domain plot shows 37 peaks in 13 milliseconds, which is about 2800 Hz, not 300 Hz.
After computing the spectrum with fs above, plot the bottom half of your ampitude spectrum, as @Star Strider recommended.
I see that you do
N = 2^nextpow2(length(adc_value));
Why? To me this is an archaic practice that made sense when computers were much slower than now. Some of the early FFT functions (and I used them) would only work on sequences whose length was a power of 2. And the FFT algorithm runs most quickly when N is a power of 2. But those concerns are not applicable in this case. In your case, the sequence gets zero-padded as necessary. The added zeros result in a frequency scale which is more fine-grained (i.e. delta f is smaller) than what would have been the case without the zero padding. This "improvement" in frequency resolution is not real, in the sense that the original sampled signal does not have this frequency reolution. Therefore I advise students not to use nextpow2() for compuing spectra.

Prodotti


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by