1
$\begingroup$

I have a signal with multiple frequencies. The frequency changes depending on the amount of air flowing through the fuel snap. The signal resembles a square wave ranging from $0.4$ to $4.5$ Volts and was measured over a duration of $30$ seconds, resulting in $1,200,00$ values. I am attempting to analyze the signal, but first I need to determine whether it is periodic or not using MATLAB.

I analyzed the autocorrelation of the MAF signal based on an answer provided. However, does this mean it is not periodic? The autocorrelation decays and eventually vanishes towards the ends.

enter image description here

i used the fft to identify the frequencies present in the signal (does each peak magnitude belong to a different frequency component?) and how can i determine the exact time or the period at which each frequency started?

the fft: enter image description here

$\endgroup$
6
  • 1
    $\begingroup$ How do you define "periodic" for your specific application. For most physical signals it's not "yes or no" but "more or less". No physical signal is strictly periodic. $\endgroup$
    – Hilmar
    Commented Jul 3, 2023 at 11:06
  • $\begingroup$ i had tried with fft and welch but i am not sure if the peaks are belongs to a specified frequency or just a Harmonics of the fundemental frequency. $\endgroup$
    – Asli
    Commented Jul 3, 2023 at 11:07
  • $\begingroup$ because it repeat itself with same amplitude and frequency until the next frequency changing. but either i am not sure it semm periodic $\endgroup$
    – Asli
    Commented Jul 3, 2023 at 11:10
  • $\begingroup$ In the first place, show us your signal ! $\endgroup$
    – user67664
    Commented Jul 3, 2023 at 19:02
  • $\begingroup$ What do you mean by "with multiple frequencies". All signals are made of multiple frequencies, unless a pure sine wave. $\endgroup$
    – user67664
    Commented Jul 3, 2023 at 19:03

1 Answer 1

1
$\begingroup$

Computing the autocorrelation function is a robust approach to determine periodicity: the degree of periodicity will be indicated by peaks at offsets $\tau$ in the autocorrelation function. The FFT alone can be used to indicate periodicity of individual tones, but the autocorrelation function can reveal with better fidelity the periodicity of any function including noise like functions or functions that may be buried in noise.

I show an example of this where I synthesized a received GPS signal down-converted to baseband together with the dominant receiver noise. To signal appears as additive white Gaussian noise (AWGN) in both the time and frequency band given the low level GPS signal received. The autocorrelation function reveals the 1 ms periodicity of the GPS C/A code used while we can't distinguish this in the frequency domain. If the captured signal was truly AWGN only, we would only get the single central peak.

autocorrelation

A zoom in on the frequency spectrum for this signal (as determined from an FFT) is given below:

enter image description here

The 1 ms periodicity would appear as harmonics spaced at 1 KHz in the frequency spectrum if visible. We see in this case that it is very difficult to distinguish the 1 KHz harmonics from the noise, yet in comparison we were able to see evidence of the 1 ms periodicity much more clearly from the autocorrelation function.

If we repeat the above plots with the GPS signal only and no noise, we get the following result where the periodicity is visible with both approaches:

noise free autocorrelation

noise free spectrum

Each peak in the FFT is a complex number. The location of the peak magnitude on the frequency axis indicates the frequency that was detected with a relative magnitude between various peaks indicating the strength of each component. Often the components will be integer harmonics of what can be described as one periodic waveform—- any periodic waveform that is not s pure sinusoid or single exponential will have integer harmonics consistent with the Fourier Series. The phase of each peak will reveal the relative phase of each component, but this will not be accurate if the frequency component is not perfectly aligned with the center of an FFT bin.

$\endgroup$
8
  • $\begingroup$ thank you sir for the answer. i got this figure from the autocorrelation function $\endgroup$
    – Asli
    Commented Jul 4, 2023 at 7:43
  • $\begingroup$ @GggNn Yes the periodicity you see in your autocorrelation function indicates periodicity in time. The decay toward zero in the ACF is expected for a linear ACF. This write-up may help you: machinelearningmastery.com/… Did I answer your question? $\endgroup$ Commented Jul 4, 2023 at 13:13
  • $\begingroup$ yes and thanks. but please another question: Does the Welch spectral estimation computation show me how many frequencies are present in the signal or does it mainly concern the fundamental frequency of the total signal and its harmonics? $\endgroup$
    – Asli
    Commented Jul 5, 2023 at 10:54
  • $\begingroup$ Welch shows a Power spectral density but will average out individual frequency tones so does not show any individual frequencies well but average power over a frequency band. $\endgroup$ Commented Jul 5, 2023 at 11:45
  • $\begingroup$ so then fft would show the individual frequencies or? $\endgroup$
    – Asli
    Commented Jul 5, 2023 at 12:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.