Analysis of frequency division recordings

Hi Folks,

I am performing some tests with files from an envelope-preserving frequency division receiver (Bat detector).
Spectrogram analysis is very easy with Audacity, but obviously the frequency scale is relative to what is recorded.
At the visualization level, is it possible to expand the frequency axis by a fixed factor equal to that used in the receiver to have a direct match with the signal picked up by the microphone ?

I’m not sure exactly what you mean, but I think you may be able to get the result that you want with resampling. Could you give an example (with Hz / kHz values) to illustrate what you have and what you want?

Hi Steve,

Such audio files are compressed in the frequency domain by a fixed factor N (i.e. a pure CW tone of F Hz is transformed in a tone with a frequency F/N), but the time axis is not modified.
If I record a pulsed waveform with a frequency divisione receiver all the time-domain parameters are preserved (pulse length, etc.), but the spectrum is compressed.
The process compresses the original frequency spectrum so that a frequency span from fo [Hz] to f1 [Hz] becomes fo/N [Hz] to f1/N [Hz].
Taking a spectrogram of such a signal, the time axis is unmodified while the frequency axis shows the compression (if compared to the original source).
So, it’ could be useful (in the spectrogram view) to be able to change the frequency axis rescaling the span (expanding it by a factor N) without resampling the data. In this way the frequency axis should be representative of the original spectrum and some bioacustic analysis could be performed directly without too much calculations.

Is there a way to do so ?

Bat spectrograms have been covered previously …
https://forum.audacityteam.org/t/making-bat-recordings-audible/45317/15

Short answer:
No.


Longer answer:

No, but you could make a duplicate copy of the track (for visualization purposes only), and pitch shift up by a multiplier of “N”.

Some issues to note:

  1. The absolute highest frequency that can be represented digitally is half the sample rate. You must ensure that the track sample rate is more than double the highest frequency of interest.
    Example:
    If the highest frequency of interest is 80 kHz, then the track sample rate must be more than 160 kHz (160000 Hz). A commonly used sample rate above 160 kHz is 192 kHz, so this would be ideal.

To change the track sample rate, use “Tracks menu > Resample”, and select 192000 from the dropdown menu.

Note that resampling does not change the pitch, it just changes the number of digital samples per second.


2. Use the “Change Pitch” effect to shift the pitch back up by a multiplier of “N”.

This is a bit tricky as “Change Pitch” was designed for music / ‘normal’ audio rather than ultrasonics.
The maximum pitch change (in one application of the effect) is 400%, which increases the frequency x5 ( “N”=5 ).

The way that the percentage is calculated is:
((“New Hz” - “Orignal Hz”) / Original Hz) x 100

So, given that you know what “N” is, you can calculate the required percentage as:
(“N” - 1) x 100


Example:
If N = 10, then that’s 900% change, but that’s beyond the range of the effect, so you need to use at least 2 passes of the effect.
So you could apply the effect once to increase by x 5 (400%), and then again by x 2 (100%).


Note 1:
Pitch stretching is imperfect, and the greater the amount of stretch, the greater the amount of distortion.
I expect that you will need to use the “high quality stretching” option (see: https://manual.audacityteam.org/man/change_pitch.html), because the faster algorithm will probably be too echoey.


Note 2:
When playing back your original track, mute the new (pitch shifted) track by clicking the “Mute” button (see: https://manual.audacityteam.org/man/track_control_panel_and_vertical_scale.html)


Note 3:
The actual (ultrasonic) sound in the new track will only be a very rough approximation of the original sound made by the bats. Bat detectors introduce a huge amount of distortion, and the huge pitch shift adds more.

Thank you very much Steve ! I will definitely try what you suggest.
Is it possible to export the matrix of a spectrogram to a file ?

“Plot Spectrum” has an “Export” option: https://manual.audacityteam.org/man/plot_spectrum.html

Yes, I tried that function for the “conventional” spectrum, but is it possible with a spectrogram trace also ?

The Spectrogram View is a display only. You can take a Screenshot of it, but you can’t export it as data.

Even if you could export it as data, it would be difficult to use practically as the exported file would be huge (several megabytes).