Answers.Body: <p>It's not very clear what you mean with &quot;equal frequency composition&quot;, but assuming the sounds you're talking about are mostly tonal (and hence have a fundamental frequency <code>f_1</code> and harmonics <code>f_2 = 2*f_1</code>, <code>f_3 = 3*f_1</code>, etc), you can try normalising your frequency axis to the fundamental frequency at each case - that is, plot the spectra against <code>f_norm = f/f_1</code> (instead of against <code>f</code> in Hz), where <code>f_1</code> changes depending on your individual recording/animal. Hence, sounds at different frequencies will always show their fundamentals at <code>f_norm = 1</code>, the 2nd harmonic at <code>f_norm = 2</code>, 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!</p>
  <p>[This is sort of &quot;order analysis&quot;, 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.]</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-10T12:54:56.637Z
Answers.Text: 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?
Answers.UserDisplayName: Andreas Elepfandt
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-12T09:22:24.140Z
Answers.Text: 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.
Answers.UserDisplayName: fabio_hirono
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-13T16:14:47.263Z
Answers.Text: I have tried to do so. But the program did not accept my spectrogram photo.
Answers.UserDisplayName: Andreas Elepfandt
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-08T11:08:57.280Z
Answers.LastActivityDate: 2022-07-08T11:08:57.280Z
Answers.UserDisplayName: fabio_hirono
Answers.Body: <p>An easy way without programming would be:</p>
  <ol>
  <li>Measure the fundamental frequency $F_i$ at the beginning of the call for each of your recording i.</li>
  <li>Choose the new standard fundamental frequency for all your recordings, e.g. F=200 Hz</li>
  <li>Multiply the speed by F/F_i for each of your recording i, or even better, change the &quot;pitch&quot; accordingly for each recording.</li>
  </ol>
  <p>Then you will be able to compare your recordings independently of the fundamental frequency.</p>
  <p>In Audacity, you can change the pitch by entering F_i and F in the &quot;Frequency: from ... to...&quot; box (<a href="https://manual.audacityteam.org/man/change_pitch.html" rel="nofollow noreferrer">ref</a>):</p>
  <p><a href="https://i.sstatic.net/A49kG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/A49kG.png" alt="enter image description here" /></a></p>
  <p>Changing the pitch is better than <a href="https://manual.audacityteam.org/man/change_speed.html" rel="nofollow noreferrer">changing the speed</a> because it modifies harmonic-sound only and does not modify non-harmonic sounds such as clicks or noise.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-07-08T11:18:45.803Z
Answers.LastActivityDate: 2022-07-08T13:02:45.313Z
Answers.LastEditDate: 2022-07-08T13:02:45.313Z
Answers.UserDisplayName: Noil
Answers.Body: <p>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 (<a href="http://www.avisoft.com/Help/SASLab/scan_for_template_spectrogram_patterns.htm" rel="nofollow noreferrer">http://www.avisoft.com/Help/SASLab/scan_for_template_spectrogram_patterns.htm</a>). 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 (<a href="https://rdrr.io/cran/seewave/man/corspec.html" rel="nofollow noreferrer">https://rdrr.io/cran/seewave/man/corspec.html</a>).</p>
  <p>However, normalizing the frequency peaks relative to the fundamental suggested earlier is probably better solution.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-08-10T12:24:32.807Z
Answers.LastActivityDate: 2022-08-10T12:32:37.270Z
Answers.LastEditDate: 2022-08-10T12:32:37.270Z
Answers.UserDisplayName: Pavel Linhart
Body: <p>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.</p>
  <p>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.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-08T13:10:55.297Z
Comments.Text: Are you referring to formants? Unclear what is meant by "equal frequency composition"
Comments.UserDisplayName: Chloe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-08T14:38:58.307Z
Comments.Text: A short spectrogram segment may help dissipate the ambiguities?
Comments.UserDisplayName: Thejasvi
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-07-10T12:57:13.040Z
Comments.Text: 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?
Comments.UserDisplayName: Andreas Elepfandt
Tags: <spectral><comparison>
Title: Comparison of similar power spectra
ThreadText: # Comparison of similar power spectra
  
  (Asked by: username_0 on 2022-07-08)
  
  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.
  
  **Tags:** spectral, comparison
  
  > **Comments:**
  > **username_1**: Are you referring to formants? Unclear what is meant by "equal frequency composition"  
  > **username_2**: A short spectrogram segment may help dissipate the ambiguities?  
  > **username_0**: 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?  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_3 on 2022-07-08. Score: 6
  
  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.]
  
  > **Comments:**
  > **username_0**: 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?  
  > **username_3**: 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.  
  > **username_0**: I have tried to do so. But the program did not accept my spectrogram photo.  
  
  ---
  
  ### Answer by username_4 on 2022-07-08. Score: 2
  
  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](https://manual.audacityteam.org/man/change_pitch.html)):
  
  [![enter image description here](https://i.sstatic.net/A49kG.png)](https://i.sstatic.net/A49kG.png)
  
  Changing the pitch is better than [changing the speed](https://manual.audacityteam.org/man/change_speed.html) because it modifies harmonic-sound only and does not modify non-harmonic sounds such as clicks or noise.
  
  
  ---
  
  ### Answer by username_5 on 2022-08-10. Score: 1
  
  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.
  
  
  ---
  
  