This is a follow up question to: Segment/Idenfication of signal from a spectrogram
My main goal is to identify (segment) all of the calls from a given signal. The signal looks like the following (Spectrogram):
Notice how there are 4 calls within this signal, I would like to identify there are 4 calls and just capture these calls so I can then use this for later analysis.
So far I have carried out the following:
- Computed an STFT (Spectrogram on the time-signal) of a series of bat calls.
The spectrogram shows where each of the calls are, by the high energy levels.
What I am now calculating is the time variance between all of the different calls using the following formula:
$$ T = \sum_a^b x \sqrt{re*re+im*im} $$
This is calculated for each of the bins, the result is as follows:
Where I belive the x axis
relates to the time, and the y axis is the total variance
From this, it is clear where the most significant parts of the signal are, the 4 spikes indicate the parts that I need to extract, it's just how... I suppose I could use a threshold value, and state that:
if variance > THRESHOLD:
keep the block
else:
place "0" in each of the elements
But, how would I calculate the threshold in order to the above? What if the next set of calls are different to the threshold set for this?
Any help would be appreciated.
EDIT:
By doing the following (above) and, using a threshold value, I get the following result:
Therefore, can I calculate each of the frequencies (of the bird calls) based upon this? I.e. $$(binnumber * Fs) / NFFT$$
Where Fs
is the frequency sample rate and NFFT is the size of each of the bins?