8
$\begingroup$

Is there an easy method to compare two sounds of equal frequency composition, but whose spectra are shifted higher or lower relative to each other? As a human, one recognizes the identity immediately.

In our frog species, the male advertisement call has a constant spectrum that differs from those of other individuals. The next year, the power spectrum of the individual looks the same, but it has shifted in frequency, maybe because the animal has grown.

$\endgroup$
3
  • $\begingroup$ Are you referring to formants? Unclear what is meant by "equal frequency composition" $\endgroup$
    – Chloe
    Commented Jul 8, 2022 at 13:10
  • 2
    $\begingroup$ A short spectrogram segment may help dissipate the ambiguities? $\endgroup$
    – Thejasvi
    Commented Jul 8, 2022 at 14:38
  • $\begingroup$ The sounds consist of series of clicks, or trills, that alternate in pitch. The next year the power spectrum looks roughly the same, but it is shifted in frequency. 1st year: f1=1890 f2=2281 difference: 391 2nd year f1= 1953 f2=2328 difference: 375 There is a frequency shift of 50-60 Hz, but the difference remains constant (resolution 16 Hz). Could one compare the whole spectra? $\endgroup$ Commented Jul 10, 2022 at 12:57

3 Answers 3

6
$\begingroup$

It's not very clear what you mean with "equal frequency composition", but assuming the sounds you're talking about are mostly tonal (and hence have a fundamental frequency f_1 and harmonics f_2 = 2*f_1, f_3 = 3*f_1, etc), you can try normalising your frequency axis to the fundamental frequency at each case - that is, plot the spectra against f_norm = f/f_1 (instead of against f in Hz), where f_1 changes depending on your individual recording/animal. Hence, sounds at different frequencies will always show their fundamentals at f_norm = 1, the 2nd harmonic at f_norm = 2, and so on. Note that this compresses/stretches the frequency axis, so spectra with the same shape when plotted in Hz will not have the same shape when plotted in this normalized frequency!

[This is sort of "order analysis", a type of engineering analysis used for investigating noise and vibration generated by rotating machines - motors, fans, engines, etc - as their rotational frequency changes over time.]

$\endgroup$
3
  • $\begingroup$ The sounds consist of series of clicks, or trills, that alternate in pitch. The 2nd year the power spectrum looks roughly the same as the 1st, but it is shifted in frequency. 1st year: f1=1890 f2=2281 difference: 391 2nd year f1= 1953 f2=2328 difference: 375 There is a frequency shift of 50-60 Hz, but the difference remains constant (resolution 16 Hz). Could one compare the whole spectra? $\endgroup$ Commented Jul 10, 2022 at 12:54
  • $\begingroup$ As mentioned in the comments to your question, could you add a short spectrogram segment as an example? It might help us understand better what your signals look like and suggest more appropriate methods. $\endgroup$ Commented Jul 12, 2022 at 9:22
  • $\begingroup$ I have tried to do so. But the program did not accept my spectrogram photo. $\endgroup$ Commented Jul 13, 2022 at 16:14
2
$\begingroup$

An easy way without programming would be:

  1. Measure the fundamental frequency $F_i$ at the beginning of the call for each of your recording i.
  2. Choose the new standard fundamental frequency for all your recordings, e.g. F=200 Hz
  3. Multiply the speed by F/F_i for each of your recording i, or even better, change the "pitch" accordingly for each recording.

Then you will be able to compare your recordings independently of the fundamental frequency.

In Audacity, you can change the pitch by entering F_i and F in the "Frequency: from ... to..." box (ref):

enter image description here

Changing the pitch is better than changing the speed because it modifies harmonic-sound only and does not modify non-harmonic sounds such as clicks or noise.

$\endgroup$
1
$\begingroup$

Some cross-correlation algorithms allow for the frequency shift between spectrograms. For example, in Avisoft, you can set-up maximum frequency deviation between the spectrograms (http://www.avisoft.com/Help/SASLab/scan_for_template_spectrogram_patterns.htm). You could set up large frequency deviation and get the maximum cross-correlation score. Also, 'corspec' function in the 'seewave' R package seem to do the same trick (https://rdrr.io/cran/seewave/man/corspec.html).

However, normalizing the frequency peaks relative to the fundamental suggested earlier is probably better solution.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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